Changeset 51587aa for translator/Tuples/FunctionFixer.h
- Timestamp:
- May 18, 2015, 11:45:33 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:
- 01aeade
- Parents:
- 0dd3a2f
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
translator/Tuples/FunctionFixer.h
r0dd3a2f r51587aa 1 #ifndef _FUNFIX_H_ 2 #define _FUNFIX_H_ 1 // 2 // Cforall Version 1.0.0 Copyright (C) 2015 University of Waterloo 3 // 4 // The contents of this file are covered under the licence agreement in the 5 // file "LICENCE" distributed with Cforall. 6 // 7 // FunctionFixer.h -- 8 // 9 // Author : Richard C. Bilson 10 // Created On : Mon May 18 07:44:20 2015 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Mon May 18 14:58:45 2015 13 // Update Count : 3 14 // 15 16 #ifndef _FUNCTIONFIXER_H_ 17 #define _FUNCTIONFIXER_H_ 3 18 4 19 #include "SynTree/Mutator.h" … … 14 29 15 30 namespace Tuples { 16 class FunctionFixer : public Mutator 17 { 18 typedef Mutator Parent; 31 class FunctionFixer : public Mutator { 32 typedef Mutator Parent; 33 public: 34 FunctionFixer() {} 35 virtual ~FunctionFixer() {} 36 virtual Type *mutate( FunctionType *functionType ); 37 virtual Statement *mutate( ReturnStmt *retStmt ); 38 virtual DeclarationWithType *mutate( FunctionDecl *functionDecl ); 39 virtual Expression *mutate( VariableExpr *variableExpr); 19 40 20 public: 21 FunctionFixer() {} 22 virtual ~FunctionFixer() {} 23 virtual Type *mutate( FunctionType *functionType ); 24 virtual Statement *mutate( ReturnStmt *retStmt ); 25 virtual DeclarationWithType *mutate( FunctionDecl *functionDecl ); 26 virtual Expression *mutate( VariableExpr *variableExpr); 41 // indexer runs 42 virtual ObjectDecl *mutate( ObjectDecl *objectDecl ) 43 { index.visit( objectDecl ); return objectDecl; } 44 virtual TypeDecl *mutate( TypeDecl *typeDecl ) 45 { index.visit( typeDecl ); return typeDecl; } 46 virtual TypedefDecl *mutate( TypedefDecl *typeDecl ) 47 { index.visit( typeDecl ); return typeDecl; } 48 virtual StructDecl *mutate( StructDecl *aggregateDecl ) 49 { index.visit( aggregateDecl ); return aggregateDecl; } 50 virtual UnionDecl *mutate( UnionDecl *aggregateDecl ) 51 { index.visit( aggregateDecl ); return aggregateDecl; } 52 virtual EnumDecl *mutate( EnumDecl *aggregateDecl ) 53 { index.visit( aggregateDecl ); return aggregateDecl; } 27 54 28 // indexer runs 29 virtual ObjectDecl *mutate( ObjectDecl *objectDecl ) 30 { index.visit( objectDecl ); return objectDecl; } 31 virtual TypeDecl *mutate( TypeDecl *typeDecl ) 32 { index.visit( typeDecl ); return typeDecl; } 33 virtual TypedefDecl *mutate( TypedefDecl *typeDecl ) 34 { index.visit( typeDecl ); return typeDecl; } 35 virtual StructDecl *mutate( StructDecl *aggregateDecl ) 36 { index.visit( aggregateDecl ); return aggregateDecl; } 37 virtual UnionDecl *mutate( UnionDecl *aggregateDecl ) 38 { index.visit( aggregateDecl ); return aggregateDecl; } 39 virtual EnumDecl *mutate( EnumDecl *aggregateDecl ) 40 { index.visit( aggregateDecl ); return aggregateDecl; } 41 42 virtual Type *mutate( StructInstType *aggrInst ) 43 { index.visit( aggrInst ); return aggrInst; } 44 virtual Type *mutate( UnionInstType *aggrInst ) 45 { index.visit( aggrInst ); return aggrInst; } 46 47 48 49 private: 50 std::list< DeclarationWithType * > rets; 51 SymTab::Indexer index; 52 }; 53 55 virtual Type *mutate( StructInstType *aggrInst ) 56 { index.visit( aggrInst ); return aggrInst; } 57 virtual Type *mutate( UnionInstType *aggrInst ) 58 { index.visit( aggrInst ); return aggrInst; } 59 private: 60 std::list< DeclarationWithType * > rets; 61 SymTab::Indexer index; 62 }; 54 63 } // namespace Tuples 55 64 65 #endif // _FUNCTIONFIXER_H_ 56 66 57 #endif // #ifndef _FUNFIX_H_ 58 59 /* 60 Local Variables: 61 mode: c++ 62 End: 63 */ 67 // Local Variables: // 68 // tab-width: 4 // 69 // mode: c++ // 70 // compile-command: "make install" // 71 // End: //
Note: See TracChangeset
for help on using the changeset viewer.