[llvm] r295185 - [InlineFunction] use getFunction(); NFC

Sanjay Patel via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 15 07:22:18 PST 2017


Author: spatel
Date: Wed Feb 15 09:22:18 2017
New Revision: 295185

URL: http://llvm.org/viewvc/llvm-project?rev=295185&view=rev
Log:
[InlineFunction] use getFunction(); NFC

Modified:
    llvm/trunk/lib/Transforms/Utils/InlineFunction.cpp

Modified: llvm/trunk/lib/Transforms/Utils/InlineFunction.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/InlineFunction.cpp?rev=295185&r1=295184&r2=295185&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Utils/InlineFunction.cpp (original)
+++ llvm/trunk/lib/Transforms/Utils/InlineFunction.cpp Wed Feb 15 09:22:18 2017
@@ -1223,7 +1223,7 @@ static Value *HandleByValArgument(Value
   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(BlockFrequ
 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();




More information about the llvm-commits mailing list