[llvm-commits] [llvm] r58763 - /llvm/trunk/utils/TableGen/DAGISelEmitter.cpp
Dan Gohman
gohman at apple.com
Wed Nov 5 10:30:53 PST 2008
Author: djg
Date: Wed Nov 5 12:30:52 2008
New Revision: 58763
URL: http://llvm.org/viewvc/llvm-project?rev=58763&view=rev
Log:
Use an assert to check that SelectCode isn't called on
nodes that are already selected.
Modified:
llvm/trunk/utils/TableGen/DAGISelEmitter.cpp
Modified: llvm/trunk/utils/TableGen/DAGISelEmitter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/DAGISelEmitter.cpp?rev=58763&r1=58762&r2=58763&view=diff
==============================================================================
--- llvm/trunk/utils/TableGen/DAGISelEmitter.cpp (original)
+++ llvm/trunk/utils/TableGen/DAGISelEmitter.cpp Wed Nov 5 12:30:52 2008
@@ -1957,13 +1957,12 @@
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"
More information about the llvm-commits
mailing list