private_removing: small fix
This commit is contained in:
@@ -354,8 +354,9 @@ static FuncInfo* getCurrentFunc(SgStatement* stmt, const map<string, vector<Func
|
|||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
// fillIterationVariables fill vars set with iteration variables of all loops
|
// fillIterationVariables fills SgSymbol* set with iteration variables of all loops
|
||||||
// from stmt to outerLoopStmt
|
// from stmt to outerLoopStmt. If outerLoopStmt is nullptr, it fill with iteration variables
|
||||||
|
// from all outer loops
|
||||||
static void fillIterationVars(SgStatement* stmt, SgStatement* outerLoopStmt, vector<SgSymbol*>& vars)
|
static void fillIterationVars(SgStatement* stmt, SgStatement* outerLoopStmt, vector<SgSymbol*>& vars)
|
||||||
{
|
{
|
||||||
if (stmt == nullptr)
|
if (stmt == nullptr)
|
||||||
@@ -364,7 +365,7 @@ static void fillIterationVars(SgStatement* stmt, SgStatement* outerLoopStmt, vec
|
|||||||
if (stmt->variant() == FOR_NODE)
|
if (stmt->variant() == FOR_NODE)
|
||||||
vars.push_back(((SgForStmt*)stmt)->doName());
|
vars.push_back(((SgForStmt*)stmt)->doName());
|
||||||
|
|
||||||
if (stmt->id() != outerLoopStmt->id())
|
if (stmt != outerLoopStmt)
|
||||||
fillIterationVars(stmt->controlParent(), outerLoopStmt, vars);
|
fillIterationVars(stmt->controlParent(), outerLoopStmt, vars);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2100,7 +2101,7 @@ static bool checkDefUsePair(Context* ctx, const DefUseStmtsPair& defUse, const C
|
|||||||
}
|
}
|
||||||
|
|
||||||
vector<SgSymbol*> iterationVars{};
|
vector<SgSymbol*> iterationVars{};
|
||||||
fillIterationVars(defUse.second, ctx->loopStmt, iterationVars);
|
fillIterationVars(defUse.second, nullptr, iterationVars);
|
||||||
|
|
||||||
auto defInsAndBlock = getInstructionAndBlockByStatement(CFGraph, defUse.first);
|
auto defInsAndBlock = getInstructionAndBlockByStatement(CFGraph, defUse.first);
|
||||||
const auto& defRD_In = defInsAndBlock.second->getRD_In();
|
const auto& defRD_In = defInsAndBlock.second->getRD_In();
|
||||||
|
|||||||
Reference in New Issue
Block a user