summaryrefslogtreecommitdiff
path: root/utils/TableGen/DAGISelEmitter.cpp
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2008-08-20 21:45:57 +0000
committerDan Gohman <gohman@apple.com>2008-08-20 21:45:57 +0000
commit1e0ee4bc38e9cdc7e7ac49968527e2c05f927904 (patch)
treec8bedf614fd3fd0d9c7ca157ae3bc0fc41bdb4f3 /utils/TableGen/DAGISelEmitter.cpp
parent0bfa1bfbff1ddc5a85494c9e2b1f985f145dc8a6 (diff)
downloadllvm-1e0ee4bc38e9cdc7e7ac49968527e2c05f927904.tar.gz
llvm-1e0ee4bc38e9cdc7e7ac49968527e2c05f927904.tar.bz2
llvm-1e0ee4bc38e9cdc7e7ac49968527e2c05f927904.tar.xz
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/DAGISelEmitter.cpp')
-rw-r--r--utils/TableGen/DAGISelEmitter.cpp13
1 files changed, 2 insertions, 11 deletions
diff --git a/utils/TableGen/DAGISelEmitter.cpp b/utils/TableGen/DAGISelEmitter.cpp
index 9f0f155a7f..12667d5656 100644
--- a/utils/TableGen/DAGISelEmitter.cpp
+++ b/utils/TableGen/DAGISelEmitter.cpp
@@ -1604,17 +1604,8 @@ static std::string getLegalCName(std::string OpName) {
void DAGISelEmitter::EmitInstructionSelector(std::ostream &OS) {
const CodeGenTarget &Target = CGP.getTargetInfo();
- // Get the namespace to insert instructions into. Make sure not to pick up
- // "TargetInstrInfo" by accidentally getting the namespace off the PHI
- // instruction or something.
- std::string InstNS;
- for (CodeGenTarget::inst_iterator i = Target.inst_begin(),
- e = Target.inst_end(); i != e; ++i) {
- InstNS = i->second.Namespace;
- if (InstNS != "TargetInstrInfo")
- break;
- }
-
+ // Get the namespace to insert instructions into.
+ std::string InstNS = Target.getInstNamespace();
if (!InstNS.empty()) InstNS += "::";
// Group the patterns by their top-level opcodes.