#include "PdbAstBuilder.h"
#include "llvm/DebugInfo/CodeView/CVTypeVisitor.h"
#include "llvm/DebugInfo/CodeView/LazyRandomTypeCollection.h"
#include "llvm/DebugInfo/CodeView/RecordName.h"
#include "llvm/DebugInfo/CodeView/SymbolDeserializer.h"
#include "llvm/DebugInfo/CodeView/SymbolRecord.h"
#include "llvm/DebugInfo/CodeView/SymbolRecordHelpers.h"
#include "llvm/DebugInfo/CodeView/TypeDeserializer.h"
#include "llvm/DebugInfo/CodeView/TypeVisitorCallbacks.h"
#include "llvm/DebugInfo/PDB/Native/DbiStream.h"
#include "llvm/DebugInfo/PDB/Native/PublicsStream.h"
#include "llvm/DebugInfo/PDB/Native/SymbolStream.h"
#include "llvm/DebugInfo/PDB/Native/TpiStream.h"
#include "llvm/Demangle/MicrosoftDemangle.h"
#include "PdbUtil.h"
#include "Plugins/ExpressionParser/Clang/ClangASTMetadata.h"
#include "Plugins/ExpressionParser/Clang/ClangUtil.h"
#include "Plugins/Language/CPlusPlus/MSVCUndecoratedNameParser.h"
#include "Plugins/TypeSystem/Clang/TypeSystemClang.h"
#include "SymbolFileNativePDB.h"
#include "UdtRecordCompleter.h"
#include "lldb/Core/Module.h"
#include "lldb/Symbol/ObjectFile.h"
#include "lldb/Utility/LLDBAssert.h"
#include <optional>
#include <string_view>
usingnamespacelldb_private;
usingnamespacelldb_private::npdb;
usingnamespacellvm::codeview;
usingnamespacellvm::pdb;
namespace {
struct CreateMethodDecl : public TypeVisitorCallbacks { … };
}
static clang::TagTypeKind TranslateUdtKind(const TagRecord &cr) { … }
static bool IsCVarArgsFunction(llvm::ArrayRef<TypeIndex> args) { … }
static bool
AnyScopesHaveTemplateParams(llvm::ArrayRef<llvm::ms_demangle::Node *> scopes) { … }
static std::optional<clang::CallingConv>
TranslateCallingConvention(llvm::codeview::CallingConvention conv) { … }
static bool IsAnonymousNamespaceName(llvm::StringRef name) { … }
PdbAstBuilder::PdbAstBuilder(TypeSystemClang &clang) : … { … }
lldb_private::CompilerDeclContext PdbAstBuilder::GetTranslationUnitDecl() { … }
std::pair<clang::DeclContext *, std::string>
PdbAstBuilder::CreateDeclInfoForType(const TagRecord &record, TypeIndex ti) { … }
static bool isLocalVariableType(SymbolKind K) { … }
clang::Decl *PdbAstBuilder::GetOrCreateSymbolForId(PdbCompilandSymId id) { … }
std::optional<CompilerDecl>
PdbAstBuilder::GetOrCreateDeclForUid(PdbSymUid uid) { … }
clang::DeclContext *PdbAstBuilder::GetOrCreateDeclContextForUid(PdbSymUid uid) { … }
std::pair<clang::DeclContext *, std::string>
PdbAstBuilder::CreateDeclInfoForUndecoratedName(llvm::StringRef name) { … }
clang::DeclContext *PdbAstBuilder::GetParentDeclContext(PdbSymUid uid) { … }
bool PdbAstBuilder::CompleteType(clang::QualType qt) { … }
bool PdbAstBuilder::CompleteTagDecl(clang::TagDecl &tag) { … }
clang::QualType PdbAstBuilder::CreateSimpleType(TypeIndex ti) { … }
clang::QualType PdbAstBuilder::CreatePointerType(const PointerRecord &pointer) { … }
clang::QualType
PdbAstBuilder::CreateModifierType(const ModifierRecord &modifier) { … }
clang::QualType PdbAstBuilder::CreateRecordType(PdbTypeSymId id,
const TagRecord &record) { … }
clang::Decl *PdbAstBuilder::TryGetDecl(PdbSymUid uid) const { … }
clang::NamespaceDecl *
PdbAstBuilder::GetOrCreateNamespaceDecl(const char *name,
clang::DeclContext &context) { … }
clang::BlockDecl *
PdbAstBuilder::GetOrCreateBlockDecl(PdbCompilandSymId block_id) { … }
clang::VarDecl *PdbAstBuilder::CreateVariableDecl(PdbSymUid uid, CVSymbol sym,
clang::DeclContext &scope) { … }
clang::VarDecl *
PdbAstBuilder::GetOrCreateVariableDecl(PdbCompilandSymId scope_id,
PdbCompilandSymId var_id) { … }
clang::VarDecl *PdbAstBuilder::GetOrCreateVariableDecl(PdbGlobalSymId var_id) { … }
clang::TypedefNameDecl *
PdbAstBuilder::GetOrCreateTypedefDecl(PdbGlobalSymId id) { … }
clang::QualType PdbAstBuilder::GetBasicType(lldb::BasicType type) { … }
clang::QualType PdbAstBuilder::CreateType(PdbTypeSymId type) { … }
clang::QualType PdbAstBuilder::GetOrCreateType(PdbTypeSymId type) { … }
clang::FunctionDecl *
PdbAstBuilder::CreateFunctionDecl(PdbCompilandSymId func_id,
llvm::StringRef func_name, TypeIndex func_ti,
CompilerType func_ct, uint32_t param_count,
clang::StorageClass func_storage,
bool is_inline, clang::DeclContext *parent) { … }
clang::FunctionDecl *
PdbAstBuilder::GetOrCreateInlinedFunctionDecl(PdbCompilandSymId inlinesite_id) { … }
clang::FunctionDecl *
PdbAstBuilder::CreateFunctionDeclFromId(PdbTypeSymId func_tid,
PdbCompilandSymId func_sid) { … }
clang::FunctionDecl *
PdbAstBuilder::GetOrCreateFunctionDecl(PdbCompilandSymId func_id) { … }
void PdbAstBuilder::CreateFunctionParameters(PdbCompilandSymId func_id,
clang::FunctionDecl &function_decl,
uint32_t param_count) { … }
clang::QualType PdbAstBuilder::CreateEnumType(PdbTypeSymId id,
const EnumRecord &er) { … }
clang::QualType PdbAstBuilder::CreateArrayType(const ArrayRecord &ar) { … }
clang::QualType PdbAstBuilder::CreateFunctionType(
TypeIndex args_type_idx, TypeIndex return_type_idx,
llvm::codeview::CallingConvention calling_convention) { … }
static bool isTagDecl(clang::DeclContext &context) { … }
static bool isFunctionDecl(clang::DeclContext &context) { … }
static bool isBlockDecl(clang::DeclContext &context) { … }
void PdbAstBuilder::ParseNamespace(clang::DeclContext &context) { … }
void PdbAstBuilder::ParseAllTypes() { … }
void PdbAstBuilder::ParseAllFunctionsAndNonLocalVars() { … }
static CVSymbolArray skipFunctionParameters(clang::Decl &decl,
const CVSymbolArray &symbols) { … }
void PdbAstBuilder::ParseBlockChildren(PdbCompilandSymId block_id) { … }
void PdbAstBuilder::ParseDeclsForSimpleContext(clang::DeclContext &context) { … }
void PdbAstBuilder::ParseDeclsForContext(clang::DeclContext &context) { … }
CompilerDecl PdbAstBuilder::ToCompilerDecl(clang::Decl &decl) { … }
CompilerType PdbAstBuilder::ToCompilerType(clang::QualType qt) { … }
CompilerDeclContext
PdbAstBuilder::ToCompilerDeclContext(clang::DeclContext &context) { … }
clang::Decl * PdbAstBuilder::FromCompilerDecl(CompilerDecl decl) { … }
clang::DeclContext *
PdbAstBuilder::FromCompilerDeclContext(CompilerDeclContext context) { … }
void PdbAstBuilder::Dump(Stream &stream) { … }