From e55bd90bc7c849128cd14f4bc7a7706c54db4fea Mon Sep 17 00:00:00 2001 From: River Riddle Date: Wed, 30 Oct 2019 15:25:35 -0700 Subject: [PATCH] NFC: Simplify UseRange::iterator to just be a std::vector::const_iterator. At some point the implementation of UseRange was more complex, but now it is just a simple wrapper around a std::vector. PiperOrigin-RevId: 277597294 --- mlir/include/mlir/IR/SymbolTable.h | 24 ++++-------------------- 1 file changed, 4 insertions(+), 20 deletions(-) diff --git a/mlir/include/mlir/IR/SymbolTable.h b/mlir/include/mlir/IR/SymbolTable.h index 43cf0122c226..aac614c6f7c0 100644 --- a/mlir/include/mlir/IR/SymbolTable.h +++ b/mlir/include/mlir/IR/SymbolTable.h @@ -91,27 +91,11 @@ public: /// This class implements a range of SymbolRef uses. class UseRange { public: - /// This class implements an iterator over the symbol use range. - class iterator final - : public indexed_accessor_iterator { - public: - const SymbolUse *operator->() const { return &object->uses[index]; } - const SymbolUse &operator*() const { return object->uses[index]; } - - private: - iterator(const UseRange *owner, ptrdiff_t it) - : indexed_accessor_iterator(owner, it) {} - - /// Allow access to the constructor. - friend class UseRange; - }; - - /// Contruct a UseRange from a given set of uses. UseRange(std::vector &&uses) : uses(std::move(uses)) {} - iterator begin() const { return iterator(this, /*it=*/0); } - iterator end() const { return iterator(this, /*it=*/uses.size()); } + + using iterator = std::vector::const_iterator; + iterator begin() const { return uses.begin(); } + iterator end() const { return uses.end(); } private: std::vector uses;