Changeset 9f70ab57 for src/SymTab
- Timestamp:
- Sep 7, 2016, 11:30:02 AM (8 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, ctor, 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:
- 02cea2d, 940bba3
- Parents:
- 5fda7143
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/SymTab/Autogen.cc
r5fda7143 r9f70ab57 280 280 } 281 281 282 void addForwardDecl( FunctionDecl * functionDecl, std::list< Declaration * > & declsToAdd ) { 283 FunctionDecl * decl = functionDecl->clone(); 284 delete decl->get_statements(); 285 decl->set_statements( NULL ); 286 declsToAdd.push_back( decl ); 287 decl->fixUniqueId(); 288 } 289 282 290 void makeStructFunctions( StructDecl *aggregateDecl, StructInstType *refType, unsigned int functionNesting, std::list< Declaration * > & declsToAdd ) { 283 291 FunctionType *assignType = new FunctionType( Type::Qualifiers(), false ); … … 324 332 copyCtorDecl->fixUniqueId(); 325 333 dtorDecl->fixUniqueId(); 334 335 if ( functionNesting == 0 ) { 336 // forward declare if top-level struct, so that 337 // type is complete as soon as its body ends 338 addForwardDecl( assignDecl, declsToAdd ); 339 addForwardDecl( ctorDecl, declsToAdd ); 340 addForwardDecl( copyCtorDecl, declsToAdd ); 341 addForwardDecl( dtorDecl, declsToAdd ); 342 } 326 343 327 344 // create constructors which take each member type as a parameter.
Note: See TracChangeset
for help on using the changeset viewer.