From: Jim Grosbach Date: Fri, 18 Apr 2014 02:09:02 +0000 (+0000) Subject: iterator_range accessor for CodeGenTarget instruction list. X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=7b771af259953ed6a9ac9e3b9dbaac639d5a45c2;p=oota-llvm.git iterator_range accessor for CodeGenTarget instruction list. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206551 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/utils/TableGen/CodeGenInstruction.h b/utils/TableGen/CodeGenInstruction.h index 75afab5c693..dc39eb973b9 100644 --- a/utils/TableGen/CodeGenInstruction.h +++ b/utils/TableGen/CodeGenInstruction.h @@ -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. diff --git a/utils/TableGen/CodeGenTarget.h b/utils/TableGen/CodeGenTarget.h index d6458f41cf2..54143103dc1 100644 --- a/utils/TableGen/CodeGenTarget.h +++ b/utils/TableGen/CodeGenTarget.h @@ -171,6 +171,9 @@ public: typedef std::vector::const_iterator inst_iterator; inst_iterator inst_begin() const{return getInstructionsByEnumValue().begin();} inst_iterator inst_end() const { return getInstructionsByEnumValue().end(); } + iterator_range instructions() const { + return iterator_range(inst_begin(), inst_end()); + } /// isLittleEndianEncoding - are instruction bit patterns defined as [0..n]?