Disable a consistency check.
[oota-llvm.git] / lib / Linker / LinkModules.cpp
index aeaa7eb90903b64cc65daf3e2feeff2c507299e1..edee55a1f9f65fc50ea54142bce1f7d010da37d2 100644 (file)
@@ -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);
 }