Changeset 1e1e15b
- Timestamp:
- Jun 23, 2016, 12:16:45 PM (8 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, ctor, deferred_resn, demangler, enum, forall-pointer-decay, gc_noraii, jacob/cs343-translation, jenkins-sandbox, master, memory, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
- Children:
- 0caaa6a
- Parents:
- 51fcaf8d
- git-author:
- Rob Schluntz <rschlunt@…> (06/23/16 11:29:38)
- git-committer:
- Rob Schluntz <rschlunt@…> (06/23/16 12:16:45)
- Location:
- src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
src/SymTab/Indexer.h
r51fcaf8d r1e1e15b 5 5 // file "LICENCE" distributed with Cforall. 6 6 // 7 // Indexer.h -- 7 // Indexer.h -- 8 8 // 9 9 // Author : Richard C. Bilson … … 33 33 Indexer& operator= ( Indexer &&that ); 34 34 35 //using Visitor::visit;35 using Visitor::visit; 36 36 virtual void visit( ObjectDecl *objectDecl ); 37 37 virtual void visit( FunctionDecl *functionDecl ); … … 54 54 virtual void visit( MemberExpr *memberExpr ); 55 55 virtual void visit( VariableExpr *variableExpr ); 56 virtual void visit( ConstantExpr *constantExpr ); 56 virtual void visit( ConstantExpr *constantExpr ); 57 57 virtual void visit( SizeofExpr *sizeofExpr ); 58 58 virtual void visit( AlignofExpr *alignofExpr ); … … 93 93 /// Gets the top-most trait declaration with the given ID 94 94 TraitDecl *lookupTrait( const std::string &id ) const; 95 95 96 96 void print( std::ostream &os, int indent = 0 ) const; 97 97 private: … … 106 106 UnionDecl *lookupUnionAtScope( const std::string &id, unsigned long scope ) const; 107 107 TraitDecl *lookupTraitAtScope( const std::string &id, unsigned long scope ) const; 108 108 109 109 void addId( DeclarationWithType *decl ); 110 110 void addType( NamedTypeDecl *decl ); … … 115 115 void addUnion( UnionDecl *decl ); 116 116 void addTrait( TraitDecl *decl ); 117 117 118 118 struct Impl; 119 119 Impl *tables; ///< Copy-on-write instance of table data structure -
src/SynTree/Visitor.cc
r51fcaf8d r1e1e15b 39 39 } 40 40 41 void Visitor:: visit( AggregateDecl *aggregateDecl ) {41 void Visitor::handleAggregateDecl( AggregateDecl *aggregateDecl ) { 42 42 acceptAll( aggregateDecl->get_parameters(), *this ); 43 43 acceptAll( aggregateDecl->get_members(), *this ); … … 45 45 46 46 void Visitor::visit( StructDecl *aggregateDecl ) { 47 visit( static_cast< AggregateDecl* >( aggregateDecl ) );47 handleAggregateDecl( static_cast< AggregateDecl* >( aggregateDecl ) ); 48 48 } 49 49 50 50 void Visitor::visit( UnionDecl *aggregateDecl ) { 51 visit( static_cast< AggregateDecl* >( aggregateDecl ) );51 handleAggregateDecl( static_cast< AggregateDecl* >( aggregateDecl ) ); 52 52 } 53 53 54 54 void Visitor::visit( EnumDecl *aggregateDecl ) { 55 visit( static_cast< AggregateDecl* >( aggregateDecl ) );55 handleAggregateDecl( static_cast< AggregateDecl* >( aggregateDecl ) ); 56 56 } 57 57 58 58 void Visitor::visit( TraitDecl *aggregateDecl ) { 59 visit( static_cast< AggregateDecl* >( aggregateDecl ) );60 } 61 62 void Visitor:: visit( NamedTypeDecl *typeDecl ) {59 handleAggregateDecl( static_cast< AggregateDecl* >( aggregateDecl ) ); 60 } 61 62 void Visitor::handleNamedTypeDecl( NamedTypeDecl *typeDecl ) { 63 63 acceptAll( typeDecl->get_parameters(), *this ); 64 64 acceptAll( typeDecl->get_assertions(), *this ); … … 67 67 68 68 void Visitor::visit( TypeDecl *typeDecl ) { 69 visit( static_cast< NamedTypeDecl* >( typeDecl ) );69 handleNamedTypeDecl( static_cast< NamedTypeDecl* >( typeDecl ) ); 70 70 } 71 71 72 72 void Visitor::visit( TypedefDecl *typeDecl ) { 73 visit( static_cast< NamedTypeDecl* >( typeDecl ) );73 handleNamedTypeDecl( static_cast< NamedTypeDecl* >( typeDecl ) ); 74 74 } 75 75 … … 330 330 } 331 331 332 void Visitor:: visit( ReferenceToType *aggregateUseType ) {332 void Visitor::handleReferenceToType( ReferenceToType *aggregateUseType ) { 333 333 acceptAll( aggregateUseType->get_forall(), *this ); 334 334 acceptAll( aggregateUseType->get_parameters(), *this ); … … 336 336 337 337 void Visitor::visit( StructInstType *aggregateUseType ) { 338 visit( static_cast< ReferenceToType * >( aggregateUseType ) );338 handleReferenceToType( static_cast< ReferenceToType * >( aggregateUseType ) ); 339 339 } 340 340 341 341 void Visitor::visit( UnionInstType *aggregateUseType ) { 342 visit( static_cast< ReferenceToType * >( aggregateUseType ) );342 handleReferenceToType( static_cast< ReferenceToType * >( aggregateUseType ) ); 343 343 } 344 344 345 345 void Visitor::visit( EnumInstType *aggregateUseType ) { 346 visit( static_cast< ReferenceToType * >( aggregateUseType ) );346 handleReferenceToType( static_cast< ReferenceToType * >( aggregateUseType ) ); 347 347 } 348 348 349 349 void Visitor::visit( TraitInstType *aggregateUseType ) { 350 visit( static_cast< ReferenceToType * >( aggregateUseType ) );350 handleReferenceToType( static_cast< ReferenceToType * >( aggregateUseType ) ); 351 351 acceptAll( aggregateUseType->get_members(), *this ); 352 352 } 353 353 354 354 void Visitor::visit( TypeInstType *aggregateUseType ) { 355 visit( static_cast< ReferenceToType * >( aggregateUseType ) );355 handleReferenceToType( static_cast< ReferenceToType * >( aggregateUseType ) ); 356 356 } 357 357 -
src/SynTree/Visitor.h
r51fcaf8d r1e1e15b 104 104 virtual void visit( Constant *constant ); 105 105 private: 106 virtual void visit( AggregateDecl *aggregateDecl );107 virtual void visit( NamedTypeDecl *typeDecl );108 virtual void visit( ReferenceToType *aggregateUseType );106 virtual void handleAggregateDecl( AggregateDecl *aggregateDecl ); 107 virtual void handleNamedTypeDecl( NamedTypeDecl *typeDecl ); 108 virtual void handleReferenceToType( ReferenceToType *aggregateUseType ); 109 109 }; 110 110
Note: See TracChangeset
for help on using the changeset viewer.