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
This commit is contained in:
Rui Ueyama 2015-03-04 02:05:06 +00:00
parent 5a04a316a0
commit 2701736388

View File

@ -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<symbol_iterator> symbols() const {
return iterator_range<symbol_iterator>(symbol_begin(), symbol_end());
}
// Cast methods.
static inline bool classof(Binary const *v) {