Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/SynTree/VarExprReplacer.cc

    r62423350 rfc638d2  
    1414//
    1515
    16 #include "Declaration.h"
    1716#include "Expression.h"
    1817#include "VarExprReplacer.h"
    1918
    20 VarExprReplacer::VarExprReplacer( const DeclMap & declMap, bool debug ) : declMap( declMap ), debug( debug ) {}
     19VarExprReplacer::VarExprReplacer( const DeclMap & declMap ) : declMap( declMap ) {}
    2120
    2221// replace variable with new node from decl map
    2322void 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  }
    3127}
Note: See TracChangeset for help on using the changeset viewer.