aboutsummaryrefslogtreecommitdiffstats
path: root/utils/TableGen/DAGISelEmitter.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'utils/TableGen/DAGISelEmitter.cpp')
-rw-r--r--utils/TableGen/DAGISelEmitter.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/utils/TableGen/DAGISelEmitter.cpp b/utils/TableGen/DAGISelEmitter.cpp
index dcf64e4..bbb8a18 100644
--- a/utils/TableGen/DAGISelEmitter.cpp
+++ b/utils/TableGen/DAGISelEmitter.cpp
@@ -2067,8 +2067,16 @@ void DAGISelEmitter::EmitInstructionSelector(raw_ostream &OS) {
<< " errs() << \"Cannot yet select: \";\n"
<< " unsigned iid = cast<ConstantSDNode>(N.getOperand("
<< "N.getOperand(0).getValueType() == MVT::Other))->getZExtValue();\n"
- << " llvm_report_error(\"Cannot yet select: intrinsic %\" +\n"
- << "Intrinsic::getName((Intrinsic::ID)iid));\n"
+ << " if (iid < Intrinsic::num_intrinsics)\n"
+ << " llvm_report_error(\"Cannot yet select: intrinsic %\" + "
+ << "Intrinsic::getName((Intrinsic::ID)iid));\n";
+ if (CGP.hasTargetIntrinsics()) {
+ OS << " else if (const TargetIntrinsicInfo *tii = TM.getIntrinsicInfo())\n"
+ << " llvm_report_error(Twine(\"Cannot yet select: target intrinsic "
+ << "%\") + tii->getName(iid));\n";
+ }
+ OS << " else\n"
+ << " llvm_report_error(\"Cannot yet select: invalid intrinsic\");\n"
<< "}\n\n";
}