summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Linker/LinkModules.cpp6
1 files changed, 1 insertions, 5 deletions
diff --git a/llvm/lib/Linker/LinkModules.cpp b/llvm/lib/Linker/LinkModules.cpp
index aeaa7eb9090..edee55a1f9f 100644
--- a/llvm/lib/Linker/LinkModules.cpp
+++ b/llvm/lib/Linker/LinkModules.cpp
@@ -940,12 +940,8 @@ void ModuleLinker::materializeInitFor(GlobalValue *New, GlobalValue *Old) {
if (isPerformingImport() && !doImportAsDefinition(Old))
return;
- if (DoNotLinkFromSource.count(Old)) {
- if (!New->hasExternalLinkage() && !New->hasExternalWeakLinkage() &&
- !New->hasAppendingLinkage())
- emitError("Declaration points to discarded value");
+ if (DoNotLinkFromSource.count(Old))
return;
- }
linkGlobalValueBody(*Old);
}
OpenPOWER on IntegriCloud