Teach ModuleLinker::getLinkageResult about materialisable functions
[oota-llvm.git] / lib / Linker / LinkModules.cpp
index 03a962e3be5d5c458d1a6e728f220c4fe9f87a74..bcc6782129ce905e0e4b8cea40a63b089200290e 100644 (file)
@@ -446,7 +446,7 @@ bool ModuleLinker::getLinkageResult(GlobalValue *Dest, const GlobalValue *Src,
   assert(!Src->hasLocalLinkage() &&
          "If Src has internal linkage, Dest shouldn't be set!");
   
-  bool SrcIsDeclaration = Src->isDeclaration();
+  bool SrcIsDeclaration = Src->isDeclaration() && !Src->isMaterializable();
   bool DestIsDeclaration = Dest->isDeclaration();
   
   if (SrcIsDeclaration) {