Changeset ddfd945 for src/Parser/ParseNode.h
- Timestamp:
- Mar 16, 2017, 8:47:36 AM (7 years ago)
- 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
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Parser/ParseNode.h
r26ba208 rddfd945 10 10 // Created On : Sat May 16 13:28:16 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Thu Mar 16 0 7:46:33 201713 // Update Count : 77 212 // Last Modified On : Thu Mar 16 08:32:43 2017 13 // Update Count : 776 14 14 // 15 15 … … 201 201 class DeclarationNode : public ParseNode { 202 202 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 } // if222 } // for223 } // if224 }225 }; // FuncSpecifiers226 227 203 enum BasicType { Void, Bool, Char, Int, Float, Double, LongDouble, NoBasicType }; 228 204 enum ComplexType { Complex, Imaginary, NoComplexType }; … … 242 218 243 219 static DeclarationNode * newStorageClass( Type::StorageClasses ); 244 static DeclarationNode * newFuncSpecifier( FuncSpecifiers );220 static DeclarationNode * newFuncSpecifier( Type::FuncSpecifiers ); 245 221 static DeclarationNode * newTypeQualifier( Type::Qualifiers ); 246 222 static DeclarationNode * newBasicType( BasicType ); … … 339 315 TypeData * type; 340 316 317 Type::FuncSpecifiers funcSpecs; 341 318 Type::StorageClasses storageClasses; 342 FuncSpecifiers funcSpecs;343 319 344 320 ExpressionNode * bitfieldWidth;
Note: See TracChangeset
for help on using the changeset viewer.