Ignore:
Timestamp:
Jun 13, 2015, 8:30:25 AM (9 years ago)
Author:
Peter A. Buhr <pabuhr@…>
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:
a1d5d2a
Parents:
7bcf74e
Message:

unify and fix storage class

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/SynTree/Declaration.cc

    r7bcf74e r68cd1ce  
    1010// Created On       : Mon May 18 07:44:20 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Mon May 18 08:18:35 2015
    13 // Update Count     : 2
     12// Last Modified On : Sat Jun 13 08:07:20 2015
     13// Update Count     : 9
    1414//
    1515
     
    2222#include "utility.h"
    2323
    24 const char* Declaration::storageClassName[] = { "", "auto", "static", "extern", "register" }; 
    25 
    2624static UniqueId lastUniqueId = 0;
    2725typedef std::map< UniqueId, Declaration* > IdMapType;
    2826static IdMapType idMap;
    2927
    30 Declaration::Declaration( const std::string &name, StorageClass sc, LinkageSpec::Type linkage )
    31         : name( name ), storageClass( sc ), linkage( linkage ), uniqueId( 0 ) {
     28Declaration::Declaration( const std::string &name, DeclarationNode::StorageClass sc, LinkageSpec::Type linkage )
     29                : name( name ), storageClass( sc ), linkage( linkage ), uniqueId( 0 ) {
    3230}
    3331
    3432Declaration::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 ) {
    3634}
    3735
     
    4442}
    4543
    46 /* static class method */
    4744Declaration *Declaration::declFromId( UniqueId id ) {
    4845        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;
    5447}
    5548
    56 /* static class method */
    5749void Declaration::dumpIds( std::ostream &os ) {
    5850        for ( IdMapType::const_iterator i = idMap.begin(); i != idMap.end(); ++i ) {
Note: See TracChangeset for help on using the changeset viewer.