aboutsummaryrefslogtreecommitdiff
path: root/lldb/source/Plugins/SymbolFile/PDB/PDBASTParser.cpp
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2022-07-03 14:10:23 +0000
committerDimitry Andric <dim@FreeBSD.org>2022-07-03 14:10:23 +0000
commit145449b1e420787bb99721a429341fa6be3adfb6 (patch)
tree1d56ae694a6de602e348dd80165cf881a36600ed /lldb/source/Plugins/SymbolFile/PDB/PDBASTParser.cpp
parentecbca9f5fb7d7613d2b94982c4825eb0d33d6842 (diff)
Diffstat (limited to 'lldb/source/Plugins/SymbolFile/PDB/PDBASTParser.cpp')
-rw-r--r--lldb/source/Plugins/SymbolFile/PDB/PDBASTParser.cpp25
1 files changed, 16 insertions, 9 deletions
diff --git a/lldb/source/Plugins/SymbolFile/PDB/PDBASTParser.cpp b/lldb/source/Plugins/SymbolFile/PDB/PDBASTParser.cpp
index f45287fd0fff..c3f424d06c54 100644
--- a/lldb/source/Plugins/SymbolFile/PDB/PDBASTParser.cpp
+++ b/lldb/source/Plugins/SymbolFile/PDB/PDBASTParser.cpp
@@ -22,13 +22,15 @@
#include "lldb/Symbol/SymbolFile.h"
#include "lldb/Symbol/TypeMap.h"
#include "lldb/Symbol/TypeSystem.h"
-
+#include "lldb/Utility/LLDBLog.h"
+#include "llvm/DebugInfo/PDB/ConcreteSymbolEnumerator.h"
#include "llvm/DebugInfo/PDB/IPDBLineNumber.h"
#include "llvm/DebugInfo/PDB/IPDBSourceFile.h"
#include "llvm/DebugInfo/PDB/PDBSymbol.h"
#include "llvm/DebugInfo/PDB/PDBSymbolData.h"
#include "llvm/DebugInfo/PDB/PDBSymbolFunc.h"
#include "llvm/DebugInfo/PDB/PDBSymbolTypeArray.h"
+#include "llvm/DebugInfo/PDB/PDBSymbolTypeBaseClass.h"
#include "llvm/DebugInfo/PDB/PDBSymbolTypeBuiltin.h"
#include "llvm/DebugInfo/PDB/PDBSymbolTypeEnum.h"
#include "llvm/DebugInfo/PDB/PDBSymbolTypeFunctionArg.h"
@@ -709,7 +711,7 @@ lldb::TypeSP PDBASTParser::CreateLLDBTypeFromPDBType(const PDBSymbol &type) {
bytes = size;
Encoding encoding = TranslateBuiltinEncoding(builtin_kind);
CompilerType builtin_ast_type = GetBuiltinTypeForPDBEncodingAndBitSize(
- m_ast, *builtin_type, encoding, bytes.getValueOr(0) * 8);
+ m_ast, *builtin_type, encoding, bytes.value_or(0) * 8);
if (builtin_type->isConstType())
builtin_ast_type = builtin_ast_type.AddConstModifier();
@@ -799,7 +801,8 @@ bool PDBASTParser::CompleteTypeFromPDB(
if (uid_it == m_forward_decl_to_uid.end())
return true;
- auto symbol_file = static_cast<SymbolFilePDB *>(m_ast.GetSymbolFile());
+ auto symbol_file = static_cast<SymbolFilePDB *>(
+ m_ast.GetSymbolFile()->GetBackingSymbolFile());
if (!symbol_file)
return false;
@@ -833,7 +836,8 @@ PDBASTParser::GetDeclForSymbol(const llvm::pdb::PDBSymbol &symbol) {
if (it != m_uid_to_decl.end())
return it->second;
- auto symbol_file = static_cast<SymbolFilePDB *>(m_ast.GetSymbolFile());
+ auto symbol_file = static_cast<SymbolFilePDB *>(
+ m_ast.GetSymbolFile()->GetBackingSymbolFile());
if (!symbol_file)
return nullptr;
@@ -999,7 +1003,8 @@ PDBASTParser::GetDeclContextForSymbol(const llvm::pdb::PDBSymbol &symbol) {
return result;
}
- auto symbol_file = static_cast<SymbolFilePDB *>(m_ast.GetSymbolFile());
+ auto symbol_file = static_cast<SymbolFilePDB *>(
+ m_ast.GetSymbolFile()->GetBackingSymbolFile());
if (!symbol_file)
return nullptr;
@@ -1039,7 +1044,8 @@ clang::DeclContext *PDBASTParser::GetDeclContextContainingSymbol(
if (specs.empty())
return m_ast.GetTranslationUnitDecl();
- auto symbol_file = static_cast<SymbolFilePDB *>(m_ast.GetSymbolFile());
+ auto symbol_file = static_cast<SymbolFilePDB *>(
+ m_ast.GetSymbolFile()->GetBackingSymbolFile());
if (!symbol_file)
return m_ast.GetTranslationUnitDecl();
@@ -1092,7 +1098,8 @@ clang::DeclContext *PDBASTParser::GetDeclContextContainingSymbol(
void PDBASTParser::ParseDeclsForDeclContext(
const clang::DeclContext *decl_context) {
- auto symbol_file = static_cast<SymbolFilePDB *>(m_ast.GetSymbolFile());
+ auto symbol_file = static_cast<SymbolFilePDB *>(
+ m_ast.GetSymbolFile()->GetBackingSymbolFile());
if (!symbol_file)
return;
@@ -1298,7 +1305,7 @@ void PDBASTParser::AddRecordMembers(
TypeSystemClang::SetIntegerInitializerForVariable(
decl, value.toAPSInt().extOrTrunc(type_width));
} else {
- LLDB_LOG(GetLogIfAllCategoriesSet(LIBLLDB_LOG_AST),
+ LLDB_LOG(GetLog(LLDBLog::AST),
"Class '{0}' has a member '{1}' of type '{2}' ({3} bits) "
"which resolves to a wider constant value ({4} bits). "
"Ignoring constant.",
@@ -1316,7 +1323,7 @@ void PDBASTParser::AddRecordMembers(
decl, value.toAPFloat());
decl->setConstexpr(true);
} else {
- LLDB_LOG(GetLogIfAllCategoriesSet(LIBLLDB_LOG_AST),
+ LLDB_LOG(GetLog(LLDBLog::AST),
"Class '{0}' has a member '{1}' of type '{2}' ({3} "
"bits) which resolves to a constant value of mismatched "
"width ({4} bits). Ignoring constant.",