Changeset 2c8946b for src/AST/StorageClasses.hpp
- Timestamp:
- May 23, 2024, 5:18:27 PM (4 months ago)
- Branches:
- master
- Children:
- dc74231
- Parents:
- fbc84ca
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/AST/StorageClasses.hpp
rfbc84ca r2c8946b 22 22 namespace Storage { 23 23 24 /// Bitflags for storage classes 25 enum { 26 Extern = 1 << 0, 27 Static = 1 << 1, 28 Auto = 1 << 2, 29 Register = 1 << 3, 30 ThreadLocalGcc = 1 << 4, 31 ThreadLocalC11 = 1 << 5, 32 NumClasses = 6 24 /// Bitflags for storage classes 25 enum { 26 Extern = 1 << 0, 27 Static = 1 << 1, 28 Auto = 1 << 2, 29 Register = 1 << 3, 30 ThreadLocalGcc = 1 << 4, 31 ThreadLocalC11 = 1 << 5, 32 }; 33 34 /// Bitflag type for storage classes 35 struct class_flags { 36 union { 37 unsigned int val; 38 struct { 39 bool is_extern : 1; 40 bool is_static : 1; 41 bool is_auto : 1; 42 bool is_register : 1; 43 bool is_threadlocalGcc : 1; 44 bool is_threadlocalC11 : 1; 45 }; 33 46 }; 34 47 35 /// Bitflag type for storage classes 36 struct class_flags { 37 union { 38 unsigned int val; 39 struct { 40 bool is_extern : 1; 41 bool is_static : 1; 42 bool is_auto : 1; 43 bool is_register : 1; 44 bool is_threadlocalGcc : 1; 45 bool is_threadlocalC11 : 1; 46 }; 48 constexpr class_flags( unsigned int val = 0 ) : val(val) {} 47 49 48 // MakeBitfieldPrint( NumClasses )49 50 bool is_threadlocal_any() { return this->is_threadlocalC11 || this->is_threadlocalGcc; } 51 }; 50 52 51 constexpr class_flags( unsigned int val = 0 ) : val(val) {} 53 using Classes = bitfield<class_flags>; 52 54 53 bool is_threadlocal_any() { return this->is_threadlocalC11 || this->is_threadlocalGcc; } 54 }; 55 } 55 56 56 using Classes = bitfield<class_flags>;57 }58 57 } 59 58
Note: See TracChangeset
for help on using the changeset viewer.