Changeset 45161b4d for src/Parser/TypedefTable.cc
- Timestamp:
- Apr 13, 2016, 5:08:56 PM (9 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/TypedefTable.cc
r3849857 r45161b4d 10 10 // Created On : Sat May 16 15:20:13 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Mon Mar 21 18:18:58201613 // Update Count : 2 312 // Last Modified On : Wed Apr 13 16:57:30 2016 13 // Update Count : 24 14 14 // 15 15 … … 33 33 } 34 34 35 int TypedefTable::isKind( const string &identifier ) const { 36 tableType::const_iterator id_pos = table.find( identifier ); 37 // Name lookup defaults to identifier, and then the identifier's kind is set by the parser. 38 if ( id_pos == table.end() ) return IDENTIFIER; 39 return id_pos->second.begin()->kind; 40 } 41 35 42 void TypedefTable::changeKind( const string &identifier, kind_t kind ) { 36 43 tableType::iterator id_pos = table.find( identifier ); … … 39 46 } 40 47 41 int TypedefTable::isKind( const string &identifier ) const { 42 tableType::const_iterator id_pos = table.find( identifier ); 43 // Name lookup defaults to identifier, and then the identifier's kind is set by the parser. 44 if ( id_pos == table.end() ) return IDENTIFIER; 45 return id_pos->second.begin()->kind; 48 // SKULLDUGGERY: Generate a typedef for the aggregate name so the aggregate does not have to be qualified by 49 // "struct". Only generate the typedef, if the name is not in use. The typedef is implicitly (silently) removed 50 // if the name is explicitly used. 51 void TypedefTable::makeTypedef( const string &name ) { 52 if ( ! typedefTable.exists( name ) ) { 53 typedefTable.addToEnclosingScope( name, TypedefTable::TD ); 54 } // if 46 55 } 47 56
Note: See TracChangeset
for help on using the changeset viewer.