Ignore:
Timestamp:
Mar 16, 2017, 8:23:42 AM (7 years ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
Children:
26ba208
Parents:
6e8bd43
git-author:
Peter A. Buhr <pabuhr@…> (03/16/17 08:19:39)
git-committer:
Peter A. Buhr <pabuhr@…> (03/16/17 08:23:42)
Message:

move type StorageClasses? from DeclarationNode? to Type

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Parser/ParseNode.h

    r6e8bd43 r68fe077a  
    1010// Created On       : Sat May 16 13:28:16 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Wed Mar 15 23:31:02 2017
    13 // Update Count     : 770
     12// Last Modified On : Thu Mar 16 07:46:33 2017
     13// Update Count     : 772
    1414//
    1515
     
    201201class DeclarationNode : public ParseNode {
    202202  public:
    203         // These must remain in the same order as the corresponding DeclarationNode names.
    204 
    205         enum { Extern = 1 << 0, Static = 1 << 1, Auto = 1 << 2, Register = 1 << 3, Threadlocal = 1 << 4, NumStorageClass = 5 };
    206         union StorageClasses {
    207                 static const char * Names[];
    208                 unsigned int val;
    209                 struct {
    210                         bool is_extern : 1;
    211                         bool is_static : 1;
    212                         bool is_auto : 1;
    213                         bool is_register : 1;
    214                         bool is_threadlocal : 1;
    215                 };
    216 
    217                 StorageClasses() : val( 0 ) {}
    218                 StorageClasses( unsigned int val ) : val( val ) {}
    219                 bool operator[]( unsigned int i ) const { return val & (1 << i); }
    220                 bool any() const { return val != 0; }
    221                 void print( std::ostream & os ) const {
    222                         if ( (*this).any() ) {                                          // any storage classes ?
    223                                 for ( unsigned int i = 0; i < NumStorageClass; i += 1 ) {
    224                                         if ( (*this)[i] ) {
    225                                                 os << StorageClasses::Names[i] << ' ';
    226                                         } // if
    227                                 } // for
    228                         } // if
    229                 }
    230         }; // StorageClasses
    231 
    232203        enum { Inline = 1 << 0, Noreturn = 1 << 1, Fortran = 1 << 2, NumFuncSpecifier = 3 };
    233204        union FuncSpecifiers {
     
    270241        static const char * builtinTypeNames[];
    271242
    272         static DeclarationNode * newStorageClass( StorageClasses );
     243        static DeclarationNode * newStorageClass( Type::StorageClasses );
    273244        static DeclarationNode * newFuncSpecifier( FuncSpecifiers );
    274245        static DeclarationNode * newTypeQualifier( Type::Qualifiers );
     
    368339        TypeData * type;
    369340
    370         StorageClasses storageClasses;
     341        Type::StorageClasses storageClasses;
    371342        FuncSpecifiers funcSpecs;
    372343
Note: See TracChangeset for help on using the changeset viewer.