Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/SynTree/Declaration.cc

    r68cd1ce r843054c2  
    1010// Created On       : Mon May 18 07:44:20 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Sat Jun 13 08:07:20 2015
    13 // Update Count     : 9
     12// Last Modified On : Mon May 18 08:18:35 2015
     13// Update Count     : 2
    1414//
    1515
     
    2222#include "utility.h"
    2323
     24const char* Declaration::storageClassName[] = { "", "auto", "static", "extern", "register" }; 
     25
    2426static UniqueId lastUniqueId = 0;
    2527typedef std::map< UniqueId, Declaration* > IdMapType;
    2628static IdMapType idMap;
    2729
    28 Declaration::Declaration( const std::string &name, DeclarationNode::StorageClass sc, LinkageSpec::Type linkage )
    29                 : name( name ), storageClass( sc ), linkage( linkage ), uniqueId( 0 ) {
     30Declaration::Declaration( const std::string &name, StorageClass sc, LinkageSpec::Type linkage )
     31        : name( name ), storageClass( sc ), linkage( linkage ), uniqueId( 0 ) {
    3032}
    3133
    3234Declaration::Declaration( const Declaration &other )
    33                 : name( other.name ), storageClass( other.storageClass ), linkage( other.linkage ), uniqueId( other.uniqueId ) {
     35        : name( other.name ), storageClass( other.storageClass ), linkage( other.linkage ), uniqueId( other.uniqueId ) {
    3436}
    3537
     
    4244}
    4345
     46/* static class method */
    4447Declaration *Declaration::declFromId( UniqueId id ) {
    4548        IdMapType::const_iterator i = idMap.find( id );
    46         return i != idMap.end() ? i->second : 0;
     49        if ( i != idMap.end() ) {
     50                return i->second;
     51        } else {
     52                return 0;
     53        } // if
    4754}
    4855
     56/* static class method */
    4957void Declaration::dumpIds( std::ostream &os ) {
    5058        for ( IdMapType::const_iterator i = idMap.begin(); i != idMap.end(); ++i ) {
Note: See TracChangeset for help on using the changeset viewer.