From a974b20cae7691361f2be5b27fbc1658855ed96c Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Wed, 14 Sep 2005 18:02:53 +0000 Subject: [PATCH] add an accessor git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23349 91177308-0d34-0410-b5e6-96231b3b80d8 --- utils/TableGen/CodeGenTarget.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/utils/TableGen/CodeGenTarget.h b/utils/TableGen/CodeGenTarget.h index 1748e8ca828..aaa6c7a426f 100644 --- a/utils/TableGen/CodeGenTarget.h +++ b/utils/TableGen/CodeGenTarget.h @@ -103,6 +103,12 @@ public: return Instructions; } + CodeGenInstruction &getInstruction(const std::string &Name) const { + const std::map &Insts = getInstructions(); + assert(Insts.count(Name) && "Not an instruction!"); + return const_cast(Insts.find(Name)->second); + } + typedef std::map::const_iterator inst_iterator; inst_iterator inst_begin() const { return getInstructions().begin(); }