Changes in src/SynTree/Declaration.cc [aaeacf4:77bfc80]
- File:
-
- 1 edited
-
src/SynTree/Declaration.cc (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/SynTree/Declaration.cc
raaeacf4 r77bfc80 27 27 28 28 static UniqueId lastUniqueId = 0; 29 typedef std::map< UniqueId, Declaration* > IdMapType; 30 static IdMapType idMap; 29 31 30 32 Declaration::Declaration( const std::string &name, Type::StorageClasses scs, LinkageSpec::Spec linkage ) … … 43 45 if ( uniqueId ) return; 44 46 uniqueId = ++lastUniqueId; 47 idMap[ uniqueId ] = this; 45 48 } 49 50 Declaration *Declaration::declFromId( UniqueId id ) { 51 IdMapType::const_iterator i = idMap.find( id ); 52 return i != idMap.end() ? i->second : 0; 53 } 54 55 void Declaration::dumpIds( std::ostream &os ) { 56 for ( IdMapType::const_iterator i = idMap.begin(); i != idMap.end(); ++i ) { 57 os << i->first << " -> "; 58 i->second->printShort( os ); 59 os << std::endl; 60 } // for 61 } 62 46 63 47 64 AsmDecl::AsmDecl( AsmStmt *stmt ) : Declaration( "", Type::StorageClasses(), LinkageSpec::C ), stmt( stmt ) {
Note:
See TracChangeset
for help on using the changeset viewer.