1 //===-- DeclVendor.h --------------------------------------------*- C++ -*-===//
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
7 //===----------------------------------------------------------------------===//
9 #ifndef liblldb_DeclVendor_h_
10 #define liblldb_DeclVendor_h_
12 #include "lldb/Core/ClangForward.h"
13 #include "lldb/lldb-defines.h"
15 #include "clang/AST/ExternalASTMerger.h"
19 namespace lldb_private {
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.
25 // Constructors and Destructors
28 virtual ~DeclVendor() {}
30 /// Look up the set of Decls that the DeclVendor currently knows about
31 /// matching a given name.
34 /// The name to look for.
37 /// If true, FindDecls will clear "decls" when it starts.
39 /// \param[in] max_matches
40 /// The maximum number of Decls to return. UINT32_MAX means "as
41 /// many as possible."
44 /// The number of Decls added to decls; will not exceed
46 virtual uint32_t FindDecls(ConstString name, bool append,
48 std::vector<clang::NamedDecl *> &decls) = 0;
50 /// Look up the types that the DeclVendor currently knows about matching a
54 /// The name to look for.
56 /// \param[in] max_matches
57 // The maximum number of matches. UINT32_MAX means "as many as possible".
60 /// The vector of CompilerTypes that was found.
61 std::vector<CompilerType> FindTypes(ConstString name, uint32_t max_matches);
63 /// Interface for ExternalASTMerger. Returns an ImporterSource
64 /// allowing type completion.
67 /// An ImporterSource for this DeclVendor.
68 virtual clang::ExternalASTMerger::ImporterSource GetImporterSource() = 0;
71 // For DeclVendor only
72 DISALLOW_COPY_AND_ASSIGN(DeclVendor);
75 } // namespace lldb_private