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
This commit is contained in:
@@ -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'
|
||||
|
||||
Reference in New Issue
Block a user