fixed getModuleSymbols

This commit is contained in:
ALEXks
2026-02-19 08:34:58 +03:00
committed by Oleg Nikitin
parent 2a0cfdb68e
commit fe81822c96
2 changed files with 3 additions and 3 deletions

View File

@@ -325,7 +325,7 @@ static void getModuleSymbols(SgStatement* func, set<SgSymbol*>& symbs)
}
}
set<SgSymbol*> getModuleSymbols(SgStatement *func)
const set<SgSymbol*>& getModuleSymbols(SgStatement *func)
{
auto it = symbolsForFunc.find(func->symbol()->identifier());
if (it != symbolsForFunc.end())
@@ -345,7 +345,7 @@ set<SgSymbol*> getModuleSymbols(SgStatement *func)
}
symbolsForFunc[func->symbol()->identifier()] = symbs;
return symbs;
return symbolsForFunc[func->symbol()->identifier()];
}
static void findSymbol(SgStatement* func, const string& varName, const string& locName,

View File

@@ -1,7 +1,7 @@
#pragma once
std::string correctSymbolModuleName(const std::string& origFull);
std::set<SgSymbol*> getModuleSymbols(SgStatement* func);
const std::set<SgSymbol*>& getModuleSymbols(SgStatement* func);
void getModulesAndFunctions(SgFile* file, std::vector<SgStatement*>& modulesAndFunctions);
void findModulesInFile(SgFile* file, std::vector<SgStatement*>& modules);
std::map<std::string, std::set<std::string>> createMapOfModuleUses(SgFile* file);