1//===-- AppleObjCDeclVendor.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_AppleObjCDeclVendor_h_
10#define liblldb_AppleObjCDeclVendor_h_
11
12#include "lldb/Symbol/ClangASTContext.h"
13#include "lldb/lldb-private.h"
14
15#include "Plugins/ExpressionParser/Clang/ClangDeclVendor.h"
16#include "Plugins/LanguageRuntime/ObjC/ObjCLanguageRuntime.h"
17
18namespace lldb_private {
19
20class AppleObjCExternalASTSource;
21
22class AppleObjCDeclVendor : public ClangDeclVendor {
23public:
24  AppleObjCDeclVendor(ObjCLanguageRuntime &runtime);
25
26  static bool classof(const DeclVendor *vendor) {
27    return vendor->GetKind() == eAppleObjCDeclVendor;
28  }
29
30  uint32_t FindDecls(ConstString name, bool append, uint32_t max_matches,
31                     std::vector<CompilerDecl> &decls) override;
32
33  friend class AppleObjCExternalASTSource;
34
35private:
36  clang::ObjCInterfaceDecl *GetDeclForISA(ObjCLanguageRuntime::ObjCISA isa);
37  bool FinishDecl(clang::ObjCInterfaceDecl *decl);
38
39  ObjCLanguageRuntime &m_runtime;
40  ClangASTContext m_ast_ctx;
41  ObjCLanguageRuntime::EncodingToTypeSP m_type_realizer_sp;
42  AppleObjCExternalASTSource *m_external_source;
43
44  typedef llvm::DenseMap<ObjCLanguageRuntime::ObjCISA,
45                         clang::ObjCInterfaceDecl *>
46      ISAToInterfaceMap;
47
48  ISAToInterfaceMap m_isa_to_interface;
49};
50
51} // namespace lldb_private
52
53#endif // liblldb_AppleObjCDeclVendor_h_
54