summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Utils/InlineFunction.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2010-03-23 22:59:07 +0000
committerChris Lattner <sabre@nondot.org>2010-03-23 22:59:07 +0000
commit00eeac41793b9ad5026ed087594f768367ffce25 (patch)
tree1a46b9986d20e5b020d37f272cf1fd666aaaf4ad /llvm/lib/Transforms/Utils/InlineFunction.cpp
parentc53d5d6bb49784b9e74da63c6c4e3bf372a8f1dd (diff)
downloadbcm5719-llvm-00eeac41793b9ad5026ed087594f768367ffce25.tar.gz
bcm5719-llvm-00eeac41793b9ad5026ed087594f768367ffce25.zip
add some accessors to callsite/callinst/invokeinst to check
for the noinline attribute, and make the inliner refuse to inline a call site when the call site is marked noinline even if the callee isn't. This fixes PR6682. llvm-svn: 99341
Diffstat (limited to 'llvm/lib/Transforms/Utils/InlineFunction.cpp')
-rw-r--r--llvm/lib/Transforms/Utils/InlineFunction.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/Utils/InlineFunction.cpp b/llvm/lib/Transforms/Utils/InlineFunction.cpp
index 17f8827fd5c..599fe33aa03 100644
--- a/llvm/lib/Transforms/Utils/InlineFunction.cpp
+++ b/llvm/lib/Transforms/Utils/InlineFunction.cpp
@@ -229,7 +229,9 @@ bool llvm::InlineFunction(CallSite CS, CallGraph *CG, const TargetData *TD,
const Function *CalledFunc = CS.getCalledFunction();
if (CalledFunc == 0 || // Can't inline external function or indirect
CalledFunc->isDeclaration() || // call, or call to a vararg function!
- CalledFunc->getFunctionType()->isVarArg()) return false;
+ CalledFunc->getFunctionType()->isVarArg() ||
+ CS.isNoInline()) // Call site is marked noinline.
+ return false;
// If the call to the callee is not a tail call, we must clear the 'tail'
OpenPOWER on IntegriCloud