Duraid pointed out that it is impolite to emit PPC:: into the IA64 backend
authorChris Lattner <sabre@nondot.org>
Tue, 18 Oct 2005 04:41:01 +0000 (04:41 +0000)
committerChris Lattner <sabre@nondot.org>
Tue, 18 Oct 2005 04:41:01 +0000 (04:41 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23780 91177308-0d34-0410-b5e6-96231b3b80d8

utils/TableGen/DAGISelEmitter.cpp

index 08af66a64a6af220ec7e254e58f8a411414f8d2f..46e298b6de2eabf512f86d29fdf66c2613b93715 100644 (file)
@@ -1762,11 +1762,15 @@ namespace {
 }
 
 void DAGISelEmitter::EmitInstructionSelector(std::ostream &OS) {
+  std::string InstNS = Target.inst_begin()->second.Namespace;
+  if (!InstNS.empty()) InstNS += "::";
+  
   // Emit boilerplate.
   OS << "// The main instruction selector code.\n"
      << "SDOperand SelectCode(SDOperand N) {\n"
      << "  if (N.getOpcode() >= ISD::BUILTIN_OP_END &&\n"
-     << "      N.getOpcode() < PPCISD::FIRST_NUMBER)\n"
+     << "      N.getOpcode() < (ISD::BUILTIN_OP_END+" << InstNS
+     << "INSTRUCTION_LIST_END))\n"
      << "    return N;   // Already selected.\n\n"
      << "  if (!N.Val->hasOneUse()) {\n"
   << "    std::map<SDOperand, SDOperand>::iterator CGMI = CodeGenMap.find(N);\n"