Changes in src/Parser/DeclarationNode.cc [45161b4d:984dce6]
- File:
-
- 1 edited
-
src/Parser/DeclarationNode.cc (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/Parser/DeclarationNode.cc
r45161b4d r984dce6 10 10 // Created On : Sat May 16 12:34:05 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Wed Apr 13 16:53:17201613 // Update Count : 1 6112 // Last Modified On : Mon Mar 21 21:04:23 2016 13 // Update Count : 142 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 = anonymous.newName(); 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() ); 191 199 } // if 192 200 newnode->type->aggregate->actuals = actuals; … … 202 210 if ( newnode->type->enumeration->name == "" ) { // anonymous enumeration ? 203 211 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 by 214 // "enum". Only generate the typedef, if the name is not in use. The typedef is implicitly (silently) removed if 215 // 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() ); 204 220 } // if 205 221 newnode->type->enumeration->constants = constants;
Note:
See TracChangeset
for help on using the changeset viewer.