Changeset 8ca3a72
- Timestamp:
- Jun 5, 2017, 5:49:43 PM (8 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
- Children:
- 10e90cb
- Parents:
- 7985fa5
- git-author:
- Rob Schluntz <rschlunt@…> (06/05/17 17:47:19)
- git-committer:
- Rob Schluntz <rschlunt@…> (06/05/17 17:49:43)
- Location:
- src
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
src/GenPoly/Box.cc
r7985fa5 r8ca3a72 62 62 namespace GenPoly { 63 63 namespace { 64 const std::list<Label> noLabels;65 66 64 FunctionType *makeAdapterType( FunctionType *adaptee, const TyVarMap &tyVars ); 67 65 -
src/GenPoly/CopyParams.cc
r7985fa5 r8ca3a72 45 45 46 46 CopyParams::CopyParams() : namer( "_cp" ) {} 47 48 static const std::list< Label > noLabels;49 47 50 48 void CopyParams::visit( FunctionDecl *funcDecl ) { -
src/GenPoly/DeclMutator.cc
r7985fa5 r8ca3a72 20 20 21 21 namespace GenPoly { 22 namespace {23 const std::list<Label> noLabels;24 }25 26 22 DeclMutator::DeclMutator() : Mutator(), declsToAdd(1), declsToAddAfter(1) {} 27 23 28 24 DeclMutator::~DeclMutator() {} 29 25 30 26 void DeclMutator::mutateDeclarationList( std::list< Declaration* > &decls ) { 31 27 for ( std::list< Declaration* >::iterator decl = decls.begin(); ; ++decl ) { … … 34 30 35 31 if ( decl == decls.end() ) break; 36 32 37 33 // run mutator on declaration 38 34 *decl = maybeMutate( *decl, *this ); … … 55 51 newBack->splice( newBack->end(), *back ); 56 52 declsToAdd.pop_back(); 57 53 58 54 back = declsToAddAfter.rbegin(); 59 55 newBack = back + 1; … … 66 62 CompoundStmt *compoundStmt = dynamic_cast< CompoundStmt* >(stmt); 67 63 if ( compoundStmt ) return mutate( compoundStmt ); 68 64 69 65 doBeginScope(); 70 66 71 67 // run mutator on statement 72 68 stmt = maybeMutate( stmt, *this ); … … 102 98 doBeginScope(); 103 99 104 100 105 101 for ( std::list< Statement* >::iterator stmt = stmts.begin(); ; ++stmt ) { 106 102 // add any new declarations after the previous statement … … 112 108 113 109 if ( stmt == stmts.end() ) break; 114 110 115 111 // run mutator on statement 116 112 *stmt = maybeMutate( *stmt, *this ); … … 123 119 declsToAdd.back().clear(); 124 120 } 125 121 126 122 doEndScope(); 127 123 } … … 139 135 return compoundStmt; 140 136 } 141 137 142 138 Statement* DeclMutator::mutate(IfStmt *ifStmt) { 143 139 ifStmt->set_condition( maybeMutate( ifStmt->get_condition(), *this ) ); … … 146 142 return ifStmt; 147 143 } 148 144 149 145 Statement* DeclMutator::mutate(WhileStmt *whileStmt) { 150 146 whileStmt->set_condition( maybeMutate( whileStmt->get_condition(), *this ) ); … … 152 148 return whileStmt; 153 149 } 154 150 155 151 Statement* DeclMutator::mutate(ForStmt *forStmt) { 156 152 mutateAll( forStmt->get_initialization(), *this ); … … 160 156 return forStmt; 161 157 } 162 158 163 159 Statement* DeclMutator::mutate(SwitchStmt *switchStmt) { 164 160 switchStmt->set_condition( maybeMutate( switchStmt->get_condition(), *this ) ); … … 166 162 return switchStmt; 167 163 } 168 164 169 165 Statement* DeclMutator::mutate(CaseStmt *caseStmt) { 170 166 caseStmt->set_condition( maybeMutate( caseStmt->get_condition(), *this ) ); … … 172 168 return caseStmt; 173 169 } 174 170 175 171 Statement* DeclMutator::mutate(TryStmt *tryStmt) { 176 172 tryStmt->set_block( maybeMutate( tryStmt->get_block(), *this ) ); … … 179 175 return tryStmt; 180 176 } 181 177 182 178 Statement* DeclMutator::mutate(CatchStmt *catchStmt) { 183 179 catchStmt->set_decl( maybeMutate( catchStmt->get_decl(), *this ) ); -
src/GenPoly/Lvalue.cc
r7985fa5 r8ca3a72 35 35 namespace GenPoly { 36 36 namespace { 37 const std::list<Label> noLabels;38 39 37 /// Replace uses of lvalue returns with appropriate pointers 40 38 class Pass1 : public Mutator { -
src/InitTweak/FixGlobalInit.cc
r7985fa5 r8ca3a72 26 26 27 27 namespace InitTweak { 28 namespace {29 const std::list<Label> noLabels;30 }31 32 28 class GlobalFixer : public Visitor { 33 29 public: -
src/InitTweak/GenInit.cc
r7985fa5 r8ca3a72 16 16 #include <stack> 17 17 #include <list> 18 19 #include "InitTweak.h" 18 20 #include "GenInit.h" 19 #include "InitTweak.h" 21 22 #include "Common/PassVisitor.h" 23 24 #include "GenPoly/DeclMutator.h" 25 #include "GenPoly/PolyMutator.h" 26 #include "GenPoly/ScopedSet.h" 27 28 #include "ResolvExpr/typeops.h" 29 20 30 #include "SynTree/Declaration.h" 21 #include "SynTree/Type.h"22 31 #include "SynTree/Expression.h" 23 #include "SynTree/Statement.h"24 32 #include "SynTree/Initializer.h" 25 33 #include "SynTree/Mutator.h" 34 #include "SynTree/Statement.h" 35 #include "SynTree/Type.h" 36 26 37 #include "SymTab/Autogen.h" 27 38 #include "SymTab/Mangler.h" 28 #include "GenPoly/PolyMutator.h"29 #include "GenPoly/DeclMutator.h"30 #include "GenPoly/ScopedSet.h"31 #include "ResolvExpr/typeops.h"32 39 33 40 namespace InitTweak { 34 namespace {35 const std::list<Label> noLabels;36 const std::list<Expression *> noDesignators;37 }38 39 41 class ReturnFixer final : public GenPoly::PolyMutator { 40 42 public: -
src/SynTree/Attribute.h
r7985fa5 r8ca3a72 40 40 }; 41 41 42 const std::list< Attribute * > noAttributes; 43 42 44 #endif 43 45
Note: See TracChangeset
for help on using the changeset viewer.