Changeset be9036d for src/SynTree
- Timestamp:
- Aug 31, 2017, 3:29:38 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:
- 326338ae
- Parents:
- 5b21138
- git-author:
- Rob Schluntz <rschlunt@…> (08/31/17 15:29:33)
- git-committer:
- Rob Schluntz <rschlunt@…> (08/31/17 15:29:38)
- Location:
- src/SynTree
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
src/SynTree/Mutator.cc
r5b21138 rbe9036d 538 538 Type * Mutator::mutate( TraitInstType *aggregateUseType ) { 539 539 handleReferenceToType( aggregateUseType ); 540 mutateAll( aggregateUseType->get_members(), *this );541 540 return aggregateUseType; 542 541 } -
src/SynTree/ReferenceToType.cc
r5b21138 rbe9036d 132 132 std::string TraitInstType::typeString() const { return "trait"; } 133 133 134 TraitInstType::TraitInstType( const TraitInstType &other ) : Parent( other ) { 135 cloneAll( other.members, members ); 134 TraitInstType::TraitInstType( const Type::Qualifiers & tq, TraitDecl * baseTrait, const std::list< Attribute * > & attributes ) : Parent( tq, baseTrait->name, attributes ), baseTrait( baseTrait ) {} 135 136 TraitInstType::TraitInstType( const TraitInstType &other ) : Parent( other ), baseTrait( other.baseTrait ) { 136 137 } 137 138 138 139 TraitInstType::~TraitInstType() { 139 deleteAll( members );140 140 } 141 141 -
src/SynTree/Type.h
r5b21138 rbe9036d 471 471 typedef ReferenceToType Parent; 472 472 public: 473 // this member is filled in by the validate pass, which instantiates the members of the correponding 474 // aggregate with the actual type parameters specified for this use of the context 475 std::list< Declaration* > members; 476 477 TraitInstType( const Type::Qualifiers & tq, const std::string & name, const std::list< Attribute * > & attributes = std::list< Attribute * >() ) : Parent( tq, name, attributes ) {} 473 // this decl is not "owned" by the trait inst; it is merely a pointer to elsewhere in the tree, 474 // where the trait used in this type is actually defined 475 TraitDecl * baseTrait = nullptr; 476 477 TraitInstType( const Type::Qualifiers & tq, const std::string & name, const std::list< Attribute * > & attributes = std::list< Attribute * >() ) : Parent( tq, name, attributes ) {} 478 TraitInstType( const Type::Qualifiers & tq, TraitDecl * baseTrait, const std::list< Attribute * > & attributes = std::list< Attribute * >() ); 478 479 TraitInstType( const TraitInstType & other ); 479 480 ~TraitInstType(); 480 481 std::list< Declaration* >& get_members() { return members; }482 481 483 482 virtual bool isComplete() const; -
src/SynTree/TypeSubstitution.h
r5b21138 rbe9036d 177 177 void applySubstitution( FormalIterator formalBegin, FormalIterator formalEnd, ActualIterator actual, MemberIterator memberBegin, MemberIterator memberEnd, OutputIterator out ) { 178 178 TypeSubstitution sub = TypeSubstitution( formalBegin, formalEnd, actual ); 179 for ( std::list< Declaration* >::iteratori = memberBegin; i != memberEnd; ++i ) {179 for ( auto i = memberBegin; i != memberEnd; ++i ) { 180 180 sub.apply( *i ); 181 181 *out++ = *i; -
src/SynTree/Visitor.cc
r5b21138 rbe9036d 429 429 void Visitor::visit( TraitInstType *aggregateUseType ) { 430 430 handleReferenceToType( static_cast< ReferenceToType * >( aggregateUseType ) ); 431 acceptAll( aggregateUseType->get_members(), *this );432 431 } 433 432
Note: See TracChangeset
for help on using the changeset viewer.