mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-14 16:33:28 +00:00
Add iterator_range support for MachineInstr's operand and memoperand iterators.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203181 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
aa558a78b2
commit
83710e7716
@ -22,6 +22,7 @@
|
||||
#include "llvm/ADT/StringRef.h"
|
||||
#include "llvm/ADT/ilist.h"
|
||||
#include "llvm/ADT/ilist_node.h"
|
||||
#include "llvm/ADT/iterator_range.h"
|
||||
#include "llvm/CodeGen/MachineOperand.h"
|
||||
#include "llvm/IR/DebugLoc.h"
|
||||
#include "llvm/IR/InlineAsm.h"
|
||||
@ -286,11 +287,25 @@ public:
|
||||
const_mop_iterator operands_begin() const { return Operands; }
|
||||
const_mop_iterator operands_end() const { return Operands + NumOperands; }
|
||||
|
||||
inline iterator_range<mop_iterator> operands() {
|
||||
return iterator_range<mop_iterator>(operands_begin(), operands_end());
|
||||
}
|
||||
inline iterator_range<const_mop_iterator> operands() const {
|
||||
return iterator_range<const_mop_iterator>(operands_begin(), operands_end());
|
||||
}
|
||||
|
||||
/// Access to memory operands of the instruction
|
||||
mmo_iterator memoperands_begin() const { return MemRefs; }
|
||||
mmo_iterator memoperands_end() const { return MemRefs + NumMemRefs; }
|
||||
bool memoperands_empty() const { return NumMemRefs == 0; }
|
||||
|
||||
inline iterator_range<mmo_iterator> memoperands() {
|
||||
return iterator_range<mmo_iterator>(memoperands_begin(), memoperands_end());
|
||||
}
|
||||
inline iterator_range<mmo_iterator> memoperands() const {
|
||||
return iterator_range<mmo_iterator>(memoperands_begin(), memoperands_end());
|
||||
}
|
||||
|
||||
/// hasOneMemOperand - Return true if this instruction has exactly one
|
||||
/// MachineMemOperand.
|
||||
bool hasOneMemOperand() const {
|
||||
|
Loading…
x
Reference in New Issue
Block a user