projects
/
platform
/
upstream
/
llvm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
43a8fff
)
Add iterators and size() helper method in ArrayAttr
author
Lei Zhang
<antiagainst@google.com>
Tue, 20 Nov 2018 23:00:51 +0000
(15:00 -0800)
committer
jpienaar
<jpienaar@google.com>
Fri, 29 Mar 2019 21:05:05 +0000
(14:05 -0700)
PiperOrigin-RevId:
222312276
mlir/include/mlir/IR/Attributes.h
patch
|
blob
|
history
diff --git
a/mlir/include/mlir/IR/Attributes.h
b/mlir/include/mlir/IR/Attributes.h
index dabcdb494f348d7f34e122da40feee99dcc1a303..3aa020f4af8b17c2cf3efd8f2c61e6f4bccd96fe 100644
(file)
--- a/
mlir/include/mlir/IR/Attributes.h
+++ b/
mlir/include/mlir/IR/Attributes.h
@@
-222,6
+222,12
@@
public:
ArrayRef<Attribute> getValue() const;
+ size_t size() const { return getValue().size(); }
+
+ using iterator = llvm::ArrayRef<Attribute>::iterator;
+ iterator begin() const { return getValue().begin(); }
+ iterator end() const { return getValue().end(); }
+
/// Methods for support type inquiry through isa, cast, and dyn_cast.
static bool kindof(Kind kind) { return kind == Kind::Array; }
};