From b29a2b0c4c69971a179652cb262e970fde5fc9ed Mon Sep 17 00:00:00 2001 From: David Blaikie Date: Sat, 5 Apr 2014 22:42:04 +0000 Subject: MachineInstr: introduce explicit_operands and implicit_operands ranges Makes iteration over implicit and explicit machine operands more explicit (har har). Insipired by code review discussion for r205565. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205680 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/CodeGen/MachineInstr.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'include/llvm') diff --git a/include/llvm/CodeGen/MachineInstr.h b/include/llvm/CodeGen/MachineInstr.h index 440d3a1302..217d2b1666 100644 --- a/include/llvm/CodeGen/MachineInstr.h +++ b/include/llvm/CodeGen/MachineInstr.h @@ -293,6 +293,22 @@ public: iterator_range operands() const { return iterator_range(operands_begin(), operands_end()); } + iterator_range explicit_operands() { + return iterator_range( + operands_begin(), operands_begin() + getNumExplicitOperands()); + } + iterator_range explicit_operands() const { + return iterator_range( + operands_begin(), operands_begin() + getNumExplicitOperands()); + } + iterator_range implicit_operands() { + return iterator_range(explicit_operands().end(), + operands_end()); + } + iterator_range implicit_operands() const { + return iterator_range(explicit_operands().end(), + operands_end()); + } /// Access to memory operands of the instruction mmo_iterator memoperands_begin() const { return MemRefs; } -- cgit v1.2.3