1 //===-- UdtRecordCompleter.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 LLDB_PLUGINS_SYMBOLFILE_NATIVEPDB_UDTRECORDCOMPLETER_H
10 #define LLDB_PLUGINS_SYMBOLFILE_NATIVEPDB_UDTRECORDCOMPLETER_H
12 #include "lldb/Symbol/ClangASTImporter.h"
13 #include "llvm/DebugInfo/CodeView/CVRecord.h"
14 #include "llvm/DebugInfo/CodeView/TypeRecord.h"
15 #include "llvm/DebugInfo/CodeView/TypeVisitorCallbacks.h"
17 #include "PdbSymUid.h"
20 class CXXBaseSpecifier;
31 namespace lldb_private {
37 class UdtRecordCompleter : public llvm::codeview::TypeVisitorCallbacks {
39 std::pair<uint64_t, std::unique_ptr<clang::CXXBaseSpecifier>>;
43 llvm::codeview::UnionRecord ur;
44 llvm::codeview::ClassRecord cr;
45 llvm::codeview::EnumRecord er;
49 CompilerType &m_derived_ct;
50 clang::TagDecl &m_tag_decl;
51 PdbAstBuilder &m_ast_builder;
52 llvm::pdb::TpiStream &m_tpi;
53 std::vector<IndexedBase> m_bases;
54 ClangASTImporter::LayoutInfo m_layout;
57 UdtRecordCompleter(PdbTypeSymId id, CompilerType &derived_ct,
58 clang::TagDecl &tag_decl, PdbAstBuilder &ast_builder,
59 llvm::pdb::TpiStream &tpi);
61 #define MEMBER_RECORD(EnumName, EnumVal, Name) \
62 llvm::Error visitKnownMember(llvm::codeview::CVMemberRecord &CVR, \
63 llvm::codeview::Name##Record &Record) override;
64 #define MEMBER_RECORD_ALIAS(EnumName, EnumVal, Name, AliasName)
65 #include "llvm/DebugInfo/CodeView/CodeViewTypes.def"
70 clang::QualType AddBaseClassForTypeIndex(
71 llvm::codeview::TypeIndex ti, llvm::codeview::MemberAccess access,
72 llvm::Optional<uint64_t> vtable_idx = llvm::Optional<uint64_t>());
73 void AddMethod(llvm::StringRef name, llvm::codeview::TypeIndex type_idx,
74 llvm::codeview::MemberAccess access,
75 llvm::codeview::MethodOptions options,
76 llvm::codeview::MemberAttributes attrs);
80 } // namespace lldb_private
82 #endif // LLDB_PLUGINS_SYMBOLFILE_NATIVEPDB_UDTRECORDCOMPLETER_H