Changeset 7862059
- Timestamp:
- Apr 12, 2018, 2:46:15 PM (7 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, with_gc
- Children:
- 8711c6c
- Parents:
- 98278b3a
- Location:
- src
- Files:
-
- 1 added
- 1 deleted
- 5 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
src/ControlStruct/ExceptTranslate.cc
r98278b3a r7862059 34 34 #include "SynTree/Statement.h" // for CompoundStmt, CatchStmt, ThrowStmt 35 35 #include "SynTree/Type.h" // for FunctionType, Type, noQualifiers 36 #include "SynTree/ VarExprReplacer.h" // for VarExprReplacer, VarExprReplace...36 #include "SynTree/DeclReplacer.h" // for DeclReplacer 37 37 #include "SynTree/Visitor.h" // for acceptAll 38 38 … … 314 314 // Update variables in the body to point to this local copy. 315 315 { 316 VarExprReplacer::DeclMap mapping;316 DeclReplacer::DeclMap mapping; 317 317 mapping[ handler_decl ] = local_except; 318 VarExprReplacer::replace( handler->body, mapping );318 DeclReplacer::replace( handler->body, mapping ); 319 319 } 320 320 -
src/Makefile.in
r98278b3a r7862059 249 249 SynTree/driver_cfa_cpp-TypeSubstitution.$(OBJEXT) \ 250 250 SynTree/driver_cfa_cpp-Attribute.$(OBJEXT) \ 251 SynTree/driver_cfa_cpp- VarExprReplacer.$(OBJEXT) \251 SynTree/driver_cfa_cpp-DeclReplacer.$(OBJEXT) \ 252 252 Tuples/driver_cfa_cpp-TupleAssignment.$(OBJEXT) \ 253 253 Tuples/driver_cfa_cpp-TupleExpansion.$(OBJEXT) \ … … 526 526 SynTree/NamedTypeDecl.cc SynTree/TypeDecl.cc \ 527 527 SynTree/Initializer.cc SynTree/TypeSubstitution.cc \ 528 SynTree/Attribute.cc SynTree/ VarExprReplacer.cc \528 SynTree/Attribute.cc SynTree/DeclReplacer.cc \ 529 529 Tuples/TupleAssignment.cc Tuples/TupleExpansion.cc \ 530 530 Tuples/Explode.cc Virtual/ExpandCasts.cc … … 912 912 SynTree/driver_cfa_cpp-Attribute.$(OBJEXT): SynTree/$(am__dirstamp) \ 913 913 SynTree/$(DEPDIR)/$(am__dirstamp) 914 SynTree/driver_cfa_cpp- VarExprReplacer.$(OBJEXT): \914 SynTree/driver_cfa_cpp-DeclReplacer.$(OBJEXT): \ 915 915 SynTree/$(am__dirstamp) SynTree/$(DEPDIR)/$(am__dirstamp) 916 916 Tuples/$(am__dirstamp): … … 1039 1039 @AMDEP_TRUE@@am__include@ @am__quote@SynTree/$(DEPDIR)/driver_cfa_cpp-CompoundStmt.Po@am__quote@ 1040 1040 @AMDEP_TRUE@@am__include@ @am__quote@SynTree/$(DEPDIR)/driver_cfa_cpp-Constant.Po@am__quote@ 1041 @AMDEP_TRUE@@am__include@ @am__quote@SynTree/$(DEPDIR)/driver_cfa_cpp-DeclReplacer.Po@am__quote@ 1041 1042 @AMDEP_TRUE@@am__include@ @am__quote@SynTree/$(DEPDIR)/driver_cfa_cpp-DeclStmt.Po@am__quote@ 1042 1043 @AMDEP_TRUE@@am__include@ @am__quote@SynTree/$(DEPDIR)/driver_cfa_cpp-Declaration.Po@am__quote@ … … 1060 1061 @AMDEP_TRUE@@am__include@ @am__quote@SynTree/$(DEPDIR)/driver_cfa_cpp-TypeofType.Po@am__quote@ 1061 1062 @AMDEP_TRUE@@am__include@ @am__quote@SynTree/$(DEPDIR)/driver_cfa_cpp-VarArgsType.Po@am__quote@ 1062 @AMDEP_TRUE@@am__include@ @am__quote@SynTree/$(DEPDIR)/driver_cfa_cpp-VarExprReplacer.Po@am__quote@1063 1063 @AMDEP_TRUE@@am__include@ @am__quote@SynTree/$(DEPDIR)/driver_cfa_cpp-VoidType.Po@am__quote@ 1064 1064 @AMDEP_TRUE@@am__include@ @am__quote@SynTree/$(DEPDIR)/driver_cfa_cpp-ZeroOneType.Po@am__quote@ … … 2498 2498 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o SynTree/driver_cfa_cpp-Attribute.obj `if test -f 'SynTree/Attribute.cc'; then $(CYGPATH_W) 'SynTree/Attribute.cc'; else $(CYGPATH_W) '$(srcdir)/SynTree/Attribute.cc'; fi` 2499 2499 2500 SynTree/driver_cfa_cpp- VarExprReplacer.o: SynTree/VarExprReplacer.cc2501 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT SynTree/driver_cfa_cpp- VarExprReplacer.o -MD -MP -MF SynTree/$(DEPDIR)/driver_cfa_cpp-VarExprReplacer.Tpo -c -o SynTree/driver_cfa_cpp-VarExprReplacer.o `test -f 'SynTree/VarExprReplacer.cc' || echo '$(srcdir)/'`SynTree/VarExprReplacer.cc2502 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) SynTree/$(DEPDIR)/driver_cfa_cpp- VarExprReplacer.Tpo SynTree/$(DEPDIR)/driver_cfa_cpp-VarExprReplacer.Po2503 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='SynTree/ VarExprReplacer.cc' object='SynTree/driver_cfa_cpp-VarExprReplacer.o' libtool=no @AMDEPBACKSLASH@2504 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 2505 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o SynTree/driver_cfa_cpp- VarExprReplacer.o `test -f 'SynTree/VarExprReplacer.cc' || echo '$(srcdir)/'`SynTree/VarExprReplacer.cc2506 2507 SynTree/driver_cfa_cpp- VarExprReplacer.obj: SynTree/VarExprReplacer.cc2508 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT SynTree/driver_cfa_cpp- VarExprReplacer.obj -MD -MP -MF SynTree/$(DEPDIR)/driver_cfa_cpp-VarExprReplacer.Tpo -c -o SynTree/driver_cfa_cpp-VarExprReplacer.obj `if test -f 'SynTree/VarExprReplacer.cc'; then $(CYGPATH_W) 'SynTree/VarExprReplacer.cc'; else $(CYGPATH_W) '$(srcdir)/SynTree/VarExprReplacer.cc'; fi`2509 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) SynTree/$(DEPDIR)/driver_cfa_cpp- VarExprReplacer.Tpo SynTree/$(DEPDIR)/driver_cfa_cpp-VarExprReplacer.Po2510 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='SynTree/ VarExprReplacer.cc' object='SynTree/driver_cfa_cpp-VarExprReplacer.obj' libtool=no @AMDEPBACKSLASH@2511 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 2512 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o SynTree/driver_cfa_cpp- VarExprReplacer.obj `if test -f 'SynTree/VarExprReplacer.cc'; then $(CYGPATH_W) 'SynTree/VarExprReplacer.cc'; else $(CYGPATH_W) '$(srcdir)/SynTree/VarExprReplacer.cc'; fi`2500 SynTree/driver_cfa_cpp-DeclReplacer.o: SynTree/DeclReplacer.cc 2501 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT SynTree/driver_cfa_cpp-DeclReplacer.o -MD -MP -MF SynTree/$(DEPDIR)/driver_cfa_cpp-DeclReplacer.Tpo -c -o SynTree/driver_cfa_cpp-DeclReplacer.o `test -f 'SynTree/DeclReplacer.cc' || echo '$(srcdir)/'`SynTree/DeclReplacer.cc 2502 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) SynTree/$(DEPDIR)/driver_cfa_cpp-DeclReplacer.Tpo SynTree/$(DEPDIR)/driver_cfa_cpp-DeclReplacer.Po 2503 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='SynTree/DeclReplacer.cc' object='SynTree/driver_cfa_cpp-DeclReplacer.o' libtool=no @AMDEPBACKSLASH@ 2504 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 2505 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o SynTree/driver_cfa_cpp-DeclReplacer.o `test -f 'SynTree/DeclReplacer.cc' || echo '$(srcdir)/'`SynTree/DeclReplacer.cc 2506 2507 SynTree/driver_cfa_cpp-DeclReplacer.obj: SynTree/DeclReplacer.cc 2508 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT SynTree/driver_cfa_cpp-DeclReplacer.obj -MD -MP -MF SynTree/$(DEPDIR)/driver_cfa_cpp-DeclReplacer.Tpo -c -o SynTree/driver_cfa_cpp-DeclReplacer.obj `if test -f 'SynTree/DeclReplacer.cc'; then $(CYGPATH_W) 'SynTree/DeclReplacer.cc'; else $(CYGPATH_W) '$(srcdir)/SynTree/DeclReplacer.cc'; fi` 2509 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) SynTree/$(DEPDIR)/driver_cfa_cpp-DeclReplacer.Tpo SynTree/$(DEPDIR)/driver_cfa_cpp-DeclReplacer.Po 2510 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='SynTree/DeclReplacer.cc' object='SynTree/driver_cfa_cpp-DeclReplacer.obj' libtool=no @AMDEPBACKSLASH@ 2511 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 2512 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o SynTree/driver_cfa_cpp-DeclReplacer.obj `if test -f 'SynTree/DeclReplacer.cc'; then $(CYGPATH_W) 'SynTree/DeclReplacer.cc'; else $(CYGPATH_W) '$(srcdir)/SynTree/DeclReplacer.cc'; fi` 2513 2513 2514 2514 Tuples/driver_cfa_cpp-TupleAssignment.o: Tuples/TupleAssignment.cc -
src/SynTree/CompoundStmt.cc
r98278b3a r7862059 23 23 #include "Statement.h" // for CompoundStmt, Statement, DeclStmt 24 24 #include "SynTree/Label.h" // for Label 25 #include "SynTree/ VarExprReplacer.h" // for VarExprReplacer, VarExprReplace...25 #include "SynTree/DeclReplacer.h" // for DeclReplacer 26 26 27 27 using std::string; … … 49 49 // recursively execute this routine. There may be more efficient ways of doing 50 50 // this. 51 VarExprReplacer::DeclMap declMap;51 DeclReplacer::DeclMap declMap; 52 52 std::list< Statement * >::const_iterator origit = other.kids.begin(); 53 53 for ( Statement * s : kids ) { … … 64 64 } 65 65 if ( ! declMap.empty() ) { 66 VarExprReplacer::replace( this, declMap );66 DeclReplacer::replace( this, declMap ); 67 67 } 68 68 } -
src/SynTree/DeclReplacer.h
r98278b3a r7862059 23 23 class VariableExpr; 24 24 25 namespace VarExprReplacer {25 namespace DeclReplacer { 26 26 typedef std::map< DeclarationWithType *, DeclarationWithType * > DeclMap; 27 typedef std::map< TypeDecl *, TypeDecl * > TypeMap; 27 28 28 29 void replace( BaseSyntaxNode * node, const DeclMap & declMap, bool debug = false ); 30 void replace( BaseSyntaxNode * node, const TypeMap & typeMap, bool debug = false ); 31 void replace( BaseSyntaxNode * node, const DeclMap & declMap, const TypeMap & typeMap, bool debug = false ); 29 32 } 30 33 -
src/SynTree/FunctionDecl.cc
r98278b3a r7862059 26 26 #include "Statement.h" // for CompoundStmt 27 27 #include "Type.h" // for Type, FunctionType, Type::FuncSpecif... 28 #include " VarExprReplacer.h"28 #include "DeclReplacer.h" 29 29 30 30 extern bool translation_unit_nomain; … … 41 41 : Parent( other ), type( maybeClone( other.type ) ), statements( maybeClone( other.statements ) ) { 42 42 43 VarExprReplacer::DeclMap declMap;43 DeclReplacer::DeclMap declMap; 44 44 for ( auto p : group_iterate( other.type->parameters, type->parameters ) ) { 45 45 declMap[ std::get<0>(p) ] = std::get<1>(p); … … 49 49 } 50 50 if ( ! declMap.empty() ) { 51 VarExprReplacer::replace( this, declMap );51 DeclReplacer::replace( this, declMap ); 52 52 } 53 53 cloneAll( other.withExprs, withExprs ); -
src/SynTree/module.mk
r98278b3a r7862059 48 48 SynTree/TypeSubstitution.cc \ 49 49 SynTree/Attribute.cc \ 50 SynTree/ VarExprReplacer.cc50 SynTree/DeclReplacer.cc 51 51
Note: See TracChangeset
for help on using the changeset viewer.