diff options
Diffstat (limited to 'llvm/lib')
| -rw-r--r-- | llvm/lib/Transforms/Utils/InlineFunction.cpp | 5 | 
1 files changed, 2 insertions, 3 deletions
| diff --git a/llvm/lib/Transforms/Utils/InlineFunction.cpp b/llvm/lib/Transforms/Utils/InlineFunction.cpp index cc83ee7bafc..f6f155691dd 100644 --- a/llvm/lib/Transforms/Utils/InlineFunction.cpp +++ b/llvm/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<Function&>(*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]; | 

