[llvm] r350938 - [MergeFunc] Use Instruction::getFunction as a cleanup, NFC

Vedant Kumar via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 11 09:56:21 PST 2019


Author: vedantk
Date: Fri Jan 11 09:56:21 2019
New Revision: 350938

URL: http://llvm.org/viewvc/llvm-project?rev=350938&view=rev
Log:
[MergeFunc] Use Instruction::getFunction as a cleanup, NFC

Modified:
    llvm/trunk/lib/Transforms/IPO/MergeFunctions.cpp

Modified: llvm/trunk/lib/Transforms/IPO/MergeFunctions.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/MergeFunctions.cpp?rev=350938&r1=350937&r2=350938&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/IPO/MergeFunctions.cpp (original)
+++ llvm/trunk/lib/Transforms/IPO/MergeFunctions.cpp Fri Jan 11 09:56:21 2019
@@ -474,7 +474,7 @@ void MergeFunctions::replaceDirectCaller
                                           NewPAL.getRetAttributes(),
                                           NewArgAttrs));
 
-      remove(CS.getInstruction()->getParent()->getParent());
+      remove(CS.getInstruction()->getFunction());
       U->set(BitcastNew);
     }
   }
@@ -954,7 +954,7 @@ void MergeFunctions::removeUsers(Value *
 
     for (User *U : V->users()) {
       if (Instruction *I = dyn_cast<Instruction>(U)) {
-        remove(I->getParent()->getParent());
+        remove(I->getFunction());
       } else if (isa<GlobalValue>(U)) {
         // do nothing
       } else if (Constant *C = dyn_cast<Constant>(U)) {




More information about the llvm-commits mailing list