]> granicus.if.org Git - llvm/commitdiff
[InlineFunction] use getFunction(); NFC
authorSanjay Patel <spatel@rotateright.com>
Wed, 15 Feb 2017 15:22:18 +0000 (15:22 +0000)
committerSanjay Patel <spatel@rotateright.com>
Wed, 15 Feb 2017 15:22:18 +0000 (15:22 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295185 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/Utils/InlineFunction.cpp

index f6f155691dd12a7a52cd20c49acf0b9e15dc07ee..bd3aa8d3867b869e8f01a92a1c283769a00d58af 100644 (file)
@@ -1223,7 +1223,7 @@ static Value *HandleByValArgument(Value *Arg, Instruction *TheCall,
   PointerType *ArgTy = cast<PointerType>(Arg->getType());
   Type *AggTy = ArgTy->getElementType();
 
-  Function *Caller = TheCall->getParent()->getParent();
+  Function *Caller = TheCall->getFunction();
 
   // If the called function is readonly, then it could not mutate the caller's
   // copy of the byval'd memory.  In this case, it is safe to elide the copy and
@@ -1460,8 +1460,8 @@ static void updateCalleeCount(BlockFrequencyInfo &CallerBFI, BasicBlock *CallBB,
 bool llvm::InlineFunction(CallSite CS, InlineFunctionInfo &IFI,
                           AAResults *CalleeAAR, bool InsertLifetime) {
   Instruction *TheCall = CS.getInstruction();
-  assert(TheCall->getParent() && TheCall->getParent()->getParent() &&
-         "Instruction not in function!");
+  assert(TheCall->getParent() && TheCall->getFunction()
+         && "Instruction not in function!");
 
   // If IFI has any state in it, zap it before we fill it in.
   IFI.reset();