From: Bill Wendling Date: Fri, 21 Nov 2008 00:09:21 +0000 (+0000) Subject: Fix error where it wasn't getting the correct caller function. X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=66c75aaa028683c389c55b377ee2411b61081677;p=oota-llvm.git Fix error where it wasn't getting the correct caller function. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59758 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Transforms/IPO/Inliner.cpp b/lib/Transforms/IPO/Inliner.cpp index bf0925c2e2f..f97fce6e06c 100644 --- a/lib/Transforms/IPO/Inliner.cpp +++ b/lib/Transforms/IPO/Inliner.cpp @@ -54,11 +54,12 @@ static bool InlineCallIfPossible(CallSite CS, CallGraph &CG, const std::set &SCCFunctions, const TargetData &TD) { Function *Callee = CS.getCalledFunction(); + Function *Caller = CS.getCaller(); + if (!InlineFunction(CS, &CG, &TD)) return false; // If the inlined function had a higher stack protection level than the // calling function, then bump up the caller's stack protection level. - Function *Caller = CS.getCaller(); if (Callee->hasFnAttr(Attribute::StackProtectReq)) Caller->addFnAttr(Attribute::StackProtectReq); else if (Callee->hasFnAttr(Attribute::StackProtect) &&