Make sure intrinsics that are lowered to functions make the function weak
[oota-llvm.git] / lib / CodeGen / IntrinsicLowering.cpp
index e2c33b2455de2cba0b49d2bbaf0b388e2fe493d6..501c12c6fe42b5f5cda6f76a81c2be5d1270589e 100644 (file)
@@ -264,7 +264,7 @@ static Instruction *LowerPartSelect(CallInst *CI) {
       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 @@ static Instruction *LowerPartSet(CallInst *CI) {
       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()) {