diff options
author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2009-07-29 23:41:33 +0000 |
---|---|---|
committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2009-07-29 23:41:33 +0000 |
commit | b325146ac7f8e197b6d12aa5c11a3f0a7244e870 (patch) | |
tree | b93b84085c2ad67cc28d701d922a25858500763b /include/clang/Index/DeclReferenceMap.h | |
parent | 66570b230941651245accbc5680b60e904eb993c (diff) |
Use a STL helper template 'pair_value_iterator', by both DeclReferenceMap and SelectorMap.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77545 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/Index/DeclReferenceMap.h')
-rw-r--r-- | include/clang/Index/DeclReferenceMap.h | 39 |
1 files changed, 2 insertions, 37 deletions
diff --git a/include/clang/Index/DeclReferenceMap.h b/include/clang/Index/DeclReferenceMap.h index d1e2c09e98..1ed64369fc 100644 --- a/include/clang/Index/DeclReferenceMap.h +++ b/include/clang/Index/DeclReferenceMap.h @@ -16,6 +16,7 @@ #define LLVM_CLANG_INDEX_DECLREFERENCEMAP_H #include "clang/Index/ASTLocation.h" +#include "clang/Index/STLExtras.h" #include <map> namespace clang { @@ -32,43 +33,7 @@ public: explicit DeclReferenceMap(ASTContext &Ctx); typedef std::multimap<NamedDecl*, ASTLocation> MapTy; - - class astlocation_iterator { - MapTy::iterator I; - - astlocation_iterator(MapTy::iterator i) : I(i) { } - friend class DeclReferenceMap; - - public: - typedef ASTLocation value_type; - typedef ASTLocation& reference; - typedef ASTLocation* pointer; - typedef MapTy::iterator::iterator_category iterator_category; - typedef MapTy::iterator::difference_type difference_type; - - astlocation_iterator() { } - - reference operator*() const { return I->second; } - pointer operator->() const { return &I->second; } - - astlocation_iterator& operator++() { - ++I; - return *this; - } - - astlocation_iterator operator++(int) { - astlocation_iterator tmp(*this); - ++(*this); - return tmp; - } - - friend bool operator==(astlocation_iterator L, astlocation_iterator R) { - return L.I == R.I; - } - friend bool operator!=(astlocation_iterator L, astlocation_iterator R) { - return L.I != R.I; - } - }; + typedef pair_value_iterator<MapTy::iterator> astlocation_iterator; astlocation_iterator refs_begin(NamedDecl *D) const; astlocation_iterator refs_end(NamedDecl *D) const; |