summaryrefslogtreecommitdiffstats
path: root/mlir/lib/TableGen
diff options
context:
space:
mode:
authorLei Zhang <antiagainst@google.com>2019-10-21 20:47:49 -0700
committerA. Unique TensorFlower <gardener@tensorflow.org>2019-10-21 20:48:17 -0700
commit020f9eb68c8808c096228e20a40e5a217f4d2aab (patch)
treec9d7ba1fbfbdd2023d965f3cd07f30b570fa17ec /mlir/lib/TableGen
parentd9fe892e4228909908cf9b0f6dd80d9b56c060b4 (diff)
downloadbcm5719-llvm-020f9eb68c8808c096228e20a40e5a217f4d2aab.tar.gz
bcm5719-llvm-020f9eb68c8808c096228e20a40e5a217f4d2aab.zip
[DRR] Allow interleaved operands and attributes
Previously DRR assumes attributes to appear after operands. This was the previous requirements on ODS, but that has changed some time ago. Fix DRR to also support interleaved operands and attributes. PiperOrigin-RevId: 275983485
Diffstat (limited to 'mlir/lib/TableGen')
-rw-r--r--mlir/lib/TableGen/Operator.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/mlir/lib/TableGen/Operator.cpp b/mlir/lib/TableGen/Operator.cpp
index 60fecf7cdde..7d926d98b5c 100644
--- a/mlir/lib/TableGen/Operator.cpp
+++ b/mlir/lib/TableGen/Operator.cpp
@@ -126,6 +126,18 @@ unsigned tblgen::Operator::getNumVariadicOperands() const {
[](const NamedTypeConstraint &c) { return c.constraint.isVariadic(); });
}
+tblgen::Operator::arg_iterator tblgen::Operator::arg_begin() const {
+ return arguments.begin();
+}
+
+tblgen::Operator::arg_iterator tblgen::Operator::arg_end() const {
+ return arguments.end();
+}
+
+tblgen::Operator::arg_range tblgen::Operator::getArgs() const {
+ return {arg_begin(), arg_end()};
+}
+
StringRef tblgen::Operator::getArgName(int index) const {
DagInit *argumentValues = def.getValueAsDag("arguments");
return argumentValues->getArgName(index)->getValue();
OpenPOWER on IntegriCloud