Changeset 51587aa for translator/ArgTweak
- 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
- Location:
- translator/ArgTweak
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
translator/ArgTweak/FunctionFixer.cc
r0dd3a2f r51587aa 10 10 // Created On : Sat May 16 08:12:38 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Sat May 16 08:17:07201513 // Update Count : 512 // Last Modified On : Mon May 18 23:30:39 2015 13 // Update Count : 6 14 14 // 15 15 -
translator/ArgTweak/FunctionFixer.h
r0dd3a2f r51587aa 1 #ifndef _DEFS_FUNCTION_FIXER_H_ 2 #define _DEFS_FUNCTION_FIXER_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 23:31:58 2015 13 // Update Count : 3 14 // 15 16 #ifndef _FUNCTION_FIXER_H_ 17 #define _FUNCTION_FIXER_H_ 3 18 4 19 #include "SynTree/Mutator.h" … … 8 23 9 24 namespace ArgTweak { 10 class FunctionFixer : public Mutator 11 { 12 typedef Mutator Parent; 25 class FunctionFixer : public Mutator { 26 typedef Mutator Parent; 27 public: 28 FunctionFixer(SymTab::Indexer *ind = 0); 29 ~FunctionFixer(); 13 30 14 public: 15 FunctionFixer(SymTab::Indexer *ind = 0); 16 ~FunctionFixer(); 31 virtual DeclarationWithType *mutate( FunctionDecl *functionDecl ); 32 virtual Expression *mutate( UntypedExpr *untypedExpr ) throw ( SemanticError ); 33 private: 34 class Matcher { 35 typedef std::string key; 36 typedef DeclarationWithType * pattern_type; 37 typedef Expression * permutation_type; 38 public: 39 static key null_key; 40 static permutation_type null_value; 17 41 18 virtual DeclarationWithType *mutate( FunctionDecl *functionDecl);19 virtual Expression *mutate( UntypedExpr *untypedExpr ) throw ( SemanticError);42 std::string extract_key( DeclarationWithType * ); 43 std::string extract_key( Expression * ); 20 44 21 private: 22 class Matcher { 23 typedef std::string key; 24 typedef DeclarationWithType * pattern_type; 25 typedef Expression * permutation_type; 26 public: 27 static key null_key; 28 static permutation_type null_value; 45 bool operator()( DeclarationWithType *, Expression * ) { return true; } 46 }; 29 47 30 std::string extract_key( DeclarationWithType * );31 std::string extract_key( Expression * );48 SymTab::Indexer *index; 49 }; 32 50 33 bool operator()( DeclarationWithType *, Expression * ) { return true; } 34 }; 35 36 SymTab::Indexer *index; 37 }; 38 39 template < class L1, class L2, class Predicate > bool align( L1 &pattern, L2 &possible_permutation, Predicate pred ); 40 51 template < class L1, class L2, class Predicate > bool align( L1 &pattern, L2 &possible_permutation, Predicate pred ); 41 52 } // namespace ArgTweak 42 53 54 #endif // _FUNCTION_FIXER_H_ 43 55 44 #endif // #ifndef _DEFS_FUNCTION_FIXER_H_ 45 46 /* 47 Local Variables: 48 mode: c++ 49 End: 50 */ 56 // Local Variables: // 57 // tab-width: 4 // 58 // mode: c++ // 59 // compile-command: "make install" // 60 // End: // -
translator/ArgTweak/Mutate.cc
r0dd3a2f r51587aa 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 // Mutate.cc -- 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 23:32:23 2015 13 // Update Count : 1 14 // 15 1 16 #include "SynTree/Mutator.h" 2 17 … … 5 20 6 21 namespace ArgTweak { 22 void mutate( std::list< Declaration * > translationUnit ) { 23 FunctionFixer ff; 7 24 8 void mutate( std::list< Declaration * > translationUnit ) 9 { 10 FunctionFixer ff; 11 12 mutateAll( translationUnit, ff ); 13 } 14 25 mutateAll( translationUnit, ff ); 26 } 15 27 } // namespace ArgTweak 16 28 17 29 // Local Variables: // 30 // tab-width: 4 // 31 // mode: c++ // 32 // compile-command: "make install" // 33 // End: // -
translator/ArgTweak/Mutate.h
r0dd3a2f r51587aa 1 #ifndef ARGTWEAK_MUTATE_H 2 #define ARGTWEAK_MUTATE_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 // Mutate.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 23:33:04 2015 13 // Update Count : 2 14 // 15 16 #ifndef _MUTATE_H 17 #define _MUTATE_H 3 18 4 19 #include <list> … … 8 23 9 24 namespace ArgTweak { 10 11 void mutate( std::list< Declaration* > translationUnit ); 12 25 void mutate( std::list< Declaration* > translationUnit ); 13 26 } // namespace ArgTweak 14 27 15 #endif // #ifndef ARGTWEAK_MUTATE_H28 #endif // _MUTATE_H 16 29 17 / *18 Local Variables: 19 mode: c++ 20 End: 21 */30 // Local Variables: // 31 // tab-width: 4 // 32 // mode: c++ // 33 // compile-command: "make install" // 34 // End: //
Note: See TracChangeset
for help on using the changeset viewer.