]> granicus.if.org Git - llvm/commitdiff
[MergeFunc] Use Instruction::getFunction as a cleanup, NFC
authorVedant Kumar <vsk@apple.com>
Fri, 11 Jan 2019 17:56:21 +0000 (17:56 +0000)
committerVedant Kumar <vsk@apple.com>
Fri, 11 Jan 2019 17:56:21 +0000 (17:56 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@350938 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/IPO/MergeFunctions.cpp

index 550750d17438cfb408f0c5d1ccb7b123ab9bfb89..30fe9bbbe613619ca907644ae8a2af603f4af593 100644 (file)
@@ -474,7 +474,7 @@ void MergeFunctions::replaceDirectCallers(Function *Old, Function *New) {
                                           NewPAL.getRetAttributes(),
                                           NewArgAttrs));
 
-      remove(CS.getInstruction()->getParent()->getParent());
+      remove(CS.getInstruction()->getFunction());
       U->set(BitcastNew);
     }
   }
@@ -954,7 +954,7 @@ void MergeFunctions::removeUsers(Value *V) {
 
     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)) {