Fix CodeGen/PowerPC/2007-05-14-InlineAsmSelectCrash.ll, the other recent
authorChris Lattner <sabre@nondot.org>
Tue, 15 May 2007 01:36:44 +0000 (01:36 +0000)
committerChris Lattner <sabre@nondot.org>
Tue, 15 May 2007 01:36:44 +0000 (01:36 +0000)
patches are also needed.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37070 91177308-0d34-0410-b5e6-96231b3b80d8

utils/TableGen/DAGISelEmitter.cpp

index 1926359c43fab9a053d95f5be29543b158042ebc..2493536214f191c2c6ed7622372ba02df4282c5a 100644 (file)
@@ -3685,11 +3685,12 @@ void DAGISelEmitter::EmitInstructionSelector(std::ostream &OS) {
   // Emit boilerplate.
   OS << "SDNode *Select_INLINEASM(SDOperand N) {\n"
      << "  std::vector<SDOperand> Ops(N.Val->op_begin(), N.Val->op_end());\n"
-     << "  AddToISelQueue(N.getOperand(0)); // Select the chain.\n\n"
-     << "  // Select the flag operand.\n"
-     << "  if (Ops.back().getValueType() == MVT::Flag)\n"
-     << "    AddToISelQueue(Ops.back());\n"
-     << "  SelectInlineAsmMemoryOperands(Ops, *CurDAG);\n"
+     << "  SelectInlineAsmMemoryOperands(Ops, *CurDAG);\n\n"
+    
+     << "  // Ensure that the asm operands are themselves selected.\n"
+     << "  for (unsigned j = 0, e = Ops.size(); j != e; ++j)\n"
+     << "    AddToISelQueue(Ops[j]);\n\n"
+    
      << "  std::vector<MVT::ValueType> VTs;\n"
      << "  VTs.push_back(MVT::Other);\n"
      << "  VTs.push_back(MVT::Flag);\n"
@@ -3725,6 +3726,7 @@ void DAGISelEmitter::EmitInstructionSelector(std::ostream &OS) {
      << "  case ISD::TargetConstant:\n"
      << "  case ISD::TargetConstantPool:\n"
      << "  case ISD::TargetFrameIndex:\n"
+     << "  case ISD::TargetExternalSymbol:\n"
      << "  case ISD::TargetJumpTable:\n"
      << "  case ISD::TargetGlobalTLSAddress:\n"
      << "  case ISD::TargetGlobalAddress: {\n"