Changeset 9a19608 for src/AST/Type.hpp
- Timestamp:
- Jun 4, 2019, 4:49:30 PM (5 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:
- 9519aba
- Parents:
- 1867c96 (diff), de8dfac2 (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
Legend:
- Unmodified
- Added
- Removed
-
src/AST/Type.hpp
r1867c96 r9a19608 77 77 }; 78 78 79 /// Set the `is_lvalue` qualifieron this type, cloning only if necessary79 /// Clear/reset the qualifiers on this type, cloning only if necessary 80 80 template< enum Node::ref_type ref_t > 81 void add_lvalue( ptr_base< Type, ref_t > & p) {82 if ( ! p->qualifiers.is_lvalue ) p.get_and_mutate()->qualifiers.is_lvalue = true;81 void reset_qualifiers( ptr_base< Type, ref_t > & p, CV::Qualifiers q = {} ) { 82 if ( p->qualifiers.val != q.val ) p.get_and_mutate()->qualifiers = q; 83 83 } 84 84 85 /// Clear the qualifiers onthis type, cloning only if necessary85 /// Add the specified qualifiers to this type, cloning only if necessary 86 86 template< enum Node::ref_type ref_t > 87 void clear_qualifiers( ptr_base< Type, ref_t > & p ) { 88 if ( p->qualifiers != CV::Qualifiers{} ) p.get_and_mutate()->qualifiers = CV::Qualifiers{}; 87 void add_qualifiers( ptr_base< Type, ref_t > & p, CV::Qualifiers q ) { 88 if ( ( p->qualifiers.val & q.val ) != q.val ) p.get_and_mutate()->qualifiers |= q; 89 } 90 91 /// Remove the specified qualifiers from this type, cloning only if necessary 92 template< enum Node::ref_type ref_t > 93 void remove_qualifiers( ptr_base< Type, ref_t > & p, CV::Qualifiers q ) { 94 if ( ( p->qualifiers.val & q.val ) != 0 ) p.get_and_mutate()->qualifiers -= q; 89 95 } 90 96
Note: See TracChangeset
for help on using the changeset viewer.