Changeset e6cee92 for src/SynTree
- Timestamp:
- Jul 17, 2017, 3:25:58 PM (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:
- 795d450
- Parents:
- 7ebaa56
- Location:
- src/SynTree
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
src/SynTree/Expression.cc
r7ebaa56 re6cee92 502 502 } 503 503 504 AsmExpr::AsmExpr( const AsmExpr & other ) : inout( maybeClone( other.inout ) ), constraint( maybeClone( other.constraint ) ), operand( maybeClone( other.operand ) ) {}504 AsmExpr::AsmExpr( const AsmExpr & other ) : Expression( other ), inout( maybeClone( other.inout ) ), constraint( maybeClone( other.constraint ) ), operand( maybeClone( other.operand ) ) {} 505 505 506 506 -
src/SynTree/ReferenceType.cc
r7ebaa56 re6cee92 19 19 20 20 ReferenceType::ReferenceType( const Type::Qualifiers &tq, Type *base, const std::list< Attribute * > & attributes ) 21 : Type( tq, attributes ), base( base ) { 21 : Type( tq, attributes ), base( base ) { 22 assertf( base, "Reference Type with a null base created." ); 22 23 } 23 24 24 25 ReferenceType::ReferenceType( const ReferenceType &other ) 25 26 : Type( other ), base( maybeClone( other.base ) ) { 26 27 } 27 28 28 29 ReferenceType::~ReferenceType() { 29 delete base; 30 delete base; 31 } 32 33 int ReferenceType::referenceDepth() const { 34 return base->referenceDepth()+1; 30 35 } 31 36 32 37 void ReferenceType::print( std::ostream &os, int indent ) const { 33 34 35 36 37 38 Type::print( os, indent ); 39 os << "reference to "; 40 if ( base ) { 41 base->print( os, indent ); 42 } // if 38 43 } 39 44 -
src/SynTree/Type.cc
r7ebaa56 re6cee92 81 81 } 82 82 83 int Type::referenceDepth() const { return 0; } 84 83 85 void Type::print( std::ostream &os, int indent ) const { 84 86 if ( ! forall.empty() ) { -
src/SynTree/Type.h
r7ebaa56 re6cee92 163 163 Type * stripReferences(); 164 164 165 /// return the number of references occuring consecutively on the outermost layer of this type (i.e. do not count references nested within other types) 166 virtual int referenceDepth() const; 167 165 168 virtual bool isComplete() const { return true; } 166 169 … … 304 307 void set_base( Type *newValue ) { base = newValue; } 305 308 309 virtual int referenceDepth() const; 310 306 311 virtual ReferenceType *clone() const { return new ReferenceType( *this ); } 307 312 virtual void accept( Visitor & v ) { v.visit( this ); } -
src/SynTree/TypeExpr.cc
r7ebaa56 re6cee92 5 5 // file "LICENCE" distributed with Cforall. 6 6 // 7 // TypeExpr.cc -- 7 // TypeExpr.cc -- 8 8 // 9 9 // Author : Richard C. Bilson … … 21 21 } 22 22 23 TypeExpr::TypeExpr( const TypeExpr &other ) : type( maybeClone( other.type ) ) {23 TypeExpr::TypeExpr( const TypeExpr &other ) : Expression( other ), type( maybeClone( other.type ) ) { 24 24 } 25 25
Note: See TracChangeset
for help on using the changeset viewer.