summaryrefslogtreecommitdiff
path: root/utils/TableGen/CodeGenTarget.h
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2005-09-14 18:02:53 +0000
committerChris Lattner <sabre@nondot.org>2005-09-14 18:02:53 +0000
commita974b20cae7691361f2be5b27fbc1658855ed96c (patch)
treee5f04482994c4b333485447133a49470bcb2704d /utils/TableGen/CodeGenTarget.h
parent6e2f8431144e519d968e410d8a56bfea7c2ae5bc (diff)
downloadllvm-a974b20cae7691361f2be5b27fbc1658855ed96c.tar.gz
llvm-a974b20cae7691361f2be5b27fbc1658855ed96c.tar.bz2
llvm-a974b20cae7691361f2be5b27fbc1658855ed96c.tar.xz
add an accessor
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23349 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'utils/TableGen/CodeGenTarget.h')
-rw-r--r--utils/TableGen/CodeGenTarget.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/utils/TableGen/CodeGenTarget.h b/utils/TableGen/CodeGenTarget.h
index 1748e8ca82..aaa6c7a426 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<std::string, CodeGenInstruction> &Insts = getInstructions();
+ assert(Insts.count(Name) && "Not an instruction!");
+ return const_cast<CodeGenInstruction&>(Insts.find(Name)->second);
+ }
+
typedef std::map<std::string,
CodeGenInstruction>::const_iterator inst_iterator;
inst_iterator inst_begin() const { return getInstructions().begin(); }