[llvm-commits] [llvm] r118862 - /llvm/trunk/include/llvm/CodeGen/MachineInstr.h

Chris Lattner sabre at nondot.org
Thu Nov 11 16:00:21 PST 2010


Author: lattner
Date: Thu Nov 11 18:00:21 2010
New Revision: 118862

URL: http://llvm.org/viewvc/llvm-project?rev=118862&view=rev
Log:
add operand iterator apis to MachineInstr, patch by ether zhhb.


Modified:
    llvm/trunk/include/llvm/CodeGen/MachineInstr.h

Modified: llvm/trunk/include/llvm/CodeGen/MachineInstr.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/MachineInstr.h?rev=118862&r1=118861&r2=118862&view=diff
==============================================================================
--- llvm/trunk/include/llvm/CodeGen/MachineInstr.h (original)
+++ llvm/trunk/include/llvm/CodeGen/MachineInstr.h Thu Nov 11 18:00:21 2010
@@ -167,7 +167,17 @@
   /// getNumExplicitOperands - Returns the number of non-implicit operands.
   ///
   unsigned getNumExplicitOperands() const;
-  
+
+  /// iterator/begin/end - Iterate over all operands of a machine instruction.
+  typedef std::vector<MachineOperand>::iterator mop_iterator;
+  typedef std::vector<MachineOperand>::const_iterator const_mop_iterator;
+
+  mop_iterator operands_begin() { return Operands.begin(); }
+  mop_iterator operands_end() { return Operands.end(); }
+
+  const_mop_iterator operands_begin() const { return Operands.begin(); }
+  const_mop_iterator operands_end() const { return Operands.end(); }
+
   /// Access to memory operands of the instruction
   mmo_iterator memoperands_begin() const { return MemRefs; }
   mmo_iterator memoperands_end() const { return MemRefsEnd; }





More information about the llvm-commits mailing list