From 685d7ee61408c10f8b43ecec902d56bf565feed0 Mon Sep 17 00:00:00 2001 From: Rahul Joshi Date: Wed, 10 Jun 2020 17:34:02 -0700 Subject: [PATCH] [MLIR] Add ArrayAttr::empty() Summary: Add ArrayAttr::empty() to check for an empty ArrayAttr Differential Revision: https://reviews.llvm.org/D81579 --- mlir/include/mlir/IR/Attributes.h | 1 + 1 file changed, 1 insertion(+) 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) { -- 2.7.4