diff options
author | Chris Lattner <sabre@nondot.org> | 2010-03-23 22:59:07 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2010-03-23 22:59:07 +0000 |
commit | 00eeac41793b9ad5026ed087594f768367ffce25 (patch) | |
tree | 1a46b9986d20e5b020d37f272cf1fd666aaaf4ad /llvm/lib/Transforms/Utils/InlineFunction.cpp | |
parent | c53d5d6bb49784b9e74da63c6c4e3bf372a8f1dd (diff) | |
download | bcm5719-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.cpp | 4 |
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' |