Fix error where it wasn't getting the correct caller function.
authorBill Wendling <isanbard@gmail.com>
Fri, 21 Nov 2008 00:09:21 +0000 (00:09 +0000)
committerBill Wendling <isanbard@gmail.com>
Fri, 21 Nov 2008 00:09:21 +0000 (00:09 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59758 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/IPO/Inliner.cpp

index bf0925c2e2f23c6f4874c6d8cf1a691de8ac7e0c..f97fce6e06c01ed994cbb1c4a388f45afa16d3f7 100644 (file)
@@ -54,11 +54,12 @@ static bool InlineCallIfPossible(CallSite CS, CallGraph &CG,
                                  const std::set<Function*> &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) &&