Changeset 90152a4 for src/Common/PassVisitor.h
- Timestamp:
- Aug 27, 2018, 4:40:34 PM (7 years ago)
- Branches:
- ADT, arm-eh, ast-experimental, cleanup-dtors, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- b7c89aa
- Parents:
- f9feab8 (diff), 305581d (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/Common/PassVisitor.h
rf9feab8 r90152a4 19 19 #include "SynTree/Expression.h" 20 20 #include "SynTree/Constant.h" 21 #include "SynTree/TypeSubstitution.h" 21 22 class TypeSubstitution; 22 23 23 24 #include "PassVisitor.proto.h" … … 65 66 virtual void visit( TypedefDecl * typeDecl ) override final; 66 67 virtual void visit( AsmDecl * asmDecl ) override final; 68 virtual void visit( StaticAssertDecl * assertDecl ) override final; 67 69 68 70 virtual void visit( CompoundStmt * compoundStmt ) override final; 69 71 virtual void visit( ExprStmt * exprStmt ) override final; 70 72 virtual void visit( AsmStmt * asmStmt ) override final; 73 virtual void visit( DirectiveStmt * dirStmt ) override final; 71 74 virtual void visit( IfStmt * ifStmt ) override final; 72 75 virtual void visit( WhileStmt * whileStmt ) override final; … … 90 93 virtual void visit( NameExpr * nameExpr ) override final; 91 94 virtual void visit( CastExpr * castExpr ) override final; 95 virtual void visit( KeywordCastExpr * castExpr ) override final; 92 96 virtual void visit( VirtualCastExpr * castExpr ) override final; 93 97 virtual void visit( AddressExpr * addressExpr ) override final; … … 118 122 virtual void visit( StmtExpr * stmtExpr ) override final; 119 123 virtual void visit( UniqueExpr * uniqueExpr ) override final; 124 virtual void visit( UntypedInitExpr * initExpr ) override final; 125 virtual void visit( InitExpr * initExpr ) override final; 126 virtual void visit( DeletedExpr * delExpr ) override final; 127 virtual void visit( DefaultArgExpr * argExpr ) override final; 128 virtual void visit( GenericExpr * genExpr ) override final; 120 129 121 130 virtual void visit( VoidType * basicType ) override final; … … 124 133 virtual void visit( ArrayType * arrayType ) override final; 125 134 virtual void visit( ReferenceType * referenceType ) override final; 135 virtual void visit( QualifiedType * qualType ) override final; 126 136 virtual void visit( FunctionType * functionType ) override final; 127 137 virtual void visit( StructInstType * aggregateUseType ) override final; … … 136 146 virtual void visit( ZeroType * zeroType ) override final; 137 147 virtual void visit( OneType * oneType ) override final; 148 virtual void visit( GlobalScopeType * globalType ) override final; 138 149 139 150 virtual void visit( Designation * designation ) override final; … … 157 168 virtual Declaration * mutate( TypedefDecl * typeDecl ) override final; 158 169 virtual AsmDecl * mutate( AsmDecl * asmDecl ) override final; 170 virtual StaticAssertDecl * mutate( StaticAssertDecl * assertDecl ) override final; 159 171 160 172 virtual CompoundStmt * mutate( CompoundStmt * compoundStmt ) override final; 161 173 virtual Statement * mutate( ExprStmt * exprStmt ) override final; 162 174 virtual Statement * mutate( AsmStmt * asmStmt ) override final; 175 virtual Statement * mutate( DirectiveStmt * dirStmt ) override final; 163 176 virtual Statement * mutate( IfStmt * ifStmt ) override final; 164 177 virtual Statement * mutate( WhileStmt * whileStmt ) override final; … … 181 194 virtual Expression * mutate( UntypedExpr * untypedExpr ) override final; 182 195 virtual Expression * mutate( NameExpr * nameExpr ) override final; 183 virtual Expression * mutate( AddressExpr * castExpr ) override final;196 virtual Expression * mutate( AddressExpr * addrExpr ) override final; 184 197 virtual Expression * mutate( LabelAddressExpr * labAddressExpr ) override final; 185 198 virtual Expression * mutate( CastExpr * castExpr ) override final; 199 virtual Expression * mutate( KeywordCastExpr * castExpr ) override final; 186 200 virtual Expression * mutate( VirtualCastExpr * castExpr ) override final; 187 201 virtual Expression * mutate( UntypedMemberExpr * memberExpr ) override final; … … 210 224 virtual Expression * mutate( StmtExpr * stmtExpr ) override final; 211 225 virtual Expression * mutate( UniqueExpr * uniqueExpr ) override final; 226 virtual Expression * mutate( UntypedInitExpr * initExpr ) override final; 227 virtual Expression * mutate( InitExpr * initExpr ) override final; 228 virtual Expression * mutate( DeletedExpr * delExpr ) override final; 229 virtual Expression * mutate( DefaultArgExpr * argExpr ) override final; 230 virtual Expression * mutate( GenericExpr * genExpr ) override final; 212 231 213 232 virtual Type * mutate( VoidType * basicType ) override final; … … 216 235 virtual Type * mutate( ArrayType * arrayType ) override final; 217 236 virtual Type * mutate( ReferenceType * referenceType ) override final; 237 virtual Type * mutate( QualifiedType * qualType ) override final; 218 238 virtual Type * mutate( FunctionType * functionType ) override final; 219 239 virtual Type * mutate( StructInstType * aggregateUseType ) override final; … … 228 248 virtual Type * mutate( ZeroType * zeroType ) override final; 229 249 virtual Type * mutate( OneType * oneType ) override final; 250 virtual Type * mutate( GlobalScopeType * globalType ) override final; 230 251 231 252 virtual Designation * mutate( Designation * designation ) override final; … … 243 264 244 265 private: 266 bool inFunction = false; 267 245 268 template<typename pass_t> friend void acceptAll( std::list< Declaration* > &decls, PassVisitor< pass_t >& visitor ); 246 269 template<typename pass_t> friend void mutateAll( std::list< Declaration* > &decls, PassVisitor< pass_t >& visitor ); … … 286 309 bool_ref * get_visit_children_ptr() { return visit_children_impl(pass, 0); } 287 310 288 void indexerScopeEnter () { indexer_impl_enterScope ( pass, 0 ); }289 void indexerScopeLeave () { indexer_impl_leaveScope ( pass, 0 ); }290 void indexerAddId ( DeclarationWithType * node) { indexer_impl_addId ( pass, 0, node ); }291 void indexerAddType ( NamedTypeDecl * node) { indexer_impl_addType ( pass, 0, node ); }292 void indexerAddStruct ( const std::string & id) { indexer_impl_addStruct ( pass, 0, id ); }293 void indexerAddStruct ( StructDecl * node) { indexer_impl_addStruct ( pass, 0, node ); }294 void indexerAddStructFwd( StructDecl * node) { indexer_impl_addStructFwd( pass, 0, node ); }295 void indexerAddEnum ( EnumDecl * node) { indexer_impl_addEnum ( pass, 0, node ); }296 void indexerAddUnion ( const std::string & id) { indexer_impl_addUnion ( pass, 0, id ); }297 void indexerAddUnion ( UnionDecl * node) { indexer_impl_addUnion ( pass, 0, node ); }298 void indexerAddUnionFwd ( UnionDecl * node) { indexer_impl_addUnionFwd ( pass, 0, node ); }299 void indexerAddTrait ( TraitDecl * node) { indexer_impl_addTrait ( pass, 0, node ); }300 void indexerAddWith ( WithStmt * node ) { indexer_impl_addWith ( pass, 0, node); }311 void indexerScopeEnter () { indexer_impl_enterScope ( pass, 0 ); } 312 void indexerScopeLeave () { indexer_impl_leaveScope ( pass, 0 ); } 313 void indexerAddId ( DeclarationWithType * node ) { indexer_impl_addId ( pass, 0, node ); } 314 void indexerAddType ( NamedTypeDecl * node ) { indexer_impl_addType ( pass, 0, node ); } 315 void indexerAddStruct ( const std::string & id ) { indexer_impl_addStruct ( pass, 0, id ); } 316 void indexerAddStruct ( StructDecl * node ) { indexer_impl_addStruct ( pass, 0, node ); } 317 void indexerAddStructFwd( StructDecl * node ) { indexer_impl_addStructFwd( pass, 0, node ); } 318 void indexerAddEnum ( EnumDecl * node ) { indexer_impl_addEnum ( pass, 0, node ); } 319 void indexerAddUnion ( const std::string & id ) { indexer_impl_addUnion ( pass, 0, id ); } 320 void indexerAddUnion ( UnionDecl * node ) { indexer_impl_addUnion ( pass, 0, node ); } 321 void indexerAddUnionFwd ( UnionDecl * node ) { indexer_impl_addUnionFwd ( pass, 0, node ); } 322 void indexerAddTrait ( TraitDecl * node ) { indexer_impl_addTrait ( pass, 0, node ); } 323 void indexerAddWith ( std::list< Expression * > & exprs, BaseSyntaxNode * withStmt ) { indexer_impl_addWith( pass, 0, exprs, withStmt ); } 301 324 302 325 … … 403 426 }; 404 427 428 #include "SynTree/TypeSubstitution.h" 405 429 #include "PassVisitor.impl.h"
Note:
See TracChangeset
for help on using the changeset viewer.