summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.h
diff options
context:
space:
mode:
authorZachary Turner <zturner@google.com>2018-12-17 19:43:33 +0000
committerZachary Turner <zturner@google.com>2018-12-17 19:43:33 +0000
commit594c85e95fa1a0d1e5e7e7dc66226f05b6dce555 (patch)
treeb52ad3db66b0503c9c9b09da8b2887202394d326 /lldb/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.h
parent9b20a998236b65d84255a98a5ba5f293c87d57b8 (diff)
downloadbcm5719-llvm-594c85e95fa1a0d1e5e7e7dc66226f05b6dce555.tar.gz
bcm5719-llvm-594c85e95fa1a0d1e5e7e7dc66226f05b6dce555.zip
[NativePDB] Decouple AST reconstruction from lldb Symbol creation.
Previously the code that parsed debug info to create lldb's Symbol objects such as Variable, Type, Function, etc was tightly coupled to the AST reconstruction code. This made it difficult / impossible to implement functions such as ParseDeclsForContext() that were only supposed to be operating on clang AST's. By splitting these apart, the logic becomes much cleaner and we have a clear separation of responsibilities. llvm-svn: 349383
Diffstat (limited to 'lldb/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.h')
-rw-r--r--lldb/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.h57
1 files changed, 21 insertions, 36 deletions
diff --git a/lldb/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.h b/lldb/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.h
index d8c1a0daa61..39abb9ca633 100644
--- a/lldb/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.h
+++ b/lldb/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.h
@@ -39,14 +39,7 @@ namespace lldb_private {
class ClangASTImporter;
namespace npdb {
-
-struct DeclStatus {
- DeclStatus() = default;
- DeclStatus(lldb::user_id_t uid, Type::ResolveStateTag status)
- : uid(uid), status(status) {}
- lldb::user_id_t uid = 0;
- Type::ResolveStateTag status = Type::eResolveStateForward;
-};
+class PdbAstBuilder;
class SymbolFileNativePDB : public SymbolFile {
friend class UdtRecordCompleter;
@@ -158,40 +151,38 @@ public:
llvm::pdb::PDBFile &GetPDBFile() { return m_index->pdb(); }
const llvm::pdb::PDBFile &GetPDBFile() const { return m_index->pdb(); }
- ClangASTContext &GetASTContext() { return *m_clang; }
- ClangASTImporter &GetASTImporter() { return *m_importer; }
-
void DumpClangAST(Stream &s) override;
private:
- std::pair<clang::DeclContext *, std::string>
- CreateDeclInfoForType(const llvm::codeview::TagRecord &record,
- llvm::codeview::TypeIndex ti);
- void PreprocessTpiStream();
size_t FindTypesByName(llvm::StringRef name, uint32_t max_matches,
TypeMap &types);
lldb::TypeSP CreateModifierType(PdbTypeSymId type_id,
- const llvm::codeview::ModifierRecord &mr);
+ const llvm::codeview::ModifierRecord &mr,
+ CompilerType ct);
lldb::TypeSP CreatePointerType(PdbTypeSymId type_id,
- const llvm::codeview::PointerRecord &pr);
- lldb::TypeSP CreateSimpleType(llvm::codeview::TypeIndex ti);
+ const llvm::codeview::PointerRecord &pr,
+ CompilerType ct);
+ lldb::TypeSP CreateSimpleType(llvm::codeview::TypeIndex ti, CompilerType ct);
lldb::TypeSP CreateTagType(PdbTypeSymId type_id,
- const llvm::codeview::ClassRecord &cr);
+ const llvm::codeview::ClassRecord &cr,
+ CompilerType ct);
lldb::TypeSP CreateTagType(PdbTypeSymId type_id,
- const llvm::codeview::EnumRecord &er);
+ const llvm::codeview::EnumRecord &er,
+ CompilerType ct);
lldb::TypeSP CreateTagType(PdbTypeSymId type_id,
- const llvm::codeview::UnionRecord &ur);
+ const llvm::codeview::UnionRecord &ur,
+ CompilerType ct);
lldb::TypeSP CreateArrayType(PdbTypeSymId type_id,
- const llvm::codeview::ArrayRecord &ar);
+ const llvm::codeview::ArrayRecord &ar,
+ CompilerType ct);
lldb::TypeSP CreateProcedureType(PdbTypeSymId type_id,
- const llvm::codeview::ProcedureRecord &pr);
- lldb::TypeSP
- CreateClassStructUnion(PdbTypeSymId type_id,
- const llvm::codeview::TagRecord &record, size_t size,
- clang::TagTypeKind ttk,
- clang::MSInheritanceAttr::Spelling inheritance);
+ const llvm::codeview::ProcedureRecord &pr,
+ CompilerType ct);
+ lldb::TypeSP CreateClassStructUnion(PdbTypeSymId type_id,
+ const llvm::codeview::TagRecord &record,
+ size_t size, CompilerType ct);
lldb::FunctionSP GetOrCreateFunction(PdbCompilandSymId func_id,
CompileUnit &comp_unit);
@@ -210,7 +201,7 @@ private:
lldb::VariableSP CreateLocalVariable(PdbCompilandSymId scope_id,
PdbCompilandSymId var_id, bool is_param);
lldb::CompUnitSP CreateCompileUnit(const CompilandIndexItem &cci);
- lldb::TypeSP CreateType(PdbTypeSymId type_id);
+ lldb::TypeSP CreateType(PdbTypeSymId type_id, CompilerType ct);
lldb::TypeSP CreateAndCacheType(PdbTypeSymId type_id);
lldb::VariableSP CreateGlobalVariable(PdbGlobalSymId var_id);
lldb::VariableSP CreateConstantSymbol(PdbGlobalSymId var_id,
@@ -224,14 +215,8 @@ private:
lldb::addr_t m_obj_load_address = 0;
std::unique_ptr<PdbIndex> m_index;
- std::unique_ptr<ClangASTImporter> m_importer;
- ClangASTContext *m_clang = nullptr;
-
- llvm::DenseMap<clang::TagDecl *, DeclStatus> m_decl_to_status;
- llvm::DenseMap<lldb::user_id_t, clang::Decl *> m_uid_to_decl;
- llvm::DenseMap<llvm::codeview::TypeIndex, llvm::codeview::TypeIndex>
- m_parent_types;
+ std::unique_ptr<PdbAstBuilder> m_ast;
llvm::DenseMap<lldb::user_id_t, lldb::VariableSP> m_global_vars;
llvm::DenseMap<lldb::user_id_t, lldb::VariableSP> m_local_variables;
OpenPOWER on IntegriCloud