Changeset 3d5701e for src/SynTree/Type.h
- Timestamp:
- Feb 25, 2020, 1:17:33 PM (6 years ago)
- Branches:
- ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- 7dc2e015
- Parents:
- 9fb8f01 (diff), dd9e1ca (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)links above to see all the changes relative to each parent. - File:
-
- 1 edited
-
src/SynTree/Type.h (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/SynTree/Type.h
r9fb8f01 r3d5701e 9 9 // Author : Richard C. Bilson 10 10 // Created On : Mon May 18 07:44:20 2015 11 // Last Modified By : Peter A. Buhr12 // Last Modified On : Thu Feb 14 17:11:24201913 // Update Count : 1 6911 // Last Modified By : Andrew Beach 12 // Last Modified On : Wed Sep 4 09:58:00 2019 13 // Update Count : 170 14 14 // 15 15 … … 102 102 }; // StorageClasses 103 103 104 enum { Const = 1 << 0, Restrict = 1 << 1, Volatile = 1 << 2, Lvalue = 1 << 3, Mutex = 1 << 4, Atomic = 1 << 5, NumTypeQualifier = 6};104 enum { Const = 1 << 0, Restrict = 1 << 1, Volatile = 1 << 2, Mutex = 1 << 3, Atomic = 1 << 4, NumTypeQualifier = 5 }; 105 105 static const char * QualifiersNames[]; 106 106 union Qualifiers { 107 enum { Mask = ~ (Restrict | Lvalue)};107 enum { Mask = ~Restrict }; 108 108 unsigned int val; 109 109 struct { … … 111 111 bool is_restrict : 1; 112 112 bool is_volatile : 1; 113 bool is_lvalue : 1;114 113 bool is_mutex : 1; 115 114 bool is_atomic : 1; … … 131 130 bool operator>( Qualifiers other ) const { return *this != other && *this >= other; } 132 131 BFCommon( Qualifiers, NumTypeQualifier ) 132 133 Qualifiers unify( Qualifiers const & other ) const { 134 int or_flags = Mask & (val | other.val); 135 int and_flags = val & other.val; 136 return Qualifiers( or_flags | and_flags ); 137 } 133 138 }; // Qualifiers 134 139 … … 147 152 bool get_volatile() const { return tq.is_volatile; } 148 153 bool get_restrict() const { return tq.is_restrict; } 149 bool get_lvalue() const { return tq.is_lvalue; }150 154 bool get_mutex() const { return tq.is_mutex; } 151 155 bool get_atomic() const { return tq.is_atomic; } … … 153 157 void set_volatile( bool newValue ) { tq.is_volatile = newValue; } 154 158 void set_restrict( bool newValue ) { tq.is_restrict = newValue; } 155 void set_lvalue( bool newValue ) { tq.is_lvalue = newValue; }156 159 void set_mutex( bool newValue ) { tq.is_mutex = newValue; } 157 160 void set_atomic( bool newValue ) { tq.is_atomic = newValue; }
Note:
See TracChangeset
for help on using the changeset viewer.