From: Chris Lattner Date: Wed, 14 Sep 2005 18:02:53 +0000 (+0000) Subject: add an accessor X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=a974b20cae7691361f2be5b27fbc1658855ed96c;p=oota-llvm.git add an accessor git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23349 91177308-0d34-0410-b5e6-96231b3b80d8 --- 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(); }