Changeset d7dc824 for src/SymTab
- Timestamp:
- Jun 7, 2017, 4:53:42 PM (8 years ago)
- 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, with_gc
- Children:
- c77fd8b, ec95d11
- Parents:
- af397ef8
- Location:
- src/SymTab
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
src/SymTab/Autogen.cc
raf397ef8 rd7dc824 262 262 // E ?=?(E volatile*, int), 263 263 // ?=?(E _Atomic volatile*, int); 264 void makeEnumFunctions( Enum Decl *enumDecl, EnumInstType *refType, unsigned int functionNesting, std::list< Declaration * > &declsToAdd ) {264 void makeEnumFunctions( EnumInstType *refType, unsigned int functionNesting, std::list< Declaration * > &declsToAdd ) { 265 265 266 266 // T ?=?(E *, E); … … 486 486 487 487 /// generates the body of a union assignment/copy constructor/field constructor 488 void makeUnionAssignBody( FunctionDecl * funcDecl , bool isDynamicLayout) {488 void makeUnionAssignBody( FunctionDecl * funcDecl ) { 489 489 FunctionType * ftype = funcDecl->get_functionType(); 490 490 assert( ftype->get_parameters().size() == 2 ); … … 506 506 // Make function polymorphic in same parameters as generic union, if applicable 507 507 const std::list< TypeDecl* > & typeParams = aggregateDecl->get_parameters(); // List of type variables to be placed on the generated functions 508 bool isDynamicLayout = hasDynamicLayout( aggregateDecl ); // NOTE this flag is an incredibly ugly kludge; we should fix the assignment signature instead (ditto for struct) 509 508 510 509 // default ctor/dtor need only first parameter 511 510 // void ?{}(T *); void ^?{}(T *); … … 533 532 FunctionDecl *dtorDecl = genFunc( "^?{}", dtorType, functionNesting ); 534 533 535 makeUnionAssignBody( assignDecl , isDynamicLayout);534 makeUnionAssignBody( assignDecl ); 536 535 537 536 // body of assignment and copy ctor is the same 538 makeUnionAssignBody( copyCtorDecl , isDynamicLayout);537 makeUnionAssignBody( copyCtorDecl ); 539 538 540 539 // create a constructor which takes the first member type as a parameter. … … 551 550 FunctionDecl * ctor = genFunc( "?{}", memCtorType, functionNesting ); 552 551 553 makeUnionAssignBody( ctor , isDynamicLayout);552 makeUnionAssignBody( ctor ); 554 553 memCtors.push_back( ctor ); 555 554 // only generate a ctor for the first field … … 578 577 EnumInstType *enumInst = new EnumInstType( Type::Qualifiers(), enumDecl->get_name() ); 579 578 // enumInst->set_baseEnum( enumDecl ); 580 makeEnumFunctions( enum Decl, enumInst, functionNesting, declsToAddAfter );579 makeEnumFunctions( enumInst, functionNesting, declsToAddAfter ); 581 580 } 582 581 } -
src/SymTab/Indexer.cc
raf397ef8 rd7dc824 518 518 acceptNewScope( tupleExpr->get_result(), *this ); 519 519 maybeAccept( tupleExpr->get_tuple(), *this ); 520 }521 522 void Indexer::visit( MemberTupleExpr *tupleExpr ) {523 acceptNewScope( tupleExpr->get_result(), *this );524 maybeAccept( tupleExpr->get_member(), *this );525 maybeAccept( tupleExpr->get_aggregate(), *this );526 520 } 527 521 -
src/SymTab/Indexer.h
raf397ef8 rd7dc824 74 74 virtual void visit( TupleExpr *tupleExpr ); 75 75 virtual void visit( TupleIndexExpr *tupleExpr ); 76 virtual void visit( MemberTupleExpr *tupleExpr );77 76 virtual void visit( TupleAssignExpr *tupleExpr ); 78 77 virtual void visit( StmtExpr * stmtExpr );
Note:
See TracChangeset
for help on using the changeset viewer.