#pragma once #include "dvm.h" #include "../DirectiveProcessing/directive_parser.h" #include "../CFGraph/CFGraph.h" #include "../CFGraph/RD_subst.h" // Regime defines the regime of private removing enum class Regime { DEFLT = 1, REGULAR_INDEXES }; // PrivateToRemove represents private variable of loop, that can be removed // by substitution of its definition statements (DEF) into usage statements (USE). // fixedDimensions is used for comparison of DEF and USE statements struct PrivateToRemove { LoopGraph* loop; SgSymbol* varSymbol; Regime regime; std::vector> defUseStmtsPairs; std::vector fixedDimensions; }; // removePrivates removes all privates from vector privatesToRemoveGloval // and add info messages void removePrivates(std::string filename, std::vector& messages, const std::map& commonBlocks, const std::map>& allFuncInfo, int& countOfTransform); // removePrivatesAnalysis checks all private variables in loopGraphs specified by usersDirectives // if they can be removed, and adds those that can to vector privatesToRemoveGloval. // if private var cannot be removed, the error message is returned with vector messages void removePrivatesAnalysis(std::string filename, std::vector& loopGraphs, std::vector& messages, const std::map, std::set>& usersDirectives, const std::map& commonBlocks, const std::map>& allFuncInfo);