remove prefix fixed
This commit is contained in:
@@ -764,7 +764,7 @@ static void processVarBlock(SgStatement* func, SgStatement* firstExec, map<strin
|
||||
|
||||
static void insertStmtToModule(const map<string, SgStatement*>& moduleStmts, const map<string, SgStatement*>& moduleParamStmts,
|
||||
set<string>& addedModuleParams, const set<string>& commonVariables, SgStatement* proc_moduleF,
|
||||
set<string>& localVarNoParams, const set<string>& externVars)
|
||||
set<string>& localVarNoParams, const set<string>& externVars, const size_t prefixLen)
|
||||
{
|
||||
SgStatement* endProcModuleF = proc_moduleF->lastNodeOfStmt();
|
||||
|
||||
@@ -775,8 +775,7 @@ static void insertStmtToModule(const map<string, SgStatement*>& moduleStmts, con
|
||||
string varNameNoPref = varName;
|
||||
|
||||
string::size_type pos{};
|
||||
pos = varName.find_first_of("_", pos);
|
||||
varNameNoPref.erase(0, pos + 1);
|
||||
varNameNoPref.erase(0, pos + prefixLen + 1);
|
||||
|
||||
if (commonVariables.count(varNameNoPref) == 0 && moduleParamStmts.count(varName) == 0
|
||||
&& externVars.count(varNameNoPref) == 0) {
|
||||
@@ -1215,7 +1214,8 @@ static void processFunctionCallChain(SgStatement* func, const vector<FuncInfo*>&
|
||||
|
||||
set<string> addedModuleParams;
|
||||
set<string> localVarNoParams;
|
||||
insertStmtToModule(moduleStmts, moduleParamStmts, addedModuleParams, commonVariables, proc_moduleF, localVarNoParams, externVars);
|
||||
insertStmtToModule(moduleStmts, moduleParamStmts, addedModuleParams, commonVariables, proc_moduleF, localVarNoParams,
|
||||
externVars, funcName.size());
|
||||
|
||||
const string namelabelSymb = funcFrom->funcName + "_label";
|
||||
SgSymbol* procLabelSymb = createLabel(namelabelSymb, proc_moduleF);
|
||||
@@ -1397,7 +1397,8 @@ void createCheckpoints(SgFile* file, const map<string, CommonBlock*>& commonBloc
|
||||
|
||||
set<string> addedModuleParams;
|
||||
set<string> localVarNoParams;
|
||||
insertStmtToModule(moduleStmts, moduleParamStmts, addedModuleParams, commonVariables, proc_moduleF, localVarNoParams, externVars);
|
||||
insertStmtToModule(moduleStmts, moduleParamStmts, addedModuleParams, commonVariables, proc_moduleF, localVarNoParams,
|
||||
externVars, sizeof(funcName) / sizeof(char) - 1);
|
||||
|
||||
const vector<SgStatement*> useOfMods = findUseOfModules(func->lexNext(), firstExec);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user