LLDB mainline
PDBASTParser.h
Go to the documentation of this file.
1//===-- PDBASTParser.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 LLDB_SOURCE_PLUGINS_SYMBOLFILE_PDB_PDBASTPARSER_H
10#define LLDB_SOURCE_PLUGINS_SYMBOLFILE_PDB_PDBASTPARSER_H
11
12#include "lldb/lldb-forward.h"
13
15
16class SymbolFilePDB;
17
18namespace clang {
19class CharUnits;
20class CXXRecordDecl;
21class FieldDecl;
22class RecordDecl;
23} // namespace clang
24
25namespace lldb_private {
26class TypeSystemClang;
27class CompilerType;
28} // namespace lldb_private
29
30namespace llvm {
31namespace pdb {
32template <typename ChildType> class ConcreteSymbolEnumerator;
33
34class PDBSymbol;
35class PDBSymbolData;
36class PDBSymbolFunc;
37class PDBSymbolTypeBaseClass;
38class PDBSymbolTypeBuiltin;
39class PDBSymbolTypeUDT;
40} // namespace pdb
41} // namespace llvm
42
44public:
47
48 lldb::TypeSP CreateLLDBTypeFromPDBType(const llvm::pdb::PDBSymbol &type);
50
51 clang::Decl *GetDeclForSymbol(const llvm::pdb::PDBSymbol &symbol);
52
53 clang::DeclContext *
54 GetDeclContextForSymbol(const llvm::pdb::PDBSymbol &symbol);
55 clang::DeclContext *
56 GetDeclContextContainingSymbol(const llvm::pdb::PDBSymbol &symbol);
57
58 void ParseDeclsForDeclContext(const clang::DeclContext *decl_context);
59
60 clang::NamespaceDecl *FindNamespaceDecl(const clang::DeclContext *parent,
61 llvm::StringRef name);
62
64 return m_ast_importer;
65 }
66
67private:
68 typedef llvm::DenseMap<clang::CXXRecordDecl *, lldb::user_id_t>
70 typedef llvm::DenseMap<lldb::user_id_t, clang::Decl *> UidToDeclMap;
71 typedef std::set<clang::NamespaceDecl *> NamespacesSet;
72 typedef llvm::DenseMap<clang::DeclContext *, NamespacesSet>
74 typedef llvm::DenseMap<clang::DeclContext *, lldb::user_id_t>
82
84 const llvm::pdb::PDBSymbolData &data);
86 lldb_private::CompilerType &compiler_type,
87 llvm::pdb::PDBSymbolTypeUDT &udt);
88 void
90 lldb_private::CompilerType &record_type,
91 PDBDataSymbolEnumerator &members_enum,
93 void
95 lldb_private::CompilerType &record_type, int record_kind,
99 lldb_private::CompilerType &record_type,
100 PDBFuncSymbolEnumerator &methods_enum);
101 clang::CXXMethodDecl *
103 lldb_private::CompilerType &record_type,
104 const llvm::pdb::PDBSymbolFunc &method) const;
105
108
114};
115
116#endif // LLDB_SOURCE_PLUGINS_SYMBOLFILE_PDB_PDBASTPARSER_H
lldb_private::TypeSystemClang & m_ast
Definition: PDBASTParser.h:106
llvm::DenseMap< clang::CXXRecordDecl *, lldb::user_id_t > CXXRecordDeclToUidMap
Definition: PDBASTParser.h:69
clang::NamespaceDecl * FindNamespaceDecl(const clang::DeclContext *parent, llvm::StringRef name)
bool CompleteTypeFromUDT(lldb_private::SymbolFile &symbol_file, lldb_private::CompilerType &compiler_type, llvm::pdb::PDBSymbolTypeUDT &udt)
lldb_private::ClangASTImporter m_ast_importer
Definition: PDBASTParser.h:107
void AddRecordMethods(lldb_private::SymbolFile &symbol_file, lldb_private::CompilerType &record_type, PDBFuncSymbolEnumerator &methods_enum)
NamespacesSet m_namespaces
Definition: PDBASTParser.h:112
lldb::TypeSP CreateLLDBTypeFromPDBType(const llvm::pdb::PDBSymbol &type)
DeclContextToUidMap m_decl_context_to_uid
Definition: PDBASTParser.h:113
clang::DeclContext * GetDeclContextForSymbol(const llvm::pdb::PDBSymbol &symbol)
lldb_private::ClangASTImporter & GetClangASTImporter()
Definition: PDBASTParser.h:63
llvm::DenseMap< clang::DeclContext *, NamespacesSet > ParentToNamespacesMap
Definition: PDBASTParser.h:73
void ParseDeclsForDeclContext(const clang::DeclContext *decl_context)
llvm::pdb::ConcreteSymbolEnumerator< llvm::pdb::PDBSymbolData > PDBDataSymbolEnumerator
Definition: PDBASTParser.h:77
void AddRecordBases(lldb_private::SymbolFile &symbol_file, lldb_private::CompilerType &record_type, int record_kind, PDBBaseClassSymbolEnumerator &bases_enum, lldb_private::ClangASTImporter::LayoutInfo &layout_info) const
void AddRecordMembers(lldb_private::SymbolFile &symbol_file, lldb_private::CompilerType &record_type, PDBDataSymbolEnumerator &members_enum, lldb_private::ClangASTImporter::LayoutInfo &layout_info)
std::set< clang::NamespaceDecl * > NamespacesSet
Definition: PDBASTParser.h:71
UidToDeclMap m_uid_to_decl
Definition: PDBASTParser.h:110
bool CompleteTypeFromPDB(lldb_private::CompilerType &compiler_type)
bool AddEnumValue(lldb_private::CompilerType enum_type, const llvm::pdb::PDBSymbolData &data)
llvm::pdb::ConcreteSymbolEnumerator< llvm::pdb::PDBSymbolTypeBaseClass > PDBBaseClassSymbolEnumerator
Definition: PDBASTParser.h:79
llvm::pdb::ConcreteSymbolEnumerator< llvm::pdb::PDBSymbolFunc > PDBFuncSymbolEnumerator
Definition: PDBASTParser.h:81
ParentToNamespacesMap m_parent_to_namespaces
Definition: PDBASTParser.h:111
clang::Decl * GetDeclForSymbol(const llvm::pdb::PDBSymbol &symbol)
llvm::DenseMap< clang::DeclContext *, lldb::user_id_t > DeclContextToUidMap
Definition: PDBASTParser.h:75
clang::DeclContext * GetDeclContextContainingSymbol(const llvm::pdb::PDBSymbol &symbol)
llvm::DenseMap< lldb::user_id_t, clang::Decl * > UidToDeclMap
Definition: PDBASTParser.h:70
clang::CXXMethodDecl * AddRecordMethod(lldb_private::SymbolFile &symbol_file, lldb_private::CompilerType &record_type, const llvm::pdb::PDBSymbolFunc &method) const
CXXRecordDeclToUidMap m_forward_decl_to_uid
Definition: PDBASTParser.h:109
Manages and observes all Clang AST node importing in LLDB.
Generic representation of a type in a programming language.
Definition: CompilerType.h:36
Provides public interface for all SymbolFiles.
Definition: SymbolFile.h:50
A TypeSystem implementation based on Clang.
A class that represents a running process on the host machine.
std::shared_ptr< lldb_private::Type > TypeSP
Definition: lldb-forward.h:452
Definition: Debugger.h:54