diff options
Diffstat (limited to 'utils')
-rw-r--r-- | utils/TableGen/CodeGenDAGPatterns.h | 2 | ||||
-rw-r--r-- | utils/TableGen/DAGISelEmitter.cpp | 12 |
2 files changed, 12 insertions, 2 deletions
diff --git a/utils/TableGen/CodeGenDAGPatterns.h b/utils/TableGen/CodeGenDAGPatterns.h index 9b53ecc..398764b 100644 --- a/utils/TableGen/CodeGenDAGPatterns.h +++ b/utils/TableGen/CodeGenDAGPatterns.h @@ -584,6 +584,8 @@ public: return intrinsic_wo_chain_sdnode; } + bool hasTargetIntrinsics() { return !TgtIntrinsics.empty(); } + private: void ParseNodeInfo(); void ParseNodeTransforms(); 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"; } |