diff options
Diffstat (limited to 'lib/Transforms')
-rw-r--r-- | lib/Transforms/IPO/IndMemRemoval.cpp | 4 | ||||
-rw-r--r-- | lib/Transforms/Utils/InlineCost.cpp | 9 | ||||
-rw-r--r-- | lib/Transforms/Utils/LowerInvoke.cpp | 2 |
3 files changed, 6 insertions, 9 deletions
diff --git a/lib/Transforms/IPO/IndMemRemoval.cpp b/lib/Transforms/IPO/IndMemRemoval.cpp index 6b1f969..b55dea2 100644 --- a/lib/Transforms/IPO/IndMemRemoval.cpp +++ b/lib/Transforms/IPO/IndMemRemoval.cpp @@ -53,7 +53,7 @@ bool IndMemRemPass::runOnModule(Module &M) { if (Function* F = M.getFunction("free")) { if (F->isDeclaration() && F->arg_size() == 1 && !F->use_empty()) { Function* FN = Function::Create(F->getFunctionType(), - GlobalValue::LinkOnceLinkage, + GlobalValue::LinkOnceAnyLinkage, "free_llvm_bounce", &M); BasicBlock* bb = BasicBlock::Create("entry",FN); Instruction* R = ReturnInst::Create(bb); @@ -67,7 +67,7 @@ bool IndMemRemPass::runOnModule(Module &M) { if (Function* F = M.getFunction("malloc")) { if (F->isDeclaration() && F->arg_size() == 1 && !F->use_empty()) { Function* FN = Function::Create(F->getFunctionType(), - GlobalValue::LinkOnceLinkage, + GlobalValue::LinkOnceAnyLinkage, "malloc_llvm_bounce", &M); FN->setDoesNotAlias(0); BasicBlock* bb = BasicBlock::Create("entry",FN); diff --git a/lib/Transforms/Utils/InlineCost.cpp b/lib/Transforms/Utils/InlineCost.cpp index b9f13d9..209ba92 100644 --- a/lib/Transforms/Utils/InlineCost.cpp +++ b/lib/Transforms/Utils/InlineCost.cpp @@ -182,12 +182,9 @@ InlineCost InlineCostAnalyzer::getInlineCost(CallSite CS, // Don't inline functions which can be redefined at link-time to mean // something else. - // FIXME: We allow link-once linkage since in practice all versions of - // the function have the same body (C++ ODR) - but the LLVM definition - // of LinkOnceLinkage doesn't require this. - if ((Callee->mayBeOverridden() && !Callee->hasLinkOnceLinkage()) || - // Don't inline functions marked noinline. - Callee->hasFnAttr(Attribute::NoInline) || NeverInline.count(Callee)) + if (Callee->mayBeOverridden() || + // Don't inline functions marked noinline. + Callee->hasFnAttr(Attribute::NoInline) || NeverInline.count(Callee)) return llvm::InlineCost::getNever(); // InlineCost - This value measures how good of an inline candidate this call diff --git a/lib/Transforms/Utils/LowerInvoke.cpp b/lib/Transforms/Utils/LowerInvoke.cpp index 20cff90..b0364ec 100644 --- a/lib/Transforms/Utils/LowerInvoke.cpp +++ b/lib/Transforms/Utils/LowerInvoke.cpp @@ -139,7 +139,7 @@ bool LowerInvoke::doInitialization(Module &M) { // already exists. if (!(JBListHead = M.getGlobalVariable("llvm.sjljeh.jblist", PtrJBList))) { JBListHead = new GlobalVariable(PtrJBList, false, - GlobalValue::LinkOnceLinkage, + GlobalValue::LinkOnceAnyLinkage, Constant::getNullValue(PtrJBList), "llvm.sjljeh.jblist", &M); } |