summaryrefslogtreecommitdiffstats
path: root/mlir/lib/TableGen
diff options
context:
space:
mode:
authorLei Zhang <antiagainst@google.com>2019-06-19 14:32:07 -0700
committerMehdi Amini <joker.eph@gmail.com>2019-06-19 23:08:52 -0700
commit7848505ebd83083e7fa0c47df72ace6c3a476394 (patch)
tree32b7953bf395e13c2037d4ef700742fa68530d63 /mlir/lib/TableGen
parent9552409387fe4a31e0f1f3e2ad900b5761e6bea9 (diff)
downloadbcm5719-llvm-7848505ebd83083e7fa0c47df72ace6c3a476394.tar.gz
bcm5719-llvm-7848505ebd83083e7fa0c47df72ace6c3a476394.zip
Print proper message saying variadic ops are not supported in RewriterGen
Support for ops with variadic operands/results will come later; but right now a proper message helps to avoid deciphering confusing error messages later in the compilation stage. PiperOrigin-RevId: 254071820
Diffstat (limited to 'mlir/lib/TableGen')
-rw-r--r--mlir/lib/TableGen/Operator.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/mlir/lib/TableGen/Operator.cpp b/mlir/lib/TableGen/Operator.cpp
index a5dd9c25027..7f9ebdc5191 100644
--- a/mlir/lib/TableGen/Operator.cpp
+++ b/mlir/lib/TableGen/Operator.cpp
@@ -89,6 +89,10 @@ StringRef tblgen::Operator::getExtraClassDeclaration() const {
const llvm::Record &tblgen::Operator::getDef() const { return def; }
+bool tblgen::Operator::isVariadic() const {
+ return getNumVariadicOperands() != 0 || getNumVariadicResults() != 0;
+}
+
auto tblgen::Operator::result_begin() -> value_iterator {
return results.begin();
}
OpenPOWER on IntegriCloud