1 //===--- DeclReferenceMap.h - Map Decls to their references -----*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // DeclReferenceMap creates a mapping from Decls to the ASTLocations that
13 //===----------------------------------------------------------------------===//
15 #ifndef LLVM_CLANG_INDEX_DECLREFERENCEMAP_H
16 #define LLVM_CLANG_INDEX_DECLREFERENCEMAP_H
18 #include "clang/Index/ASTLocation.h"
19 #include "clang/Index/STLExtras.h"
28 /// \brief Maps NamedDecls with the ASTLocations that reference them.
30 /// References are mapped and retrieved using the canonical decls.
31 class DeclReferenceMap {
33 explicit DeclReferenceMap(ASTContext &Ctx);
35 typedef std::multimap<NamedDecl*, ASTLocation> MapTy;
36 typedef pair_value_iterator<MapTy::iterator> astlocation_iterator;
38 astlocation_iterator refs_begin(NamedDecl *D) const;
39 astlocation_iterator refs_end(NamedDecl *D) const;
40 bool refs_empty(NamedDecl *D) const;
46 } // end idx namespace
48 } // end clang namespace