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.
llvm-svn: 35956
diff --git a/llvm/lib/CodeGen/IntrinsicLowering.cpp b/llvm/lib/CodeGen/IntrinsicLowering.cpp
index e2c33b2..501c12c 100644
--- a/llvm/lib/CodeGen/IntrinsicLowering.cpp
+++ b/llvm/lib/CodeGen/IntrinsicLowering.cpp
@@ -264,7 +264,7 @@
Name[i] = '_';
Module* M = F->getParent();
F = cast<Function>(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 @@
Name[i] = '_';
Module* M = F->getParent();
F = cast<Function>(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()) {