Teach ModuleLinker::getLinkageResult about materialisable functions
authorPeter Collingbourne <peter@pcc.me.uk>
Sun, 30 Oct 2011 17:46:34 +0000 (17:46 +0000)
committerPeter Collingbourne <peter@pcc.me.uk>
Sun, 30 Oct 2011 17:46:34 +0000 (17:46 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@143316 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Linker/LinkModules.cpp

index 03a962e..bcc6782 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) {