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 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) {