Program Listing for File replaceExpressionWithStatement.h

Program Listing for File replaceExpressionWithStatement.h#

Return to documentation for file (src/midend/programTransformation/astInlining/replaceExpressionWithStatement.h)

#ifndef REPLACEEXPRESSIONWITHSTATEMENT_H
#define REPLACEEXPRESSIONWITHSTATEMENT_H

// DQ (3/12/2006): This is now not required, the file name is
// changed to rose_config.h and is included directly by rose.h.
// #include "config.h"


#include <string>

// DQ (3/12/2006): This is available from rose.h
// #include <list>

//extern int gensym_counter;

// King84: there seems to be a circular dependency with including sage interface (which happens before this file is included), so we just predeclare the one class we use from it.
namespace SageInterface { class StatementGenerator; }

inline static Rose_STL_Container<SgStatement*> make_unit_list(SgStatement* x) {
  Rose_STL_Container<SgStatement*> result;
  result.push_back(x);
  return result;
}

void replaceAssignmentStmtWithStatement(SgExprStatement* from,
                                        SageInterface::StatementGenerator* to);

// DQ (12/14/2006): Modified this function to find the root node of an expression, which
// is not always a SgExpressionRoot, now that we have removed these from the AST.
SgExpression* getRootOfExpression(SgExpression* n);

void pushTestIntoBody(SgScopeStatement* loopStmt);


void myStatementInsert(SgStatement* target,
                       SgStatement* newstmt,
                       bool before,
                       bool allowForInit = false);

void replaceExpressionWithExpression(SgExpression* from, SgExpression* to);

SgAssignOp* convertInitializerIntoAssignment(SgAssignInitializer* init);

SgStatement* getStatementOfExpression(SgNode* n);

#endif // REPLACEEXPRESSIONWITHSTATEMENT_H