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
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
llvm::DenseMap< clang::CXXRecordDecl *, lldb::user_id_t > CXXRecordDeclToUidMap
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
void AddRecordMethods(lldb_private::SymbolFile &symbol_file, lldb_private::CompilerType &record_type, PDBFuncSymbolEnumerator &methods_enum)
NamespacesSet m_namespaces
lldb::TypeSP CreateLLDBTypeFromPDBType(const llvm::pdb::PDBSymbol &type)
DeclContextToUidMap m_decl_context_to_uid
clang::DeclContext * GetDeclContextForSymbol(const llvm::pdb::PDBSymbol &symbol)
lldb_private::ClangASTImporter & GetClangASTImporter()
llvm::DenseMap< clang::DeclContext *, NamespacesSet > ParentToNamespacesMap
void ParseDeclsForDeclContext(const clang::DeclContext *decl_context)
llvm::pdb::ConcreteSymbolEnumerator< llvm::pdb::PDBSymbolData > PDBDataSymbolEnumerator
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
UidToDeclMap m_uid_to_decl
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
PDBASTParser(lldb_private::TypeSystemClang &ast)
llvm::pdb::ConcreteSymbolEnumerator< llvm::pdb::PDBSymbolFunc > PDBFuncSymbolEnumerator
ParentToNamespacesMap m_parent_to_namespaces
clang::Decl * GetDeclForSymbol(const llvm::pdb::PDBSymbol &symbol)
llvm::DenseMap< clang::DeclContext *, lldb::user_id_t > DeclContextToUidMap
clang::DeclContext * GetDeclContextContainingSymbol(const llvm::pdb::PDBSymbol &symbol)
llvm::DenseMap< lldb::user_id_t, clang::Decl * > UidToDeclMap
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
Manages and observes all Clang AST node importing in LLDB.
Generic representation of a type in a programming language.
Provides public interface for all SymbolFiles.
Definition SymbolFile.h:51
A TypeSystem implementation based on Clang.
A class that represents a running process on the host machine.
std::shared_ptr< lldb_private::Type > TypeSP