diff options
author | Dan Gohman <gohman@apple.com> | 2008-08-20 21:45:57 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2008-08-20 21:45:57 +0000 |
commit | 1e0ee4bc38e9cdc7e7ac49968527e2c05f927904 (patch) | |
tree | c8bedf614fd3fd0d9c7ca157ae3bc0fc41bdb4f3 /utils/TableGen/CodeGenTarget.cpp | |
parent | 0bfa1bfbff1ddc5a85494c9e2b1f985f145dc8a6 (diff) |
Factor the code for determining the target-specific instruction
namespace out of the isel emitters and into common code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55079 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'utils/TableGen/CodeGenTarget.cpp')
-rw-r--r-- | utils/TableGen/CodeGenTarget.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/utils/TableGen/CodeGenTarget.cpp b/utils/TableGen/CodeGenTarget.cpp index d9f4c3e341..4e7a10c1d8 100644 --- a/utils/TableGen/CodeGenTarget.cpp +++ b/utils/TableGen/CodeGenTarget.cpp @@ -135,6 +135,21 @@ const std::string &CodeGenTarget::getName() const { return TargetRec->getName(); } +std::string CodeGenTarget::getInstNamespace() const { + std::string InstNS; + + for (inst_iterator i = inst_begin(), e = inst_end(); i != e; ++i) { + InstNS = i->second.Namespace; + + // Make sure not to pick up "TargetInstrInfo" by accidentally getting + // the namespace off the PHI instruction or something. + if (InstNS != "TargetInstrInfo") + break; + } + + return InstNS; +} + Record *CodeGenTarget::getInstructionSet() const { return TargetRec->getValueAsDef("InstructionSet"); } |