Changes in src/Parser/DeclarationNode.cc [984dce6:45161b4d]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Parser/DeclarationNode.cc
r984dce6 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.