#pragma once #include #include "../Utils/SgUtils.h" #include "../Utils/CommonBlock.h" #include "../GraphCall/graph_calls.h" #include "CFGraph.h" #include "IR.h" inline bool hasStoreStructure(SAPFOR::CFG_OP type) { return (type == SAPFOR::CFG_OP::STORE) || (type == SAPFOR::CFG_OP::REC_REF_STORE) || (type == SAPFOR::CFG_OP::POINTER_ASS); } const std::map& getCommonArgsByFunc(FuncInfo* func, std::map>& cache, const std::vector>& commonVars, std::unordered_map& globals_cache, std::unordered_map& locals_cache); std::vector sortCfgNodes(const std::vector& blocks, std::set>* ignored_edges = NULL); const std::string& getArgNameBySymbol(const std::vector>& commonVars, const FuncInfo* func, SgSymbol* s, std::unordered_map& globals_cache, std::unordered_map& locals_cache); // main functions of SUBST_EXPR_RD pass void buildSubstitutions(const std::map>& CFGraph_for_project, const std::map& commonBlocks, SgProject* project); void performRDSubst(const std::map>& CFGraph_for_project, const std::map& commonBlocks, SgProject* project); void revertSubstitutions(); void cancelRevertionForStatement(std::string filename, SgStatement* stmt, int i); /*void destroyReplacementsInFiles(); void destroyOldExpressionsInFile(); void destroyAllSubstitutionsData();*/