From a54934ae9d278448fb557366eb4a79a8cb3fc606 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Tue, 23 Mar 2010 22:59:07 +0000 Subject: 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99341 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Transforms/Utils/InlineFunction.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'lib/Transforms/Utils/InlineFunction.cpp') diff --git a/lib/Transforms/Utils/InlineFunction.cpp b/lib/Transforms/Utils/InlineFunction.cpp index 17f8827fd5..599fe33aa0 100644 --- a/lib/Transforms/Utils/InlineFunction.cpp +++ b/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' -- cgit v1.2.3-18-g5258