Changes in src/SynTree/VarExprReplacer.cc [62423350:fc638d2]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/SynTree/VarExprReplacer.cc
r62423350 rfc638d2 14 14 // 15 15 16 #include "Declaration.h"17 16 #include "Expression.h" 18 17 #include "VarExprReplacer.h" 19 18 20 VarExprReplacer::VarExprReplacer( const DeclMap & declMap , bool debug ) : declMap( declMap ), debug( debug) {}19 VarExprReplacer::VarExprReplacer( const DeclMap & declMap ) : declMap( declMap ) {} 21 20 22 21 // replace variable with new node from decl map 23 22 void VarExprReplacer::visit( VariableExpr * varExpr ) { 24 // xxx - assertions and parameters aren't accounted for in this... (i.e. they aren't inserted into the map when it's made, only DeclStmts are) 25 if ( declMap.count( varExpr->get_var() ) ) { 26 if ( debug ) { 27 std::cerr << "replacing variable reference: " << (void*)varExpr->get_var() << " " << varExpr->get_var() << " with " << (void*)declMap.at( varExpr->get_var() ) << " " << declMap.at( varExpr->get_var() ) << std::endl; 28 } 29 varExpr->set_var( declMap.at( varExpr->get_var() ) ); 30 } 23 // xxx - assertions and parameters aren't accounted for in this... (i.e. they aren't inserted into the map when it's made, only DeclStmts are) 24 if ( declMap.count( varExpr->get_var() ) ) { 25 varExpr->set_var( declMap.at( varExpr->get_var() ) ); 26 } 31 27 }
Note:
See TracChangeset
for help on using the changeset viewer.