[PATCH] D56854: [Support] Implement llvm::Registry::iterator via llvm_iterator_facade
Phabricator via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Jan 18 09:37:25 PST 2019
This revision was automatically updated to reflect the committed changes.
Closed by commit rL351566: [Support] Implement llvm::Registry::iterator via llvm_iterator_facade (authored by ibiryukov, committed by ).
Changed prior to commit:
https://reviews.llvm.org/D56854?vs=182540&id=182542#toc
Repository:
rL LLVM
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D56854/new/
https://reviews.llvm.org/D56854
Files:
llvm/trunk/include/llvm/Support/Registry.h
Index: llvm/trunk/include/llvm/Support/Registry.h
===================================================================
--- llvm/trunk/include/llvm/Support/Registry.h
+++ llvm/trunk/include/llvm/Support/Registry.h
@@ -81,17 +81,17 @@
/// Iterators for registry entries.
///
- class iterator {
+ class iterator
+ : public llvm::iterator_facade_base<iterator, std::forward_iterator_tag,
+ const entry> {
const node *Cur;
public:
explicit iterator(const node *N) : Cur(N) {}
bool operator==(const iterator &That) const { return Cur == That.Cur; }
- bool operator!=(const iterator &That) const { return Cur != That.Cur; }
iterator &operator++() { Cur = Cur->Next; return *this; }
const entry &operator*() const { return Cur->Val; }
- const entry *operator->() const { return &Cur->Val; }
};
// begin is not defined here in order to avoid usage of an undefined static
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D56854.182542.patch
Type: text/x-patch
Size: 995 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190118/d7f85511/attachment.bin>
More information about the llvm-commits
mailing list