Changeset 45161b4d for src/Parser/DeclarationNode.cc
- Timestamp:
- Apr 13, 2016, 5:08:56 PM (8 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, ctor, deferred_resn, demangler, enum, forall-pointer-decay, gc_noraii, jacob/cs343-translation, jenkins-sandbox, master, memory, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, string, with_gc
- Children:
- b11fac4
- Parents:
- 3849857
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Parser/DeclarationNode.cc
r3849857 r45161b4d 10 10 // Created On : Sat May 16 12:34:05 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Mon Mar 21 21:04:23201613 // Update Count : 1 4212 // Last Modified On : Wed Apr 13 16:53:17 2016 13 // Update Count : 161 14 14 // 15 15 … … 188 188 newnode->type->aggregate->name = assign_strptr( name ); 189 189 if ( newnode->type->aggregate->name == "" ) { // anonymous aggregate ? 190 newnode->type->aggregate->name = DeclarationNode::anonymous.newName(); 191 } else if ( ! typedefTable.exists( newnode->type->aggregate->name ) ) { 192 // SKULLDUGGERY: Generate a typedef for the aggregate name so the aggregate does not have to be qualified by 193 // "struct". Only generate the typedef, if the name is not in use. The typedef is implicitly (silently) removed 194 // if the name is explicitly used. 195 typedefTable.addToEnclosingScope( newnode->type->aggregate->name, TypedefTable::TD ); 196 DeclarationNode *typedf = new DeclarationNode; 197 typedf->name = newnode->type->aggregate->name; 198 newnode->appendList( typedf->addType( newnode->clone() )->addTypedef() ); 190 newnode->type->aggregate->name = anonymous.newName(); 199 191 } // if 200 192 newnode->type->aggregate->actuals = actuals; … … 210 202 if ( newnode->type->enumeration->name == "" ) { // anonymous enumeration ? 211 203 newnode->type->enumeration->name = DeclarationNode::anonymous.newName(); 212 } else if ( ! typedefTable.exists( newnode->type->enumeration->name ) ) {213 // SKULLDUGGERY: Generate a typedef for the enumeration name so the enumeration does not have to be qualified by214 // "enum". Only generate the typedef, if the name is not in use. The typedef is implicitly (silently) removed if215 // the name is explicitly used.216 typedefTable.addToEnclosingScope( newnode->type->enumeration->name, TypedefTable::TD );217 DeclarationNode *typedf = new DeclarationNode;218 typedf->name = newnode->type->enumeration->name;219 newnode->appendList( typedf->addType( newnode->clone() )->addTypedef() );220 204 } // if 221 205 newnode->type->enumeration->constants = constants;
Note: See TracChangeset
for help on using the changeset viewer.