added CFG_withUnreachable option
This commit is contained in:
@@ -1162,6 +1162,7 @@ map<FuncInfo*, vector<BBlock*>> buildCFG(const map<string, CommonBlock*>& common
|
|||||||
if (SgFile::switchToFile(oldFile) == -1)
|
if (SgFile::switchToFile(oldFile) == -1)
|
||||||
printInternalError(convertFileName(__FILE__).c_str(), __LINE__);
|
printInternalError(convertFileName(__FILE__).c_str(), __LINE__);
|
||||||
|
|
||||||
|
if (!settings.withUnreachable)
|
||||||
for (auto& [func, blocks] : result)
|
for (auto& [func, blocks] : result)
|
||||||
removedUnreachableBlocks(blocks);
|
removedUnreachableBlocks(blocks);
|
||||||
|
|
||||||
|
|||||||
@@ -112,7 +112,8 @@ namespace SAPFOR
|
|||||||
CFG_withDVM = 5,
|
CFG_withDVM = 5,
|
||||||
CFG_withCallsInBlocks = 6,
|
CFG_withCallsInBlocks = 6,
|
||||||
CFG_withCallFrom = 7,
|
CFG_withCallFrom = 7,
|
||||||
CFG_withDominators = 8 };
|
CFG_withDominators = 8,
|
||||||
|
CFG_withUnreachable = 9 };
|
||||||
|
|
||||||
bool atLeastOneIterInLoop = false;
|
bool atLeastOneIterInLoop = false;
|
||||||
bool withRD = false;
|
bool withRD = false;
|
||||||
@@ -122,6 +123,7 @@ namespace SAPFOR
|
|||||||
bool withCallsInBlocks = false; // separate each F_CALL to own BasicBlock
|
bool withCallsInBlocks = false; // separate each F_CALL to own BasicBlock
|
||||||
bool withCallFrom = false;
|
bool withCallFrom = false;
|
||||||
bool withDominators = false;
|
bool withDominators = false;
|
||||||
|
bool withUnreachable = false;
|
||||||
|
|
||||||
explicit CFG_Settings(const std::set<setting> &settings = { CFG_withRD, CFG_withCallFrom, CFG_withDominators })
|
explicit CFG_Settings(const std::set<setting> &settings = { CFG_withRD, CFG_withCallFrom, CFG_withDominators })
|
||||||
{
|
{
|
||||||
@@ -143,6 +145,8 @@ namespace SAPFOR
|
|||||||
withCallFrom = true;
|
withCallFrom = true;
|
||||||
else if (set == CFG_withDominators)
|
else if (set == CFG_withDominators)
|
||||||
withDominators = true;
|
withDominators = true;
|
||||||
|
else if (set == CFG_withUnreachable)
|
||||||
|
withUnreachable = true;
|
||||||
else
|
else
|
||||||
printInternalError(convertFileName(__FILE__).c_str(), __LINE__);
|
printInternalError(convertFileName(__FILE__).c_str(), __LINE__);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1673,7 +1673,8 @@ void GroupShadow(const map<string, vector<FuncInfo*>>& allFuncs,
|
|||||||
|
|
||||||
SgStatement* func = currF->funcPointer->GetOriginal();
|
SgStatement* func = currF->funcPointer->GetOriginal();
|
||||||
|
|
||||||
const auto settings = CFG_Settings({ CFG_Settings::CFG_atLeastOneIterInLoop, CFG_Settings::CFG_withSPF, CFG_Settings::CFG_withCallsInBlocks });
|
const auto settings = CFG_Settings({ CFG_Settings::CFG_atLeastOneIterInLoop, CFG_Settings::CFG_withSPF,
|
||||||
|
CFG_Settings::CFG_withCallsInBlocks, CFG_Settings::CFG_withUnreachable });
|
||||||
auto cfg = buildCFGforCurrentFunc(func, settings, commonBlocks, allFuncs);
|
auto cfg = buildCFGforCurrentFunc(func, settings, commonBlocks, allFuncs);
|
||||||
if (cfg.size() != 1)
|
if (cfg.size() != 1)
|
||||||
printInternalError(convertFileName(__FILE__).c_str(), __LINE__);
|
printInternalError(convertFileName(__FILE__).c_str(), __LINE__);
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#define VERSION_SPF "2462"
|
#define VERSION_SPF "2463"
|
||||||
|
|||||||
Reference in New Issue
Block a user