Changeset 6e8bd43 for src/Parser/ParseNode.h
- Timestamp:
- Mar 16, 2017, 7:41:45 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:
- 64b6913, 68fe077a
- Parents:
- 905eca1
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Parser/ParseNode.h
r905eca1 r6e8bd43 10 10 // Created On : Sat May 16 13:28:16 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Wed Mar 15 2 2:17:50201713 // Update Count : 7 6212 // Last Modified On : Wed Mar 15 23:31:02 2017 13 // Update Count : 770 14 14 // 15 15 … … 205 205 enum { Extern = 1 << 0, Static = 1 << 1, Auto = 1 << 2, Register = 1 << 3, Threadlocal = 1 << 4, NumStorageClass = 5 }; 206 206 union StorageClasses { 207 static const char * Names[]; 207 208 unsigned int val; 208 209 struct { … … 213 214 bool is_threadlocal : 1; 214 215 }; 216 215 217 StorageClasses() : val( 0 ) {} 216 218 StorageClasses( unsigned int val ) : val( val ) {} 217 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 } 218 230 }; // StorageClasses 219 231 220 232 enum { Inline = 1 << 0, Noreturn = 1 << 1, Fortran = 1 << 2, NumFuncSpecifier = 3 }; 221 233 union FuncSpecifiers { 234 static const char * Names[]; 222 235 unsigned int val; 223 236 struct { … … 229 242 FuncSpecifiers( unsigned int val ) : val( val ) {} 230 243 bool operator[]( unsigned int i ) const { return val & (1 << i); } 244 bool any() const { return val != 0; } 245 void print( std::ostream & os ) const { 246 if ( (*this).any() ) { // any function specifiers ? 247 for ( unsigned int i = 0; i < NumFuncSpecifier; i += 1 ) { 248 if ( (*this)[i] ) { 249 os << FuncSpecifiers::Names[i] << ' '; 250 } // if 251 } // for 252 } // if 253 } 231 254 }; // FuncSpecifiers 232 255 … … 239 262 enum BuiltinType { Valist, Zero, One, NoBuiltinType }; 240 263 241 static const char * storageClassNames[];242 static const char * funcSpecifierNames[];243 264 static const char * basicTypeNames[]; 244 265 static const char * complexTypeNames[]; … … 348 369 349 370 StorageClasses storageClasses; 350 static void print_StorageClass( std::ostream & output, StorageClasses storageClasses );351 352 371 FuncSpecifiers funcSpecs; 353 static void print_FuncSpec( std::ostream & output, FuncSpecifiers funcSpecs );354 372 355 373 ExpressionNode * bitfieldWidth;
Note: See TracChangeset
for help on using the changeset viewer.