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:
99c2335
)
[MLIR] Add ArrayAttr::empty()
author
Rahul Joshi
<jurahul@google.com>
Thu, 11 Jun 2020 00:34:02 +0000
(17:34 -0700)
committer
River Riddle
<riddleriver@gmail.com>
Thu, 11 Jun 2020 00:37:24 +0000
(17:37 -0700)
Summary: Add ArrayAttr::empty() to check for an empty ArrayAttr
Differential Revision: https://reviews.llvm.org/D81579
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
f0e8c5c
..
f9d8efd
100644
(file)
--- a/
mlir/include/mlir/IR/Attributes.h
+++ b/
mlir/include/mlir/IR/Attributes.h
@@
-213,6
+213,7
@@
public:
iterator begin() const { return getValue().begin(); }
iterator end() const { return getValue().end(); }
size_t size() const { return getValue().size(); }
+ bool empty() const { return size() == 0; }
/// Methods for support type inquiry through isa, cast, and dyn_cast.
static bool kindof(unsigned kind) {