summaryrefslogtreecommitdiff
path: root/include/llvm/CodeGen/MachineInstr.h
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2010-11-12 00:00:21 +0000
committerChris Lattner <sabre@nondot.org>2010-11-12 00:00:21 +0000
commitccb5c677c66aea0a86878de69d5346ef802a6505 (patch)
tree8e57d5d0981c225b241296332a2d581051a40bbf /include/llvm/CodeGen/MachineInstr.h
parente50e6bcd901ebb1cfc42fe9ca0796ae303d7f1a1 (diff)
downloadllvm-ccb5c677c66aea0a86878de69d5346ef802a6505.tar.gz
llvm-ccb5c677c66aea0a86878de69d5346ef802a6505.tar.bz2
llvm-ccb5c677c66aea0a86878de69d5346ef802a6505.tar.xz
add operand iterator apis to MachineInstr, patch by ether zhhb.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118862 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/CodeGen/MachineInstr.h')
-rw-r--r--include/llvm/CodeGen/MachineInstr.h12
1 files changed, 11 insertions, 1 deletions
diff --git a/include/llvm/CodeGen/MachineInstr.h b/include/llvm/CodeGen/MachineInstr.h
index fc84f8c953..d1f17d39db 100644
--- a/include/llvm/CodeGen/MachineInstr.h
+++ b/include/llvm/CodeGen/MachineInstr.h
@@ -167,7 +167,17 @@ public:
/// 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; }