]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/llvm/tools/lldb/include/lldb/Symbol/DeclVendor.h
MFV r333668:
[FreeBSD/FreeBSD.git] / contrib / llvm / tools / lldb / include / lldb / Symbol / DeclVendor.h
1 //===-- DeclVendor.h --------------------------------------------*- C++ -*-===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9
10 #ifndef liblldb_DeclVendor_h_
11 #define liblldb_DeclVendor_h_
12
13 #include "lldb/Core/ClangForward.h"
14 #include "lldb/lldb-defines.h"
15
16 #include "clang/AST/ExternalASTMerger.h"
17
18 #include <vector>
19
20 namespace lldb_private {
21
22 //----------------------------------------------------------------------
23 // The Decl vendor class is intended as a generic interface to search
24 // for named declarations that are not necessarily backed by a specific
25 // symbol file.
26 //----------------------------------------------------------------------
27 class DeclVendor {
28 public:
29   //------------------------------------------------------------------
30   // Constructors and Destructors
31   //------------------------------------------------------------------
32   DeclVendor() {}
33
34   virtual ~DeclVendor() {}
35
36   //------------------------------------------------------------------
37   /// Look up the set of Decls that the DeclVendor currently knows about
38   /// matching a given name.
39   ///
40   /// @param[in] name
41   ///     The name to look for.
42   ///
43   /// @param[in] append
44   ///     If true, FindDecls will clear "decls" when it starts.
45   ///
46   /// @param[in] max_matches
47   ///     The maximum number of Decls to return.  UINT32_MAX means "as
48   ///     many as possible."
49   ///
50   /// @return
51   ///     The number of Decls added to decls; will not exceed
52   ///     max_matches.
53   //------------------------------------------------------------------
54   virtual uint32_t FindDecls(const ConstString &name, bool append,
55                              uint32_t max_matches,
56                              std::vector<clang::NamedDecl *> &decls) = 0;
57
58   //------------------------------------------------------------------
59   /// Interface for ExternalASTMerger.  Returns an ImporterSource 
60   /// allowing type completion.
61   ///
62   /// @return
63   ///     An ImporterSource for this DeclVendor.
64   //------------------------------------------------------------------
65   virtual clang::ExternalASTMerger::ImporterSource GetImporterSource() = 0;
66
67 private:
68   //------------------------------------------------------------------
69   // For DeclVendor only
70   //------------------------------------------------------------------
71   DISALLOW_COPY_AND_ASSIGN(DeclVendor);
72 };
73
74 } // namespace lldb_private
75
76 #endif