Changes in src/SynTree/Declaration.cc [843054c2:68cd1ce]
- File:
-
- 1 edited
-
src/SynTree/Declaration.cc (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/SynTree/Declaration.cc
r843054c2 r68cd1ce 10 10 // Created On : Mon May 18 07:44:20 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Mon May 18 08:18:35201513 // Update Count : 212 // Last Modified On : Sat Jun 13 08:07:20 2015 13 // Update Count : 9 14 14 // 15 15 … … 22 22 #include "utility.h" 23 23 24 const char* Declaration::storageClassName[] = { "", "auto", "static", "extern", "register" };25 26 24 static UniqueId lastUniqueId = 0; 27 25 typedef std::map< UniqueId, Declaration* > IdMapType; 28 26 static IdMapType idMap; 29 27 30 Declaration::Declaration( const std::string &name, StorageClass sc, LinkageSpec::Type linkage )31 : name( name ), storageClass( sc ), linkage( linkage ), uniqueId( 0 ) {28 Declaration::Declaration( const std::string &name, DeclarationNode::StorageClass sc, LinkageSpec::Type linkage ) 29 : name( name ), storageClass( sc ), linkage( linkage ), uniqueId( 0 ) { 32 30 } 33 31 34 32 Declaration::Declaration( const Declaration &other ) 35 : name( other.name ), storageClass( other.storageClass ), linkage( other.linkage ), uniqueId( other.uniqueId ) {33 : name( other.name ), storageClass( other.storageClass ), linkage( other.linkage ), uniqueId( other.uniqueId ) { 36 34 } 37 35 … … 44 42 } 45 43 46 /* static class method */47 44 Declaration *Declaration::declFromId( UniqueId id ) { 48 45 IdMapType::const_iterator i = idMap.find( id ); 49 if ( i != idMap.end() ) { 50 return i->second; 51 } else { 52 return 0; 53 } // if 46 return i != idMap.end() ? i->second : 0; 54 47 } 55 48 56 /* static class method */57 49 void Declaration::dumpIds( std::ostream &os ) { 58 50 for ( IdMapType::const_iterator i = idMap.begin(); i != idMap.end(); ++i ) {
Note:
See TracChangeset
for help on using the changeset viewer.