From: Rahul Joshi Date: Thu, 11 Jun 2020 00:34:02 +0000 (-0700) Subject: [MLIR] Add ArrayAttr::empty() X-Git-Tag: llvmorg-12-init~3421 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=685d7ee61408c10f8b43ecec902d56bf565feed0;p=platform%2Fupstream%2Fllvm.git [MLIR] Add ArrayAttr::empty() Summary: Add ArrayAttr::empty() to check for an empty ArrayAttr Differential Revision: https://reviews.llvm.org/D81579 --- diff --git a/mlir/include/mlir/IR/Attributes.h b/mlir/include/mlir/IR/Attributes.h index f0e8c5c..f9d8efd 100644 --- 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) {