1 //===--- SelectorMap.h - Maps selectors to methods and messages -*- 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 // SelectorMap creates a mapping from selectors to ObjC method declarations
11 // and ObjC message expressions.
13 //===----------------------------------------------------------------------===//
15 #ifndef LLVM_CLANG_INDEX_SELECTORMAP_H
16 #define LLVM_CLANG_INDEX_SELECTORMAP_H
18 #include "clang/Index/ASTLocation.h"
19 #include "clang/Index/STLExtras.h"
20 #include "clang/Basic/IdentifierTable.h"
29 /// \brief Maps NamedDecls with the ASTLocations that reference them.
31 /// References are mapped and retrieved using the canonical decls.
34 explicit SelectorMap(ASTContext &Ctx);
36 typedef std::multimap<Selector, ObjCMethodDecl *> SelMethMapTy;
37 typedef std::multimap<Selector, ASTLocation> SelRefMapTy;
39 typedef pair_value_iterator<SelMethMapTy::iterator> method_iterator;
40 typedef pair_value_iterator<SelRefMapTy::iterator> astlocation_iterator;
42 method_iterator methods_begin(Selector Sel) const;
43 method_iterator methods_end(Selector Sel) const;
45 astlocation_iterator refs_begin(Selector Sel) const;
46 astlocation_iterator refs_end(Selector Sel) const;
49 mutable SelMethMapTy SelMethMap;
50 mutable SelRefMapTy SelRefMap;
53 } // end idx namespace
55 } // end clang namespace