From 28c04dab38fa7205fedbc8954f08e2250e84c273 Mon Sep 17 00:00:00 2001 From: Dan Gohman Date: Wed, 5 Nov 2008 18:30:52 +0000 Subject: Use an assert to check that SelectCode isn't called on nodes that are already selected. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58763 91177308-0d34-0410-b5e6-96231b3b80d8 --- utils/TableGen/DAGISelEmitter.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'utils/TableGen') diff --git a/utils/TableGen/DAGISelEmitter.cpp b/utils/TableGen/DAGISelEmitter.cpp index 1829331..3f86d2d 100644 --- a/utils/TableGen/DAGISelEmitter.cpp +++ b/utils/TableGen/DAGISelEmitter.cpp @@ -1957,13 +1957,12 @@ void DAGISelEmitter::EmitInstructionSelector(std::ostream &OS) { OS << "// The main instruction selector code.\n" << "SDNode *SelectCode(SDValue N) {\n" - << " if (N.isMachineOpcode()) {\n" - << " return NULL; // Already selected.\n" - << " }\n\n" << " MVT::SimpleValueType NVT = N.getNode()->getValueType(0).getSimpleVT();\n" << " switch (N.getOpcode()) {\n" - << " default: break;\n" - << " case ISD::EntryToken: // These leaves remain the same.\n" + << " default:\n" + << " assert(!N.isMachineOpcode() && \"Node already selected!\");\n" + << " break;\n" + << " case ISD::EntryToken: // These nodes remain the same.\n" << " case ISD::MEMOPERAND:\n" << " case ISD::BasicBlock:\n" << " case ISD::Register:\n" -- cgit v1.1