Changeset fb57626 for src/Concurrency


Ignore:
Timestamp:
Dec 18, 2017, 2:27:58 PM (8 years ago)
Author:
Rob Schluntz <rschlunt@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, stuck-waitfor-destruct, with_gc
Children:
46dfe66
Parents:
b8b075cd (diff), 06088f9a (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'master' of plg.uwaterloo.ca:/u/cforall/software/cfa/cfa-cc

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Concurrency/Keywords.cc

    rb8b075cd rfb57626  
    257257        // Generic keyword implementation
    258258        //=============================================================================================
     259        void fixupGenerics(FunctionType * func, StructDecl * decl) {
     260                cloneAll(decl->parameters, func->forall);
     261                for ( TypeDecl * td : func->forall ) {
     262                        strict_dynamic_cast<StructInstType*>(
     263                                func->parameters.front()->get_type()->stripReferences()
     264                        )->parameters.push_back(
     265                                new TypeExpr( new TypeInstType( noQualifiers, td->name, td ) )
     266                        );
     267                }
     268        }
     269
    259270        void ConcurrentSueKeyword::postvisit(StructDecl * decl) {
    260271                if( decl->name == type_name && decl->body ) {
     
    301312                );
    302313
    303                 get_type->get_parameters().push_back( this_decl );
     314                get_type->get_parameters().push_back( this_decl->clone() );
    304315                get_type->get_returnVals().push_back(
    305316                        new ObjectDecl(
     
    318329                        )
    319330                );
     331                fixupGenerics(get_type, decl);
    320332
    321333                FunctionDecl * get_decl = new FunctionDecl(
     
    343355                                nullptr
    344356                        );
    345                 }
     357                        fixupGenerics(main_type, decl);
     358                }
     359
     360                delete this_decl;
    346361
    347362                declsToAddBefore.push_back( forward );
     
    377392                                        new MemberExpr(
    378393                                                field,
    379                                                 UntypedExpr::createDeref( new VariableExpr( func->get_functionType()->get_parameters().front() ) )
     394                                                new CastExpr(
     395                                                        new VariableExpr( func->get_functionType()->get_parameters().front() ),
     396                                                        func->get_functionType()->get_parameters().front()->get_type()->stripReferences()->clone()
     397                                                )
    380398                                        )
    381399                                )
Note: See TracChangeset for help on using the changeset viewer.