// // Cforall Version 1.0.0 Copyright (C) 2015 University of Waterloo // // The contents of this file are covered under the licence agreement in the // file "LICENCE" distributed with Cforall. // // XXX.cc -- // // Author : Richard C. Bilson // Created On : Mon May 18 07:44:20 2015 // Last Modified By : Rob Schluntz // Last Modified On : Mon May 02 15:19:17 2016 // Update Count : 3 // #include "Statement.h" #include "Common/utility.h" #include #include #include "Expression.h" #include "Declaration.h" using std::string; using std::endl; class VarExprReplacer : public Visitor { public: typedef std::map< DeclarationWithType *, DeclarationWithType * > DeclMap; private: const DeclMap & declMap; public: VarExprReplacer( const DeclMap & declMap ) : declMap( declMap ) {} // replace variable with new node from decl map virtual void visit( VariableExpr * varExpr ) { if ( declMap.count( varExpr->get_var() ) ) { varExpr->set_var( declMap.at( varExpr->get_var() ) ); } } }; CompoundStmt::CompoundStmt( std::list