aboutsummaryrefslogtreecommitdiffstats
path: root/utils/TableGen
diff options
context:
space:
mode:
authorJakob Stoklund Olesen <stoklund@2pi.dk>2009-10-15 18:50:03 +0000
committerJakob Stoklund Olesen <stoklund@2pi.dk>2009-10-15 18:50:03 +0000
commit11ee508d7bd37f2b007da735fbd2c1497ed51848 (patch)
tree3744be384bf7257f70571953564ea21df8be561d /utils/TableGen
parent0383606b657aa9770e6aee126b358afe9328ac4a (diff)
downloadexternal_llvm-11ee508d7bd37f2b007da735fbd2c1497ed51848.zip
external_llvm-11ee508d7bd37f2b007da735fbd2c1497ed51848.tar.gz
external_llvm-11ee508d7bd37f2b007da735fbd2c1497ed51848.tar.bz2
Report errors correctly for unselected target intrinsics.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84193 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'utils/TableGen')
-rw-r--r--utils/TableGen/CodeGenDAGPatterns.h2
-rw-r--r--utils/TableGen/DAGISelEmitter.cpp12
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";
}