Changeset a08ba92 for translator/InitTweak/InitExpander.h
- Timestamp:
- May 19, 2015, 4:58:14 PM (9 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, string, with_gc
- Children:
- 843054c2
- Parents:
- 01aeade
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
translator/InitTweak/InitExpander.h
r01aeade ra08ba92 5 5 // file "LICENCE" distributed with Cforall. 6 6 // 7 // XXX.cc--7 // InitExpander.h -- 8 8 // 9 9 // Author : Richard C. Bilson 10 10 // Created On : Mon May 18 07:44:20 2015 11 // Last Modified By : 12 // Last Modified On : 13 // Update Count : 011 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Tue May 19 16:35:33 2015 13 // Update Count : 2 14 14 // 15 15 16 #ifndef _INIT_EXPANDER_H_ 16 17 #define _INIT_EXPANDER_H_ … … 27 28 28 29 namespace InitTweak { 30 class InitExpander : public Mutator { 31 typedef Mutator Parent; 32 public: 33 InitExpander(); 34 ~InitExpander(); 29 35 30 class InitExpander : public Mutator 31 { 32 typedef Mutator Parent; 36 virtual ObjectDecl *mutate( ObjectDecl * ); 33 37 34 public: 35 InitExpander(); 36 ~InitExpander(); 38 // indexer runs 39 virtual FunctionDecl *mutate( FunctionDecl *functionDecl ) { 40 functionDecl->set_functionType( maybeMutate( functionDecl->get_functionType(), *this ) ); 41 mutateAll( functionDecl->get_oldDecls(), *this ); 42 functionDecl->set_statements( maybeMutate( functionDecl->get_statements(), *this ) ); 37 43 38 virtual ObjectDecl *mutate( ObjectDecl * ); 44 index.visit( functionDecl ); 45 return functionDecl; 46 } 39 47 40 // indexer runs 41 virtual FunctionDecl *mutate( FunctionDecl *functionDecl ) 42 { 43 functionDecl->set_functionType( maybeMutate( functionDecl->get_functionType(), *this ) ); 44 mutateAll( functionDecl->get_oldDecls(), *this ); 45 functionDecl->set_statements( maybeMutate( functionDecl->get_statements(), *this ) ); 48 virtual TypeDecl *mutate( TypeDecl *typeDecl ) 49 { index.visit( typeDecl ); return typeDecl; } 50 virtual TypedefDecl *mutate( TypedefDecl *typeDecl ) 51 { index.visit( typeDecl ); return typeDecl; } 52 virtual StructDecl *mutate( StructDecl *aggregateDecl ) 53 { index.visit( aggregateDecl ); return aggregateDecl; } 54 virtual UnionDecl *mutate( UnionDecl *aggregateDecl ) 55 { index.visit( aggregateDecl ); return aggregateDecl; } 56 virtual EnumDecl *mutate( EnumDecl *aggregateDecl ) 57 { index.visit( aggregateDecl ); return aggregateDecl; } 46 58 47 index.visit( functionDecl ); 48 return functionDecl; 49 } 50 51 virtual TypeDecl *mutate( TypeDecl *typeDecl ) 52 { index.visit( typeDecl ); return typeDecl; } 53 virtual TypedefDecl *mutate( TypedefDecl *typeDecl ) 54 { index.visit( typeDecl ); return typeDecl; } 55 virtual StructDecl *mutate( StructDecl *aggregateDecl ) 56 { index.visit( aggregateDecl ); return aggregateDecl; } 57 virtual UnionDecl *mutate( UnionDecl *aggregateDecl ) 58 { index.visit( aggregateDecl ); return aggregateDecl; } 59 virtual EnumDecl *mutate( EnumDecl *aggregateDecl ) 60 { index.visit( aggregateDecl ); return aggregateDecl; } 61 62 virtual Type *mutate( StructInstType *aggrInst ) 63 { index.visit( aggrInst ); return aggrInst; } 64 virtual Type *mutate( UnionInstType *aggrInst ) 65 { index.visit( aggrInst ); return aggrInst; } 66 67 private: 68 SymTab::Indexer index; 69 }; // class InitExpander 70 59 virtual Type *mutate( StructInstType *aggrInst ) 60 { index.visit( aggrInst ); return aggrInst; } 61 virtual Type *mutate( UnionInstType *aggrInst ) 62 { index.visit( aggrInst ); return aggrInst; } 63 private: 64 SymTab::Indexer index; 65 }; // class InitExpander 71 66 } // namespace InitTweak 72 67 68 #endif // _INIT_EXPANDER_H_ 73 69 74 #endif // #ifndef _INIT_EXPANDER_H_75 76 /*77 Local Variables:78 mode: c++79 End:80 */81 70 // Local Variables: // 82 71 // tab-width: 4 //
Note: See TracChangeset
for help on using the changeset viewer.