Use size_t for tuple type size
authorGeoffrey Martin-Noble <gcmn@google.com>
Sat, 1 Jun 2019 00:19:24 +0000 (17:19 -0700)
committerMehdi Amini <joker.eph@gmail.com>
Sun, 2 Jun 2019 03:14:09 +0000 (20:14 -0700)
    This is more consistent with standard containers.

--

PiperOrigin-RevId: 250985851

mlir/include/mlir/IR/StandardTypes.h
mlir/lib/IR/StandardTypes.cpp

index 9c44225..e87f83c 100644 (file)
@@ -477,7 +477,7 @@ public:
   void getFlattenedTypes(SmallVectorImpl<Type> &types);
 
   /// Return the number of held types.
-  unsigned size() const;
+  size_t size() const;
 
   /// Iterate over the held elements.
   using iterator = ArrayRef<Type>::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];
   }
index 965d67e..df85f90 100644 (file)
@@ -404,4 +404,4 @@ void TupleType::getFlattenedTypes(SmallVectorImpl<Type> &types) {
 }
 
 /// Return the number of element types.
-unsigned TupleType::size() const { return getImpl()->size(); }
+size_t TupleType::size() const { return getImpl()->size(); }