[llvm] r206551 - iterator_range accessor for CodeGenTarget instruction list.

Jim Grosbach grosbach at apple.com
Thu Apr 17 19:09:03 PDT 2014


Author: grosbach
Date: Thu Apr 17 21:09:02 2014
New Revision: 206551

URL: http://llvm.org/viewvc/llvm-project?rev=206551&view=rev
Log:
iterator_range accessor for CodeGenTarget instruction list.

Modified:
    llvm/trunk/utils/TableGen/CodeGenInstruction.h
    llvm/trunk/utils/TableGen/CodeGenTarget.h

Modified: llvm/trunk/utils/TableGen/CodeGenInstruction.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/CodeGenInstruction.h?rev=206551&r1=206550&r2=206551&view=diff
==============================================================================
--- llvm/trunk/utils/TableGen/CodeGenInstruction.h (original)
+++ llvm/trunk/utils/TableGen/CodeGenInstruction.h Thu Apr 17 21:09:02 2014
@@ -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.

Modified: llvm/trunk/utils/TableGen/CodeGenTarget.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/CodeGenTarget.h?rev=206551&r1=206550&r2=206551&view=diff
==============================================================================
--- llvm/trunk/utils/TableGen/CodeGenTarget.h (original)
+++ llvm/trunk/utils/TableGen/CodeGenTarget.h Thu Apr 17 21:09:02 2014
@@ -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]?





More information about the llvm-commits mailing list