diff options
author | Teresa Johnson <tejohnson@google.com> | 2016-02-10 19:11:15 +0000 |
---|---|---|
committer | Teresa Johnson <tejohnson@google.com> | 2016-02-10 19:11:15 +0000 |
commit | 89f38fb5cc8006dfb9737417257307b4fda9c44c (patch) | |
tree | 9566557c429cad5fef83b095f7dc154b9b060187 /llvm/lib/IR/FunctionInfo.cpp | |
parent | d16cebef5df2c38067bb0168819a4a4f6b443ee9 (diff) | |
download | bcm5719-llvm-89f38fb5cc8006dfb9737417257307b4fda9c44c.tar.gz bcm5719-llvm-89f38fb5cc8006dfb9737417257307b4fda9c44c.zip |
Revert "[ThinLTO] Use MD5 hash in function index." due to bot failure
This reverts commit r260408. Bot failure that I need to investigate.
llvm-svn: 260412
Diffstat (limited to 'llvm/lib/IR/FunctionInfo.cpp')
-rw-r--r-- | llvm/lib/IR/FunctionInfo.cpp | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/llvm/lib/IR/FunctionInfo.cpp b/llvm/lib/IR/FunctionInfo.cpp index 246023907f9..e5f3dbbdb74 100644 --- a/llvm/lib/IR/FunctionInfo.cpp +++ b/llvm/lib/IR/FunctionInfo.cpp @@ -23,7 +23,7 @@ void FunctionInfoIndex::mergeFrom(std::unique_ptr<FunctionInfoIndex> Other, StringRef ModPath; for (auto &OtherFuncInfoLists : *Other) { - uint64_t FuncGUID = OtherFuncInfoLists.first; + std::string FuncName = OtherFuncInfoLists.getKey(); FunctionInfoList &List = OtherFuncInfoLists.second; // Assert that the func info list only has one entry, since we shouldn't @@ -49,9 +49,20 @@ void FunctionInfoIndex::mergeFrom(std::unique_ptr<FunctionInfoIndex> Other, // string reference owned by the combined index. Info->functionSummary()->setModulePath(ModPath); + // If it is a local function, rename it. + if (GlobalValue::isLocalLinkage( + Info->functionSummary()->getFunctionLinkage())) { + // Any local functions are virtually renamed when being added to the + // combined index map, to disambiguate from other functions with + // the same name. The symbol table created for the combined index + // file should contain the renamed symbols. + FuncName = + FunctionInfoIndex::getGlobalNameForLocal(FuncName, NextModuleId); + } + // Add new function info to existing list. There may be duplicates when // combining FunctionMap entries, due to COMDAT functions. Any local - // functions were given unique global IDs. - addFunctionInfo(FuncGUID, std::move(Info)); + // functions were virtually renamed above. + addFunctionInfo(FuncName, std::move(Info)); } } |