Ignore:
Timestamp:
Mar 16, 2017, 8:47:36 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:
fb04321
Parents:
26ba208
Message:

move type FuncSpecifiers? from DeclarationNode? to Type

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Parser/ParseNode.h

    r26ba208 rddfd945  
    1010// Created On       : Sat May 16 13:28:16 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Thu Mar 16 07:46:33 2017
    13 // Update Count     : 772
     12// Last Modified On : Thu Mar 16 08:32:43 2017
     13// Update Count     : 776
    1414//
    1515
     
    201201class DeclarationNode : public ParseNode {
    202202  public:
    203         enum { Inline = 1 << 0, Noreturn = 1 << 1, Fortran = 1 << 2, NumFuncSpecifier = 3 };
    204         union FuncSpecifiers {
    205                 static const char * Names[];
    206                 unsigned int val;
    207                 struct {
    208                         bool is_inline : 1;
    209                         bool is_noreturn : 1;
    210                         bool is_fortran : 1;
    211                 };
    212                 FuncSpecifiers() : val( 0 ) {}
    213                 FuncSpecifiers( unsigned int val ) : val( val ) {}
    214                 bool operator[]( unsigned int i ) const { return val & (1 << i); }
    215                 bool any() const { return val != 0; }
    216                 void print( std::ostream & os ) const {
    217                         if ( (*this).any() ) {                                          // any function specifiers ?
    218                                 for ( unsigned int i = 0; i < NumFuncSpecifier; i += 1 ) {
    219                                         if ( (*this)[i] ) {
    220                                                 os << FuncSpecifiers::Names[i] << ' ';
    221                                         } // if
    222                                 } // for
    223                         } // if
    224                 }
    225         }; // FuncSpecifiers
    226 
    227203        enum BasicType { Void, Bool, Char, Int, Float, Double, LongDouble, NoBasicType };
    228204        enum ComplexType { Complex, Imaginary, NoComplexType };
     
    242218
    243219        static DeclarationNode * newStorageClass( Type::StorageClasses );
    244         static DeclarationNode * newFuncSpecifier( FuncSpecifiers );
     220        static DeclarationNode * newFuncSpecifier( Type::FuncSpecifiers );
    245221        static DeclarationNode * newTypeQualifier( Type::Qualifiers );
    246222        static DeclarationNode * newBasicType( BasicType );
     
    339315        TypeData * type;
    340316
     317        Type::FuncSpecifiers funcSpecs;
    341318        Type::StorageClasses storageClasses;
    342         FuncSpecifiers funcSpecs;
    343319
    344320        ExpressionNode * bitfieldWidth;
Note: See TracChangeset for help on using the changeset viewer.