From: Sanjay Patel Date: Wed, 15 Feb 2017 15:08:38 +0000 (+0000) Subject: [InlineFunction] use getCaller(); NFCI X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ae60795a8ebb1adfb0b59696f538693319988d8f;p=llvm [InlineFunction] use getCaller(); NFCI git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295181 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Transforms/Utils/InlineFunction.cpp b/lib/Transforms/Utils/InlineFunction.cpp index cc83ee7bafc..f6f155691dd 100644 --- a/lib/Transforms/Utils/InlineFunction.cpp +++ b/lib/Transforms/Utils/InlineFunction.cpp @@ -1112,8 +1112,7 @@ static void AddAlignmentAssumptions(CallSite CS, InlineFunctionInfo &IFI) { unsigned Align = Arg.getType()->isPointerTy() ? Arg.getParamAlignment() : 0; if (Align && !Arg.hasByValOrInAllocaAttr() && !Arg.hasNUses(0)) { if (!DTCalculated) { - DT.recalculate(const_cast(*CS.getInstruction()->getParent() - ->getParent())); + DT.recalculate(*CS.getCaller()); DTCalculated = true; } @@ -1139,7 +1138,7 @@ static void UpdateCallGraphAfterInlining(CallSite CS, ValueToValueMapTy &VMap, InlineFunctionInfo &IFI) { CallGraph &CG = *IFI.CG; - const Function *Caller = CS.getInstruction()->getParent()->getParent(); + const Function *Caller = CS.getCaller(); const Function *Callee = CS.getCalledFunction(); CallGraphNode *CalleeNode = CG[Callee]; CallGraphNode *CallerNode = CG[Caller];