From df41353497b7b561649303a6a8bf23a7cb995f5a Mon Sep 17 00:00:00 2001 From: Reid Spencer Date: Thu, 12 Apr 2007 21:53:38 +0000 Subject: [PATCH] Make sure intrinsics that are lowered to functions make the function weak linkage so we only end up with one of them in a program. These are, after all overloaded and templatish in nature. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35956 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/IntrinsicLowering.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/CodeGen/IntrinsicLowering.cpp b/lib/CodeGen/IntrinsicLowering.cpp index e2c33b2455d..501c12c6fe4 100644 --- a/lib/CodeGen/IntrinsicLowering.cpp +++ b/lib/CodeGen/IntrinsicLowering.cpp @@ -264,7 +264,7 @@ static Instruction *LowerPartSelect(CallInst *CI) { Name[i] = '_'; Module* M = F->getParent(); F = cast(M->getOrInsertFunction(Name, FT)); - F->setLinkage(GlobalValue::InternalLinkage); + F->setLinkage(GlobalValue::WeakLinkage); // If we haven't defined the impl function yet, do so now if (F->isDeclaration()) { @@ -437,7 +437,7 @@ static Instruction *LowerPartSet(CallInst *CI) { Name[i] = '_'; Module* M = F->getParent(); F = cast(M->getOrInsertFunction(Name, FT)); - F->setLinkage(GlobalValue::InternalLinkage); + F->setLinkage(GlobalValue::WeakLinkage); // If we haven't defined the impl function yet, do so now if (F->isDeclaration()) {