Add an extra operand to LABEL nodes which distinguishes between debug, EH, or misc labels. This fixes the EH breakage. However I am not convinced this is *the* solution.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46609 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/utils/TableGen/DAGISelEmitter.cpp b/utils/TableGen/DAGISelEmitter.cpp
index 1f568ad..05c27c4 100644
--- a/utils/TableGen/DAGISelEmitter.cpp
+++ b/utils/TableGen/DAGISelEmitter.cpp
@@ -1795,12 +1795,15 @@
   OS << "SDNode *Select_LABEL(const SDOperand &N) {\n"
      << "  SDOperand Chain = N.getOperand(0);\n"
      << "  SDOperand N1 = N.getOperand(1);\n"
-     << "  unsigned C = cast<ConstantSDNode>(N1)->getValue();\n"
-     << "  SDOperand Tmp = CurDAG->getTargetConstant(C, MVT::i32);\n"
+     << "  SDOperand N2 = N.getOperand(2);\n"
+     << "  unsigned C1 = cast<ConstantSDNode>(N1)->getValue();\n"
+     << "  unsigned C2 = cast<ConstantSDNode>(N2)->getValue();\n"
+     << "  SDOperand Tmp1 = CurDAG->getTargetConstant(C1, MVT::i32);\n"
+     << "  SDOperand Tmp2 = CurDAG->getTargetConstant(C2, MVT::i32);\n"
      << "  AddToISelQueue(Chain);\n"
-     << "  SDOperand Ops[] = { Tmp, Chain };\n"
+     << "  SDOperand Ops[] = { Tmp1, Tmp2, Chain };\n"
      << "  return CurDAG->getTargetNode(TargetInstrInfo::LABEL,\n"
-     << "                               MVT::Other, Ops, 2);\n"
+     << "                               MVT::Other, Ops, 3);\n"
      << "}\n\n";
 
   OS << "SDNode *Select_EXTRACT_SUBREG(const SDOperand &N) {\n"