dead_code_removing #40
@@ -1028,7 +1028,8 @@ static bool runAnalysis(SgProject &project, const int curr_regime, const bool ne
|
||||
{
|
||||
auto funcsForFile = getObjectForFileFromMap(file_name, allFuncInfo);
|
||||
for (auto& func : funcsForFile)
|
||||
removeDeadCode(func->funcPointer, allFuncInfo, commonBlocks);
|
||||
if(func->funcPointer->variant() != ENTRY_STAT)
|
||||
removeDeadCode(func->funcPointer, allFuncInfo, commonBlocks);
|
||||
}
|
||||
else if (curr_regime == TEST_PASS)
|
||||
{
|
||||
|
||||
@@ -228,7 +228,9 @@ public:
|
||||
updated |= updateNextNotEmpty();
|
||||
|
||||
updated |= updateJumpStatus();
|
||||
updated |= this->forwardData({ });
|
||||
|
||||
if(updated)
|
||||
this->forwardData({ });
|
||||
|
||||
return updated;
|
||||
}
|
||||
@@ -316,6 +318,7 @@ public:
|
||||
{
|
||||
setBlock(block);
|
||||
useful.resize(block->getInstructions().size(), false);
|
||||
this->forwardData({ });
|
||||
}
|
||||
|
||||
const vector<bool>& getResult() { return useful; }
|
||||
@@ -371,7 +374,8 @@ void removeDeadCode(SgStatement* func,
|
||||
set<SAPFOR::BasicBlock*> reachable;
|
||||
|
||||
for (auto b : cfg_pair.second)
|
||||
if(b->getInstructions().front()->isHeader())
|
||||
if(b->getInstructions().front()->isHeader() ||
|
||||
b->getInstructions().front()->getInstruction()->getOperation() == SAPFOR::CFG_OP::ENTRY)
|
||||
reachable.insert(b);
|
||||
|
||||
set<SAPFOR::BasicBlock*> worklist = reachable;
|
||||
|
||||
Reference in New Issue
Block a user