From 2cafa0233a7e9fcb5a2d7b05f607409c7fca8224 Mon Sep 17 00:00:00 2001 From: "Duncan P. N. Exon Smith" Date: Fri, 1 Jul 2016 15:13:09 +0000 Subject: [PATCH] CodeGen: Avoid iterator conversion in UnreachableBlockElim, NFC Avoid an unnecessary (and implicit) iterator to pointer conversion in UnreachableBlockElim by using the post-increment operator. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274355 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/UnreachableBlockElim.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lib/CodeGen/UnreachableBlockElim.cpp b/lib/CodeGen/UnreachableBlockElim.cpp index 8c9631e435b..39aa1e4919a 100644 --- a/lib/CodeGen/UnreachableBlockElim.cpp +++ b/lib/CodeGen/UnreachableBlockElim.cpp @@ -184,9 +184,7 @@ bool UnreachableMachineBlockElim::runOnMachineFunction(MachineFunction &F) { unsigned Input = phi->getOperand(1).getReg(); unsigned Output = phi->getOperand(0).getReg(); - MachineInstr* temp = phi; - ++phi; - temp->eraseFromParent(); + phi++->eraseFromParent(); ModifiedPHI = true; if (Input != Output) {