From 8c4ae76b274c896cc00f98a433f5f97718ea033e Mon Sep 17 00:00:00 2001 From: Geoffrey Martin-Noble Date: Fri, 31 May 2019 17:19:24 -0700 Subject: [PATCH] Use size_t for tuple type size This is more consistent with standard containers. -- PiperOrigin-RevId: 250985851 --- mlir/include/mlir/IR/StandardTypes.h | 4 ++-- mlir/lib/IR/StandardTypes.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/mlir/include/mlir/IR/StandardTypes.h b/mlir/include/mlir/IR/StandardTypes.h index 9c44225..e87f83c 100644 --- a/mlir/include/mlir/IR/StandardTypes.h +++ b/mlir/include/mlir/IR/StandardTypes.h @@ -477,7 +477,7 @@ public: void getFlattenedTypes(SmallVectorImpl &types); /// Return the number of held types. - unsigned size() const; + size_t size() const; /// Iterate over the held elements. using iterator = ArrayRef::iterator; @@ -485,7 +485,7 @@ public: iterator end() const { return getTypes().end(); } /// Return the element type at index 'index'. - Type getType(unsigned index) const { + Type getType(size_t index) const { assert(index < size() && "invalid index for tuple type"); return getTypes()[index]; } diff --git a/mlir/lib/IR/StandardTypes.cpp b/mlir/lib/IR/StandardTypes.cpp index 965d67e..df85f90 100644 --- a/mlir/lib/IR/StandardTypes.cpp +++ b/mlir/lib/IR/StandardTypes.cpp @@ -404,4 +404,4 @@ void TupleType::getFlattenedTypes(SmallVectorImpl &types) { } /// Return the number of element types. -unsigned TupleType::size() const { return getImpl()->size(); } +size_t TupleType::size() const { return getImpl()->size(); } -- 2.7.4