summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Linker/LinkModules.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/Linker/LinkModules.cpp')
-rw-r--r--llvm/lib/Linker/LinkModules.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/llvm/lib/Linker/LinkModules.cpp b/llvm/lib/Linker/LinkModules.cpp
index 6b60379803e..cdf1decc813 100644
--- a/llvm/lib/Linker/LinkModules.cpp
+++ b/llvm/lib/Linker/LinkModules.cpp
@@ -410,7 +410,7 @@ class ModuleLinker {
std::vector<AppendingVarInfo> AppendingVars;
// Set of items not to link in from source.
- SmallPtrSet<const Value *, 16> DoNotLinkFromSource;
+ SmallPtrSet<const GlobalValue *, 16> DoNotLinkFromSource;
DiagnosticHandlerFunction DiagnosticHandler;
@@ -1512,7 +1512,8 @@ void ModuleLinker::linkAppendingVarInit(AppendingVarInfo &AVI) {
for (auto *V : SrcElements) {
if (IsNewStructor) {
- Constant *Key = V->getAggregateElement(2);
+ auto *Key =
+ dyn_cast<GlobalValue>(V->getAggregateElement(2)->stripPointerCasts());
if (DoNotLinkFromSource.count(Key))
continue;
}
OpenPOWER on IntegriCloud