iterator_range accessor for CodeGenTarget instruction list.
authorJim Grosbach <grosbach@apple.com>
Fri, 18 Apr 2014 02:09:02 +0000 (02:09 +0000)
committerJim Grosbach <grosbach@apple.com>
Fri, 18 Apr 2014 02:09:02 +0000 (02:09 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206551 91177308-0d34-0410-b5e6-96231b3b80d8

utils/TableGen/CodeGenInstruction.h
utils/TableGen/CodeGenTarget.h

index 75afab5c693fbf150b3c14b6edbd6d7d779e3e38..dc39eb973b9220534d435275f0fb9d845cda5978 100644 (file)
@@ -156,7 +156,6 @@ namespace llvm {
     iterator end() { return OperandList.end(); }
     const_iterator end() const { return OperandList.end(); }
 
-
     /// getOperandNamed - Return the index of the operand with the specified
     /// non-empty name.  If the instruction does not have an operand with the
     /// specified name, abort.
index d6458f41cf23bf8d35974cbd34c9e05952a520e1..54143103dc1849278280143083be7390a83704d6 100644 (file)
@@ -171,6 +171,9 @@ public:
   typedef std::vector<const CodeGenInstruction*>::const_iterator inst_iterator;
   inst_iterator inst_begin() const{return getInstructionsByEnumValue().begin();}
   inst_iterator inst_end() const { return getInstructionsByEnumValue().end(); }
+  iterator_range<inst_iterator> instructions() const {
+    return iterator_range<inst_iterator>(inst_begin(), inst_end());
+  }
 
 
   /// isLittleEndianEncoding - are instruction bit patterns defined as  [0..n]?