Move global ID computation from Function to GlobalValue (NFC)

Since the static getGlobalIdentifier and getGUID methods are now called
for global values other than functions, reflect that by moving these
methods to the GlobalValue class.

llvm-svn: 263524
This commit is contained in:
Teresa Johnson
2016-03-15 02:13:19 +00:00
parent ee88b61500
commit b43027d1e0
8 changed files with 55 additions and 55 deletions

View File

@@ -5506,10 +5506,10 @@ std::error_code ModuleSummaryIndexBitcodeReader::parseValueSymbolTable(
auto VLI = ValueIdToLinkageMap.find(ValueID);
assert(VLI != ValueIdToLinkageMap.end() &&
"No linkage found for VST entry?");
std::string GlobalId =
Function::getGlobalIdentifier(ValueName, VLI->second, SourceFileName);
std::string GlobalId = GlobalValue::getGlobalIdentifier(
ValueName, VLI->second, SourceFileName);
TheIndex->addGlobalValueInfo(GlobalId, std::move(GlobalValInfo));
ValueIdToCallGraphGUIDMap[ValueID] = Function::getGUID(GlobalId);
ValueIdToCallGraphGUIDMap[ValueID] = GlobalValue::getGUID(GlobalId);
ValueName.clear();
break;
}
@@ -5526,10 +5526,11 @@ std::error_code ModuleSummaryIndexBitcodeReader::parseValueSymbolTable(
auto VLI = ValueIdToLinkageMap.find(ValueID);
assert(VLI != ValueIdToLinkageMap.end() &&
"No linkage found for VST entry?");
std::string FunctionGlobalId =
Function::getGlobalIdentifier(ValueName, VLI->second, SourceFileName);
std::string FunctionGlobalId = GlobalValue::getGlobalIdentifier(
ValueName, VLI->second, SourceFileName);
TheIndex->addGlobalValueInfo(FunctionGlobalId, std::move(FuncInfo));
ValueIdToCallGraphGUIDMap[ValueID] = Function::getGUID(FunctionGlobalId);
ValueIdToCallGraphGUIDMap[ValueID] =
GlobalValue::getGUID(FunctionGlobalId);
ValueName.clear();
break;