[llvm] r332559 - [CodeGen] Use MachineInstr::getOperand(0) instead of gets the defs iterator_range and calling begin. NFC

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Wed May 16 16:39:28 PDT 2018


Author: ctopper
Date: Wed May 16 16:39:27 2018
New Revision: 332559

URL: http://llvm.org/viewvc/llvm-project?rev=332559&view=rev
Log:
[CodeGen] Use MachineInstr::getOperand(0) instead of gets the defs iterator_range and calling begin. NFC

Defs are well defined to come first in MachineInstr operand list. No need for a more complex indirection.

Modified:
    llvm/trunk/lib/CodeGen/ImplicitNullChecks.cpp

Modified: llvm/trunk/lib/CodeGen/ImplicitNullChecks.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/ImplicitNullChecks.cpp?rev=332559&r1=332558&r2=332559&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/ImplicitNullChecks.cpp (original)
+++ llvm/trunk/lib/CodeGen/ImplicitNullChecks.cpp Wed May 16 16:39:27 2018
@@ -596,7 +596,7 @@ MachineInstr *ImplicitNullChecks::insert
 
   unsigned DefReg = NoRegister;
   if (NumDefs != 0) {
-    DefReg = MI->defs().begin()->getReg();
+    DefReg = MI->getOperand(0).getReg();
     assert(NumDefs == 1 && "expected exactly one def!");
   }
 




More information about the llvm-commits mailing list