Changeset d76c588 for src/AST/Type.hpp
- Timestamp:
- May 30, 2019, 4:10:24 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:
- 8d70648
- Parents:
- eba615c
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/AST/Type.hpp
reba615c rd76c588 25 25 #include "Decl.hpp" // for AggregateDecl subclasses 26 26 #include "Fwd.hpp" 27 #include "Node.hpp" // for Node, ptr 27 #include "Node.hpp" // for Node, ptr, ptr_base 28 28 #include "TypeVar.hpp" 29 29 #include "Visitor.hpp" … … 58 58 virtual bool isVoid() const { return size() == 0; } 59 59 /// Get the i'th component of this type 60 virtual const Type * getComponent( unsigned i ) ;60 virtual const Type * getComponent( unsigned i ) const; 61 61 62 62 /// type without outer pointers and arrays 63 const Type * stripDeclarator() ;63 const Type * stripDeclarator() const; 64 64 /// type without outer references 65 const Type * stripReferences() ;65 const Type * stripReferences() const; 66 66 /// number of reference occuring consecutively on the outermost layer of this type 67 67 /// (i.e. do not count references nested within other types) … … 75 75 MUTATE_FRIEND 76 76 }; 77 78 /// Set the `is_lvalue` qualifier on this type, cloning only if necessary 79 template< enum Node::ref_type ref_t > 80 void add_lvalue( ptr_base< Type, ref_t > & p ) { 81 if ( ! p->qualifiers.is_lvalue ) p.get_and_mutate()->qualifiers.is_lvalue = true; 82 } 83 84 /// Clear the qualifiers on this type, cloning only if necessary 85 template< enum Node::ref_type ref_t > 86 void clear_qualifiers( ptr_base< Type, ref_t > & p ) { 87 if ( p->qualifiers != CV::Qualifiers{} ) p.get_and_mutate()->qualifiers = CV::Qualifiers{}; 88 } 77 89 78 90 /// `void` … … 437 449 unsigned size() const override { return types.size(); } 438 450 439 const Type * getComponent( unsigned i ) override {451 const Type * getComponent( unsigned i ) const override { 440 452 assertf( i < size(), "TupleType::getComponent: index %d must be less than size %d", 441 453 i, size() );
Note: See TracChangeset
for help on using the changeset viewer.