Changeset b1e63ac5 for src/SymTab/Autogen.cc
- Timestamp:
- Jul 4, 2017, 9:40:16 AM (7 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:
- 208e5be
- Parents:
- 9c951e3 (diff), f7cb0bc (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. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/SymTab/Autogen.cc
r9c951e3 rb1e63ac5 9 9 // Author : Rob Schluntz 10 10 // Created On : Thu Mar 03 15:45:56 2016 11 // Last Modified By : Peter A. Buhr12 // Last Modified On : Fri Mar 17 09:41:08201713 // Update Count : 6 011 // Last Modified By : Andrew Beach 12 // Last Modified On : Wed Jun 28 15:30:00 2017 13 // Update Count : 61 14 14 // 15 15 … … 263 263 // E ?=?(E volatile*, int), 264 264 // ?=?(E _Atomic volatile*, int); 265 void makeEnumFunctions( Enum Decl *enumDecl, EnumInstType *refType, unsigned int functionNesting, std::list< Declaration * > &declsToAdd ) {265 void makeEnumFunctions( EnumInstType *refType, unsigned int functionNesting, std::list< Declaration * > &declsToAdd ) { 266 266 267 267 // T ?=?(E *, E); … … 401 401 /// generates struct constructors, destructor, and assignment functions 402 402 void makeStructFunctions( StructDecl *aggregateDecl, StructInstType *refType, unsigned int functionNesting, std::list< Declaration * > & declsToAdd, const std::vector< FuncData > & data ) { 403 // Builtins do not use autogeneration. 404 if ( aggregateDecl->get_linkage() == LinkageSpec::Builtin || 405 aggregateDecl->get_linkage() == LinkageSpec::BuiltinC ) { 406 return; 407 } 408 403 409 // Make function polymorphic in same parameters as generic struct, if applicable 404 410 const std::list< TypeDecl* > & typeParams = aggregateDecl->get_parameters(); // List of type variables to be placed on the generated functions … … 487 493 488 494 /// generates the body of a union assignment/copy constructor/field constructor 489 void makeUnionAssignBody( FunctionDecl * funcDecl , bool isDynamicLayout) {495 void makeUnionAssignBody( FunctionDecl * funcDecl ) { 490 496 FunctionType * ftype = funcDecl->get_functionType(); 491 497 assert( ftype->get_parameters().size() == 2 ); … … 507 513 // Make function polymorphic in same parameters as generic union, if applicable 508 514 const std::list< TypeDecl* > & typeParams = aggregateDecl->get_parameters(); // List of type variables to be placed on the generated functions 509 bool isDynamicLayout = hasDynamicLayout( aggregateDecl ); // NOTE this flag is an incredibly ugly kludge; we should fix the assignment signature instead (ditto for struct) 510 515 511 516 // default ctor/dtor need only first parameter 512 517 // void ?{}(T *); void ^?{}(T *); … … 534 539 FunctionDecl *dtorDecl = genFunc( "^?{}", dtorType, functionNesting ); 535 540 536 makeUnionAssignBody( assignDecl , isDynamicLayout);541 makeUnionAssignBody( assignDecl ); 537 542 538 543 // body of assignment and copy ctor is the same 539 makeUnionAssignBody( copyCtorDecl , isDynamicLayout);544 makeUnionAssignBody( copyCtorDecl ); 540 545 541 546 // create a constructor which takes the first member type as a parameter. … … 552 557 FunctionDecl * ctor = genFunc( "?{}", memCtorType, functionNesting ); 553 558 554 makeUnionAssignBody( ctor , isDynamicLayout);559 makeUnionAssignBody( ctor ); 555 560 memCtors.push_back( ctor ); 556 561 // only generate a ctor for the first field … … 579 584 EnumInstType *enumInst = new EnumInstType( Type::Qualifiers(), enumDecl->get_name() ); 580 585 // enumInst->set_baseEnum( enumDecl ); 581 makeEnumFunctions( enum Decl, enumInst, functionNesting, declsToAddAfter );586 makeEnumFunctions( enumInst, functionNesting, declsToAddAfter ); 582 587 } 583 588 }
Note: See TracChangeset
for help on using the changeset viewer.