xref: /freebsd-src/contrib/llvm-project/lldb/source/Plugins/ExpressionParser/Clang/ClangDeclVendor.h (revision 9dba64be9536c28e4800e06512b7f29b43ade345)
1 //===-- ClangDeclVendor.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_ClangDeclVendor_h_
10 #define liblldb_ClangDeclVendor_h_
11 
12 #include "lldb/Core/ClangForward.h"
13 #include "lldb/Symbol/DeclVendor.h"
14 
15 #include "clang/AST/ExternalASTMerger.h"
16 
17 namespace lldb_private {
18 
19 // A clang specialized extension to DeclVendor.
20 class ClangDeclVendor : public DeclVendor {
21 public:
22   ClangDeclVendor(DeclVendorKind kind) : DeclVendor(kind) {}
23 
24   virtual ~ClangDeclVendor() {}
25 
26   /// Interface for ExternalASTMerger. Returns an ImporterSource allowing type
27   /// completion.
28   ///
29   /// \return
30   ///     An ImporterSource for this ClangDeclVendor.
31   virtual clang::ExternalASTMerger::ImporterSource GetImporterSource() = 0;
32 
33   uint32_t FindDecls(ConstString name, bool append, uint32_t max_matches,
34                      std::vector<CompilerDecl> &decls) override;
35 
36   virtual uint32_t FindDecls(ConstString name, bool append,
37                              uint32_t max_matches,
38                              std::vector<clang::NamedDecl *> &decls) = 0;
39 
40   static bool classof(const DeclVendor *vendor) {
41     return vendor->GetKind() >= eClangDeclVendor &&
42            vendor->GetKind() < eLastClangDeclVendor;
43   }
44 
45 private:
46   DISALLOW_COPY_AND_ASSIGN(ClangDeclVendor);
47 };
48 } // namespace lldb_private
49 
50 #endif
51