Changeset 7862059 for src/SynTree
- 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/SynTree
- Files:
-
- 1 added
- 1 deleted
- 3 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
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.