LLDB  mainline
DeclVendor.h
Go to the documentation of this file.
1 //===-- DeclVendor.h --------------------------------------------*- C++ -*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 
9 #ifndef liblldb_DeclVendor_h_
10 #define liblldb_DeclVendor_h_
11 
12 #include "lldb/Core/ClangForward.h"
13 #include "lldb/lldb-defines.h"
14 
15 #include "clang/AST/ExternalASTMerger.h"
16 
17 #include <vector>
18 
19 namespace lldb_private {
20 
21 // The Decl vendor class is intended as a generic interface to search for named
22 // declarations that are not necessarily backed by a specific symbol file.
23 class DeclVendor {
24 public:
25  // Constructors and Destructors
27 
28  virtual ~DeclVendor() {}
29 
30  /// Look up the set of Decls that the DeclVendor currently knows about
31  /// matching a given name.
32  ///
33  /// \param[in] name
34  /// The name to look for.
35  ///
36  /// \param[in] append
37  /// If true, FindDecls will clear "decls" when it starts.
38  ///
39  /// \param[in] max_matches
40  /// The maximum number of Decls to return. UINT32_MAX means "as
41  /// many as possible."
42  ///
43  /// \return
44  /// The number of Decls added to decls; will not exceed
45  /// max_matches.
46  virtual uint32_t FindDecls(ConstString name, bool append,
47  uint32_t max_matches,
48  std::vector<clang::NamedDecl *> &decls) = 0;
49 
50  /// Interface for ExternalASTMerger. Returns an ImporterSource
51  /// allowing type completion.
52  ///
53  /// \return
54  /// An ImporterSource for this DeclVendor.
55  virtual clang::ExternalASTMerger::ImporterSource GetImporterSource() = 0;
56 
57 private:
58  // For DeclVendor only
59  DISALLOW_COPY_AND_ASSIGN(DeclVendor);
60 };
61 
62 } // namespace lldb_private
63 
64 #endif
Enumerations for broadcasting.
Definition: SBLaunchInfo.h:14
virtual clang::ExternalASTMerger::ImporterSource GetImporterSource()=0
Interface for ExternalASTMerger.
virtual uint32_t FindDecls(ConstString name, bool append, uint32_t max_matches, std::vector< clang::NamedDecl *> &decls)=0
Look up the set of Decls that the DeclVendor currently knows about matching a given name...
A uniqued constant string class.
Definition: ConstString.h:38