Ignore:
Timestamp:
Nov 10, 2015, 4:15:48 PM (7 years ago)
Author:
Aaron Moss <a3moss@…>
Branches:
aaron-thesis, arm-eh, cleanup-dtors, ctor, deferred_resn, demangler, enum, forall-pointer-decay, gc_noraii, jacob/cs343-translation, jenkins-sandbox, master, memory, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, resolv-new, string, with_gc
Children:
d8847b7
Parents:
d2ded3e7
Message:

First code generation for generic types (incorrect)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/SymTab/Validate.cc

    rd2ded3e7 r37a3b8f9  
    629629        Declaration *makeStructAssignment( StructDecl *aggregateDecl, StructInstType *refType, unsigned int functionNesting ) {
    630630                FunctionType *assignType = new FunctionType( Type::Qualifiers(), false );
     631
     632                // Make function polymorphic in same parameters as generic struct, if applicable
     633                std::list< TypeDecl* >& genericParams = aggregateDecl->get_parameters();
     634                for ( std::list< TypeDecl* >::const_iterator param = genericParams.begin(); param != genericParams.end(); ++param ) {
     635                        assignType->get_forall().push_back( (*param)->clone() );
     636                }
    631637 
    632638                ObjectDecl *returnVal = new ObjectDecl( "", DeclarationNode::NoStorageClass, LinkageSpec::Cforall, 0, refType->clone(), 0 );
Note: See TracChangeset for help on using the changeset viewer.