summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
diff options
context:
space:
mode:
authorTeresa Johnson <tejohnson@google.com>2016-01-12 17:48:44 +0000
committerTeresa Johnson <tejohnson@google.com>2016-01-12 17:48:44 +0000
commit388497e8be631e61081ddf7ff5204cf79493d2f1 (patch)
treef2768fab689e45bf5c288f0a244fee609b7b7575 /llvm/lib/Transforms
parent3a5b6e275013276b253246f2b4de4146fcafd881 (diff)
downloadbcm5719-llvm-388497e8be631e61081ddf7ff5204cf79493d2f1.tar.gz
bcm5719-llvm-388497e8be631e61081ddf7ff5204cf79493d2f1.zip
[ThinLTO] Handle an external call from an import to an alias in dest
The findExternalCalls routine ignores calls to functions already defined in the dest module. This was not handling the case where the definition in the current module is actually an alias to a function call. llvm-svn: 257493
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r--llvm/lib/Transforms/IPO/FunctionImport.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/IPO/FunctionImport.cpp b/llvm/lib/Transforms/IPO/FunctionImport.cpp
index 11418edbf7b..5e0df950511 100644
--- a/llvm/lib/Transforms/IPO/FunctionImport.cpp
+++ b/llvm/lib/Transforms/IPO/FunctionImport.cpp
@@ -133,6 +133,8 @@ static void findExternalCalls(const Module &DestModule, Function &F,
// Ignore functions already present in the destination module
auto *SrcGV = DestModule.getNamedValue(ImportedName);
if (SrcGV) {
+ if (GlobalAlias *SGA = dyn_cast<GlobalAlias>(SrcGV))
+ SrcGV = SGA->getBaseObject();
assert(isa<Function>(SrcGV) && "Name collision during import");
if (!cast<Function>(SrcGV)->isDeclaration()) {
DEBUG(dbgs() << DestModule.getModuleIdentifier() << ": Ignoring "
OpenPOWER on IntegriCloud