From: Rui Ueyama Date: Wed, 4 Mar 2015 02:05:06 +0000 (+0000) Subject: Object: Add range iterators to Archive symbols X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=2701736388494b8d35ddf024dbb5842e99061cda;p=oota-llvm.git Object: Add range iterators to Archive symbols Also define operator* for symbol iterator just like Archive children iterator. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231203 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/llvm/Object/Archive.h b/include/llvm/Object/Archive.h index 4f8e28172c8..d40dc9db9f5 100644 --- a/include/llvm/Object/Archive.h +++ b/include/llvm/Object/Archive.h @@ -155,9 +155,8 @@ public: Symbol symbol; public: symbol_iterator(const Symbol &s) : symbol(s) {} - const Symbol *operator->() const { - return &symbol; - } + const Symbol *operator->() const { return &symbol; } + const Symbol &operator*() const { return symbol; } bool operator==(const symbol_iterator &other) const { return symbol == other.symbol; @@ -194,6 +193,9 @@ public: symbol_iterator symbol_begin() const; symbol_iterator symbol_end() const; + iterator_range symbols() const { + return iterator_range(symbol_begin(), symbol_end()); + } // Cast methods. static inline bool classof(Binary const *v) {