#include "PDBASTParser.h"
#include "SymbolFilePDB.h"
#include "clang/AST/CharUnits.h"
#include "clang/AST/Decl.h"
#include "clang/AST/DeclCXX.h"
#include "Plugins/ExpressionParser/Clang/ClangASTMetadata.h"
#include "Plugins/ExpressionParser/Clang/ClangUtil.h"
#include "Plugins/TypeSystem/Clang/TypeSystemClang.h"
#include "lldb/Core/Declaration.h"
#include "lldb/Core/Module.h"
#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"
#include "llvm/DebugInfo/PDB/PDBSymbolTypeFunctionSig.h"
#include "llvm/DebugInfo/PDB/PDBSymbolTypePointer.h"
#include "llvm/DebugInfo/PDB/PDBSymbolTypeTypedef.h"
#include "llvm/DebugInfo/PDB/PDBSymbolTypeUDT.h"
#include "Plugins/Language/CPlusPlus/MSVCUndecoratedNameParser.h"
#include <optional>
usingnamespacelldb;
usingnamespacelldb_private;
usingnamespacellvm::pdb;
static int TranslateUdtKind(PDB_UdtType pdb_kind) { … }
static lldb::Encoding TranslateBuiltinEncoding(PDB_BuiltinType type) { … }
static lldb::Encoding TranslateEnumEncoding(PDB_VariantType type) { … }
static CompilerType
GetBuiltinTypeForPDBEncodingAndBitSize(TypeSystemClang &clang_ast,
const PDBSymbolTypeBuiltin &pdb_type,
Encoding encoding, uint32_t width) { … }
static ConstString GetPDBBuiltinTypeName(const PDBSymbolTypeBuiltin &pdb_type,
CompilerType &compiler_type) { … }
static bool AddSourceInfoToDecl(const PDBSymbol &symbol, Declaration &decl) { … }
static AccessType TranslateMemberAccess(PDB_MemberAccess access) { … }
static AccessType GetDefaultAccessibilityForUdtKind(PDB_UdtType udt_kind) { … }
static AccessType GetAccessibilityForUdt(const PDBSymbolTypeUDT &udt) { … }
static clang::MSInheritanceAttr::Spelling
GetMSInheritance(const PDBSymbolTypeUDT &udt) { … }
static std::unique_ptr<llvm::pdb::PDBSymbol>
GetClassOrFunctionParent(const llvm::pdb::PDBSymbol &symbol) { … }
static clang::NamedDecl *
GetDeclFromContextByName(const clang::ASTContext &ast,
const clang::DeclContext &decl_context,
llvm::StringRef name) { … }
static bool IsAnonymousNamespaceName(llvm::StringRef name) { … }
static clang::CallingConv TranslateCallingConvention(PDB_CallingConv pdb_cc) { … }
PDBASTParser::PDBASTParser(lldb_private::TypeSystemClang &ast) : … { … }
PDBASTParser::~PDBASTParser() = default;
lldb::TypeSP PDBASTParser::CreateLLDBTypeFromPDBType(const PDBSymbol &type) { … }
bool PDBASTParser::CompleteTypeFromPDB(
lldb_private::CompilerType &compiler_type) { … }
clang::Decl *
PDBASTParser::GetDeclForSymbol(const llvm::pdb::PDBSymbol &symbol) { … }
clang::DeclContext *
PDBASTParser::GetDeclContextForSymbol(const llvm::pdb::PDBSymbol &symbol) { … }
clang::DeclContext *PDBASTParser::GetDeclContextContainingSymbol(
const llvm::pdb::PDBSymbol &symbol) { … }
void PDBASTParser::ParseDeclsForDeclContext(
const clang::DeclContext *decl_context) { … }
clang::NamespaceDecl *
PDBASTParser::FindNamespaceDecl(const clang::DeclContext *parent,
llvm::StringRef name) { … }
bool PDBASTParser::AddEnumValue(CompilerType enum_type,
const PDBSymbolData &enum_value) { … }
bool PDBASTParser::CompleteTypeFromUDT(
lldb_private::SymbolFile &symbol_file,
lldb_private::CompilerType &compiler_type,
llvm::pdb::PDBSymbolTypeUDT &udt) { … }
void PDBASTParser::AddRecordMembers(
lldb_private::SymbolFile &symbol_file,
lldb_private::CompilerType &record_type,
PDBDataSymbolEnumerator &members_enum,
lldb_private::ClangASTImporter::LayoutInfo &layout_info) { … }
void PDBASTParser::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 PDBASTParser::AddRecordMethods(lldb_private::SymbolFile &symbol_file,
lldb_private::CompilerType &record_type,
PDBFuncSymbolEnumerator &methods_enum) { … }
clang::CXXMethodDecl *
PDBASTParser::AddRecordMethod(lldb_private::SymbolFile &symbol_file,
lldb_private::CompilerType &record_type,
const llvm::pdb::PDBSymbolFunc &method) const { … }