Changes in src/SymTab/Autogen.cc [d7dc824:4b0f997]
- File:
-
- 1 edited
-
src/SymTab/Autogen.cc (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/SymTab/Autogen.cc
rd7dc824 r4b0f997 262 262 // E ?=?(E volatile*, int), 263 263 // ?=?(E _Atomic volatile*, int); 264 void makeEnumFunctions( Enum InstType *refType, unsigned int functionNesting, std::list< Declaration * > &declsToAdd ) {264 void makeEnumFunctions( EnumDecl *enumDecl, 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 ) {488 void makeUnionAssignBody( FunctionDecl * funcDecl, bool isDynamicLayout ) { 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 508 bool isDynamicLayout = hasDynamicLayout( aggregateDecl ); // NOTE this flag is an incredibly ugly kludge; we should fix the assignment signature instead (ditto for struct) 509 509 510 // default ctor/dtor need only first parameter 510 511 // void ?{}(T *); void ^?{}(T *); … … 532 533 FunctionDecl *dtorDecl = genFunc( "^?{}", dtorType, functionNesting ); 533 534 534 makeUnionAssignBody( assignDecl );535 makeUnionAssignBody( assignDecl, isDynamicLayout ); 535 536 536 537 // body of assignment and copy ctor is the same 537 makeUnionAssignBody( copyCtorDecl );538 makeUnionAssignBody( copyCtorDecl, isDynamicLayout ); 538 539 539 540 // create a constructor which takes the first member type as a parameter. … … 550 551 FunctionDecl * ctor = genFunc( "?{}", memCtorType, functionNesting ); 551 552 552 makeUnionAssignBody( ctor );553 makeUnionAssignBody( ctor, isDynamicLayout ); 553 554 memCtors.push_back( ctor ); 554 555 // only generate a ctor for the first field … … 577 578 EnumInstType *enumInst = new EnumInstType( Type::Qualifiers(), enumDecl->get_name() ); 578 579 // enumInst->set_baseEnum( enumDecl ); 579 makeEnumFunctions( enum Inst, functionNesting, declsToAddAfter );580 makeEnumFunctions( enumDecl, enumInst, functionNesting, declsToAddAfter ); 580 581 } 581 582 }
Note:
See TracChangeset
for help on using the changeset viewer.