Changeset aaeacf4 for src/SynTree/Declaration.cc
- Timestamp:
- Jun 12, 2019, 4:06:32 PM (5 years ago)
- Branches:
- ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- 21300d7
- Parents:
- 6e3e0717
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/SynTree/Declaration.cc
r6e3e0717 raaeacf4 27 27 28 28 static UniqueId lastUniqueId = 0; 29 typedef std::map< UniqueId, Declaration* > IdMapType;30 static IdMapType idMap;31 29 32 30 Declaration::Declaration( const std::string &name, Type::StorageClasses scs, LinkageSpec::Spec linkage ) … … 45 43 if ( uniqueId ) return; 46 44 uniqueId = ++lastUniqueId; 47 idMap[ uniqueId ] = this;48 45 } 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 } // for61 }62 63 46 64 47 AsmDecl::AsmDecl( AsmStmt *stmt ) : Declaration( "", Type::StorageClasses(), LinkageSpec::C ), stmt( stmt ) {
Note: See TracChangeset
for help on using the changeset viewer.