llvm.org GIT mirror llvm / 28c04da
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 Dan Gohman 11 years ago
1 changed file(s) with 4 addition(s) and 5 deletion(s). Raw diff Collapse all Expand all
19561956
19571957 OS << "// The main instruction selector code.\n"
19581958 << "SDNode *SelectCode(SDValue N) {\n"
1959 << " if (N.isMachineOpcode()) {\n"
1960 << " return NULL; // Already selected.\n"
1961 << " }\n\n"
19621959 << " MVT::SimpleValueType NVT = N.getNode()->getValueType(0).getSimpleVT();\n"
19631960 << " switch (N.getOpcode()) {\n"
1964 << " default: break;\n"
1965 << " case ISD::EntryToken: // These leaves remain the same.\n"
1961 << " default:\n"
1962 << " assert(!N.isMachineOpcode() && \"Node already selected!\");\n"
1963 << " break;\n"
1964 << " case ISD::EntryToken: // These nodes remain the same.\n"
19661965 << " case ISD::MEMOPERAND:\n"
19671966 << " case ISD::BasicBlock:\n"
19681967 << " case ISD::Register:\n"