LLDB mainline
DWARFASTParserClang Class Reference

#include <DWARFASTParserClang.h>

Inheritance diagram for DWARFASTParserClang:
[legend]

Classes

class  DelayedAddObjCClassProperty
struct  FieldInfo
struct  MemberAttributes
 Parsed form of all attributes that are relevant for parsing type members. More...

Public Member Functions

 DWARFASTParserClang (lldb_private::TypeSystemClang &ast)
 ~DWARFASTParserClang () override
lldb::TypeSP ParseTypeFromDWARF (const lldb_private::SymbolContext &sc, const lldb_private::plugin::dwarf::DWARFDIE &die, bool *type_is_new_ptr) override
lldb_private::ConstString ConstructDemangledNameFromDWARF (const lldb_private::plugin::dwarf::DWARFDIE &die) override
lldb_private::FunctionParseFunctionFromDWARF (lldb_private::CompileUnit &comp_unit, const lldb_private::plugin::dwarf::DWARFDIE &die, lldb_private::AddressRanges func_ranges) override
bool CompleteTypeFromDWARF (const lldb_private::plugin::dwarf::DWARFDIE &die, lldb_private::Type *type, const lldb_private::CompilerType &compiler_type) override
lldb_private::CompilerDecl GetDeclForUIDFromDWARF (const lldb_private::plugin::dwarf::DWARFDIE &die) override
void EnsureAllDIEsInDeclContextHaveBeenParsed (lldb_private::CompilerDeclContext decl_context) override
lldb_private::CompilerDeclContext GetDeclContextForUIDFromDWARF (const lldb_private::plugin::dwarf::DWARFDIE &die) override
lldb_private::CompilerDeclContext GetDeclContextContainingUIDFromDWARF (const lldb_private::plugin::dwarf::DWARFDIE &die) override
lldb_private::ClangASTImporterGetClangASTImporter ()
llvm::Expected< llvm::APInt > ExtractIntFromFormValue (const lldb_private::CompilerType &int_type, const lldb_private::plugin::dwarf::DWARFFormValue &form_value) const
 Extracts an value for a given Clang integer type from a DWARFFormValue.
std::string GetDIEClassTemplateParams (lldb_private::plugin::dwarf::DWARFDIE die) override
 Returns the template parameters of a class DWARFDIE as a string.
void MapDeclDIEToDefDIE (const lldb_private::plugin::dwarf::DWARFDIE &decl_die, const lldb_private::plugin::dwarf::DWARFDIE &def_die)
lldb_private::plugin::dwarf::DWARFDIE GetObjectParameter (const lldb_private::plugin::dwarf::DWARFDIE &subprogram, const lldb_private::plugin::dwarf::DWARFDIE &decl_ctx_die)
 Get the object parameter DIE if one exists, otherwise returns a default DWARFDIE.
Public Member Functions inherited from lldb_private::plugin::dwarf::DWARFASTParser
 DWARFASTParser (Kind kind)
virtual ~DWARFASTParser ()=default
lldb_private::TypeGetTypeForDIE (const DWARFDIE &die)
Kind GetKind () const

Protected Member Functions

clang::DeclContext * GetDeclContextForBlock (const lldb_private::plugin::dwarf::DWARFDIE &die)
clang::BlockDecl * ResolveBlockDIE (const lldb_private::plugin::dwarf::DWARFDIE &die)
clang::NamespaceDecl * ResolveNamespaceDIE (const lldb_private::plugin::dwarf::DWARFDIE &die)
clang::NamespaceDecl * ResolveImportedDeclarationDIE (const lldb_private::plugin::dwarf::DWARFDIE &die)
 Returns the namespace decl that a DW_TAG_imported_declaration imports.
bool ParseTemplateDIE (const lldb_private::plugin::dwarf::DWARFDIE &die, lldb_private::TypeSystemClang::TemplateParameterInfos &template_param_infos)
bool ParseTemplateParameterInfos (const lldb_private::plugin::dwarf::DWARFDIE &parent_die, lldb_private::TypeSystemClang::TemplateParameterInfos &template_param_infos)
void GetUniqueTypeNameAndDeclaration (const lldb_private::plugin::dwarf::DWARFDIE &die, lldb::LanguageType language, lldb_private::ConstString &unique_typename, lldb_private::Declaration &decl_declaration)
bool ParseChildMembers (const lldb_private::plugin::dwarf::DWARFDIE &die, const lldb_private::CompilerType &class_compiler_type, std::vector< std::unique_ptr< clang::CXXBaseSpecifier > > &base_classes, std::vector< lldb_private::plugin::dwarf::DWARFDIE > &member_function_dies, std::vector< lldb_private::plugin::dwarf::DWARFDIE > &contained_type_dies, DelayedPropertyList &delayed_properties, const lldb::AccessType default_accessibility, lldb_private::ClangASTImporter::LayoutInfo &layout_info)
void ParseChildParameters (clang::DeclContext *containing_decl_ctx, const lldb_private::plugin::dwarf::DWARFDIE &parent_die, bool &is_variadic, bool &has_template_params, std::vector< lldb_private::CompilerType > &function_param_types, llvm::SmallVectorImpl< llvm::StringRef > &function_param_names)
size_t ParseChildEnumerators (const lldb_private::CompilerType &compiler_type, bool is_signed, uint32_t enumerator_byte_size, const lldb_private::plugin::dwarf::DWARFDIE &parent_die)
lldb::TypeSP ParseStructureLikeDIE (const lldb_private::SymbolContext &sc, const lldb_private::plugin::dwarf::DWARFDIE &die, ParsedDWARFTypeAttributes &attrs)
 Parse a structure, class, or union type DIE.
clang::Decl * GetClangDeclForDIE (const lldb_private::plugin::dwarf::DWARFDIE &die)
clang::DeclContext * GetClangDeclContextForDIE (const lldb_private::plugin::dwarf::DWARFDIE &die)
clang::DeclContext * GetClangDeclContextContainingDIE (const lldb_private::plugin::dwarf::DWARFDIE &die, lldb_private::plugin::dwarf::DWARFDIE *decl_ctx_die)
lldb_private::OptionalClangModuleID GetOwningClangModule (const lldb_private::plugin::dwarf::DWARFDIE &die)
bool CopyUniqueClassMethodTypes (const lldb_private::plugin::dwarf::DWARFDIE &src_class_die, const lldb_private::plugin::dwarf::DWARFDIE &dst_class_die, lldb_private::Type *class_type, std::vector< lldb_private::plugin::dwarf::DWARFDIE > &failures)
clang::DeclContext * GetCachedClangDeclContextForDIE (const lldb_private::plugin::dwarf::DWARFDIE &die)
void LinkDeclContextToDIE (clang::DeclContext *decl_ctx, const lldb_private::plugin::dwarf::DWARFDIE &die)
void LinkDeclToDIE (clang::Decl *decl, const lldb_private::plugin::dwarf::DWARFDIE &die)
lldb::TypeSP UpdateSymbolContextScopeForType (const lldb_private::SymbolContext &sc, const lldb_private::plugin::dwarf::DWARFDIE &die, lldb::TypeSP type_sp)
 If type_sp is valid, calculate and set its symbol context scope, and update the type list for its backing symbol file.
lldb::TypeSP ParseTypeFromClangModule (const lldb_private::SymbolContext &sc, const lldb_private::plugin::dwarf::DWARFDIE &die, lldb_private::Log *log)
 Follow Clang Module Skeleton CU references to find a type definition.
lldb::ModuleSP GetModuleForType (const lldb_private::plugin::dwarf::DWARFDIE &die)

Static Protected Member Functions

static bool classof (const DWARFASTParser *Parser)

Private Member Functions

bool ShouldCreateUnnamedBitfield (FieldInfo const &last_field_info, uint64_t last_field_end, FieldInfo const &this_field_info, lldb_private::ClangASTImporter::LayoutInfo const &layout_info) const
 Returns 'true' if we should create an unnamed bitfield and add it to the parser's current AST.
void AddUnnamedBitfieldToRecordTypeIfNeeded (lldb_private::ClangASTImporter::LayoutInfo &class_layout_info, const lldb_private::CompilerType &class_clang_type, const FieldInfo &previous_field, const FieldInfo &current_field)
 Tries to detect whether class_clang_type contained an unnamed bit-field between previous_field and current_field, and if so, adds a clang::FieldDecl representing that bit-field to class_clang_type.
void ParseObjCProperty (const lldb_private::plugin::dwarf::DWARFDIE &die, const lldb_private::plugin::dwarf::DWARFDIE &parent_die, const lldb_private::CompilerType &class_clang_type, DelayedPropertyList &delayed_properties)
 Parses a DW_TAG_APPLE_property DIE and appends the parsed data to the list of delayed Objective-C properties.
void ParseSingleMember (const lldb_private::plugin::dwarf::DWARFDIE &die, const lldb_private::plugin::dwarf::DWARFDIE &parent_die, const lldb_private::CompilerType &class_clang_type, lldb::AccessType default_accessibility, lldb_private::ClangASTImporter::LayoutInfo &layout_info, FieldInfo &last_field_info)
void CreateStaticMemberVariable (const lldb_private::plugin::dwarf::DWARFDIE &die, const MemberAttributes &attrs, const lldb_private::CompilerType &class_clang_type)
 If the specified 'die' represents a static data member, creates a 'clang::VarDecl' for it and attaches it to specified parent 'class_clang_type'.
bool CompleteRecordType (const lldb_private::plugin::dwarf::DWARFDIE &die, const lldb_private::CompilerType &clang_type)
bool CompleteEnumType (const lldb_private::plugin::dwarf::DWARFDIE &die, lldb_private::Type *type, const lldb_private::CompilerType &clang_type)
lldb::TypeSP ParseTypeModifier (const lldb_private::SymbolContext &sc, const lldb_private::plugin::dwarf::DWARFDIE &die, ParsedDWARFTypeAttributes &attrs)
lldb::TypeSP ParseEnum (const lldb_private::SymbolContext &sc, const lldb_private::plugin::dwarf::DWARFDIE &die, ParsedDWARFTypeAttributes &attrs)
lldb::TypeSP ParseSubroutine (const lldb_private::plugin::dwarf::DWARFDIE &die, const ParsedDWARFTypeAttributes &attrs)
bool ParseObjCMethod (const lldb_private::ObjCLanguage::ObjCMethodName &objc_method, const lldb_private::plugin::dwarf::DWARFDIE &die, lldb_private::CompilerType clang_type, const ParsedDWARFTypeAttributes &attrs, bool is_variadic)
 Helper function called by ParseSubroutine when parsing ObjC-methods.
std::pair< bool, lldb::TypeSPParseCXXMethod (const lldb_private::plugin::dwarf::DWARFDIE &die, lldb_private::CompilerType clang_type, const ParsedDWARFTypeAttributes &attrs, const lldb_private::plugin::dwarf::DWARFDIE &decl_ctx_die, const lldb_private::plugin::dwarf::DWARFDIE &object_parameter, bool &ignore_containing_context)
 Helper function called by ParseSubroutine when parsing C++ methods.
lldb::TypeSP ParseArrayType (const lldb_private::plugin::dwarf::DWARFDIE &die, const ParsedDWARFTypeAttributes &attrs)
lldb::TypeSP ParsePointerToMemberType (const lldb_private::plugin::dwarf::DWARFDIE &die, const ParsedDWARFTypeAttributes &attrs)
void ParseInheritance (const lldb_private::plugin::dwarf::DWARFDIE &die, const lldb_private::plugin::dwarf::DWARFDIE &parent_die, const lldb_private::CompilerType class_clang_type, const lldb::AccessType default_accessibility, const lldb::ModuleSP &module_sp, std::vector< std::unique_ptr< clang::CXXBaseSpecifier > > &base_classes, lldb_private::ClangASTImporter::LayoutInfo &layout_info)
 Parses a DW_TAG_inheritance DIE into a base/super class.
void ParseRustVariantPart (lldb_private::plugin::dwarf::DWARFDIE &die, const lldb_private::plugin::dwarf::DWARFDIE &parent_die, const lldb_private::CompilerType &class_clang_type, const lldb::AccessType default_accesibility, lldb_private::ClangASTImporter::LayoutInfo &layout_info)
 Parses DW_TAG_variant_part DIE into a structure that encodes all variants Note that this is currently being emitted by rustc and not Clang.
typedef std::vector< DelayedAddObjCClassPropertyDelayedPropertyList
typedef llvm::DenseMap< const lldb_private::plugin::dwarf::DWARFDebugInfoEntry *, clang::DeclContext * > DIEToDeclContextMap
typedef std::multimap< const clang::DeclContext *, const lldb_private::plugin::dwarf::DWARFDIEDeclContextToDIEMap
typedef llvm::DenseMap< const lldb_private::plugin::dwarf::DWARFDebugInfoEntry *, lldb_private::OptionalClangModuleIDDIEToModuleMap
typedef llvm::DenseMap< const lldb_private::plugin::dwarf::DWARFDebugInfoEntry *, clang::Decl * > DIEToDeclMap
lldb_private::TypeSystemClangm_ast
DIEToDeclMap m_die_to_decl
DIEToDeclContextMap m_die_to_decl_ctx
DeclContextToDIEMap m_decl_ctx_to_die
DIEToModuleMap m_die_to_module
std::unique_ptr< lldb_private::ClangASTImporterm_clang_ast_importer_up

Additional Inherited Members

Public Types inherited from lldb_private::plugin::dwarf::DWARFASTParser
enum class  Kind { DWARFASTParserClang }
Static Public Member Functions inherited from lldb_private::plugin::dwarf::DWARFASTParser
static std::optional< SymbolFile::ArrayInfoParseChildArrayInfo (const DWARFDIE &parent_die, const ExecutionContext *exe_ctx=nullptr)
static lldb::AccessType GetAccessTypeFromDWARF (uint32_t dwarf_accessibility)

Detailed Description

Definition at line 44 of file DWARFASTParserClang.h.

Member Typedef Documentation

◆ DeclContextToDIEMap

typedef std::multimap<const clang::DeclContext *, const lldb_private::plugin::dwarf::DWARFDIE> DWARFASTParserClang::DeclContextToDIEMap
protected

Definition at line 141 of file DWARFASTParserClang.h.

◆ DelayedPropertyList

Definition at line 133 of file DWARFASTParserClang.h.

◆ DIEToDeclContextMap

typedef llvm::DenseMap< const lldb_private::plugin::dwarf::DWARFDebugInfoEntry *, clang::DeclContext *> DWARFASTParserClang::DIEToDeclContextMap
protected

Definition at line 138 of file DWARFASTParserClang.h.

◆ DIEToDeclMap

typedef llvm::DenseMap< const lldb_private::plugin::dwarf::DWARFDebugInfoEntry *, clang::Decl *> DWARFASTParserClang::DIEToDeclMap
protected

Definition at line 148 of file DWARFASTParserClang.h.

◆ DIEToModuleMap

Constructor & Destructor Documentation

◆ DWARFASTParserClang()

◆ ~DWARFASTParserClang()

DWARFASTParserClang::~DWARFASTParserClang ( )
overridedefault

Member Function Documentation

◆ AddUnnamedBitfieldToRecordTypeIfNeeded()

void DWARFASTParserClang::AddUnnamedBitfieldToRecordTypeIfNeeded ( lldb_private::ClangASTImporter::LayoutInfo & class_layout_info,
const lldb_private::CompilerType & class_clang_type,
const FieldInfo & previous_field,
const FieldInfo & current_field )
private

Tries to detect whether class_clang_type contained an unnamed bit-field between previous_field and current_field, and if so, adds a clang::FieldDecl representing that bit-field to class_clang_type.

This is necessary because Clang (and GCC) doesn't emit a DW_TAG_member entry for unnamed bit-fields. So we derive it (with some exceptions), by checking whether there is a gap between where the storage of a DW_TAG_member ended and the subsequent DW_TAG_member began.

Parameters
[in,out]layout_infoLayout information of all decls parsed by the current parser. Will contain an entry for the unnamed bit-field if this function created one.
[in]class_clang_typeThe RecordType to which the unnamed bit-field will be added (if any).
[in]previous_fieldFieldInfo of the previous DW_TAG_member we parsed.
[in]current_fieldFieldInfo of the current DW_TAG_member being parsed.

Definition at line 3829 of file DWARFASTParserClang.cpp.

References lldb_private::TypeSystemClang::AddFieldToRecordType(), DWARFASTParserClang::FieldInfo::bit_offset, lldb::eAccessPublic, lldb::eEncodingSint, lldb_private::ClangASTImporter::LayoutInfo::field_offsets, DWARFASTParserClang::FieldInfo::GetEffectiveFieldEnd(), DWARFASTParserClang::FieldInfo::IsBitfield(), m_ast, and ShouldCreateUnnamedBitfield().

Referenced by ParseSingleMember().

◆ classof()

bool DWARFASTParserClang::classof ( const DWARFASTParser * Parser)
inlinestaticprotected

◆ CompleteEnumType()

◆ CompleteRecordType()

bool DWARFASTParserClang::CompleteRecordType ( const lldb_private::plugin::dwarf::DWARFDIE & die,
const lldb_private::CompilerType & clang_type )
private

◆ CompleteTypeFromDWARF()

◆ ConstructDemangledNameFromDWARF()

◆ CopyUniqueClassMethodTypes()

◆ CreateStaticMemberVariable()

void DWARFASTParserClang::CreateStaticMemberVariable ( const lldb_private::plugin::dwarf::DWARFDIE & die,
const MemberAttributes & attrs,
const lldb_private::CompilerType & class_clang_type )
private

◆ EnsureAllDIEsInDeclContextHaveBeenParsed()

void DWARFASTParserClang::EnsureAllDIEsInDeclContextHaveBeenParsed ( lldb_private::CompilerDeclContext decl_context)
overridevirtual

◆ ExtractIntFromFormValue()

llvm::Expected< llvm::APInt > DWARFASTParserClang::ExtractIntFromFormValue ( const lldb_private::CompilerType & int_type,
const lldb_private::plugin::dwarf::DWARFFormValue & form_value ) const

Extracts an value for a given Clang integer type from a DWARFFormValue.

Parameters
int_typeThe Clang type that defines the bit size and signedness of the integer that should be extracted. Has to be either an integer type or an enum type. For enum types the underlying integer type will be considered as the expected integer type that should be extracted.
form_valueThe DWARFFormValue that contains the integer value.
Returns
An APInt containing the same integer value as the given DWARFFormValue with the bit width of the given integer type. Returns an error if the value in the DWARFFormValue does not fit into the given integer type or the integer type isn't supported.

Definition at line 2876 of file DWARFASTParserClang.cpp.

References lldb_private::TypeSystemClang::getASTContext(), lldb_private::ClangUtil::GetQualType(), lldb_private::CompilerType::GetTypeSystem(), lldb_private::plugin::dwarf::DWARFFormValue::Signed(), and lldb_private::plugin::dwarf::DWARFFormValue::Unsigned().

Referenced by CreateStaticMemberVariable().

◆ GetCachedClangDeclContextForDIE()

clang::DeclContext * DWARFASTParserClang::GetCachedClangDeclContextForDIE ( const lldb_private::plugin::dwarf::DWARFDIE & die)
protected

◆ GetClangASTImporter()

◆ GetClangDeclContextContainingDIE()

◆ GetClangDeclContextForDIE()

◆ GetClangDeclForDIE()

◆ GetDeclContextContainingUIDFromDWARF()

CompilerDeclContext DWARFASTParserClang::GetDeclContextContainingUIDFromDWARF ( const lldb_private::plugin::dwarf::DWARFDIE & die)
overridevirtual

◆ GetDeclContextForBlock()

◆ GetDeclContextForUIDFromDWARF()

CompilerDeclContext DWARFASTParserClang::GetDeclContextForUIDFromDWARF ( const lldb_private::plugin::dwarf::DWARFDIE & die)
overridevirtual

◆ GetDeclForUIDFromDWARF()

CompilerDecl DWARFASTParserClang::GetDeclForUIDFromDWARF ( const lldb_private::plugin::dwarf::DWARFDIE & die)
overridevirtual

◆ GetDIEClassTemplateParams()

std::string DWARFASTParserClang::GetDIEClassTemplateParams ( lldb_private::plugin::dwarf::DWARFDIE die)
overridevirtual

Returns the template parameters of a class DWARFDIE as a string.

This is mostly useful for -gsimple-template-names which omits template parameters from the DIE name and instead always adds template parameter children DIEs.

Parameters
dieThe struct/class DWARFDIE containing template parameters.
Returns
A string, including surrounding '<>', of the template parameters. If the DIE's name already has '<>', returns an empty string because it's assumed that the caller is using the DIE name anyway.

Implements lldb_private::plugin::dwarf::DWARFASTParser.

Definition at line 960 of file DWARFASTParserClang.cpp.

References lldb_private::plugin::dwarf::DWARFDIE::GetName(), and lldb_private::plugin::dwarf::DWARFDIE::GetReferencedDIE().

Referenced by GetUniqueTypeNameAndDeclaration().

◆ GetModuleForType()

lldb::ModuleSP DWARFASTParserClang::GetModuleForType ( const lldb_private::plugin::dwarf::DWARFDIE & die)
protected

◆ GetObjectParameter()

DWARFDIE DWARFASTParserClang::GetObjectParameter ( const lldb_private::plugin::dwarf::DWARFDIE & subprogram,
const lldb_private::plugin::dwarf::DWARFDIE & decl_ctx_die )

Get the object parameter DIE if one exists, otherwise returns a default DWARFDIE.

Parameters
[in]subprogramDIE of function for which to get the object parameter.
[in]containing_decl_ctxDIE representing declaration context of subprogram. If this DIE isn't a valid declaration context for class methods, assume no object parameter exists.
Returns
DIE of object parameter if one exists.

Definition at line 165 of file DWARFASTParserClang.cpp.

References lldb_private::plugin::dwarf::DWARFDIE::children(), lldb_private::plugin::dwarf::DWARFBaseDIE::GetAttributeValueAsUnsigned(), lldb_private::plugin::dwarf::DWARFBaseDIE::GetCU(), lldb_private::plugin::dwarf::DWARFDIE::GetDIE(), lldb_private::plugin::dwarf::DWARFDIE::GetName(), lldb_private::plugin::dwarf::DWARFDIE::IsStructUnionOrClass(), lldb_private::plugin::dwarf::DWARFFormValue::Reference(), lldb_private::plugin::dwarf::DWARFBaseDIE::Tag(), and lldb_private::plugin::dwarf::DWARFFormValue::Unsigned().

Referenced by ConstructDemangledNameFromDWARF(), and ParseSubroutine().

◆ GetOwningClangModule()

◆ GetUniqueTypeNameAndDeclaration()

◆ LinkDeclContextToDIE()

◆ LinkDeclToDIE()

void DWARFASTParserClang::LinkDeclToDIE ( clang::Decl * decl,
const lldb_private::plugin::dwarf::DWARFDIE & die )
protected

◆ MapDeclDIEToDefDIE()

◆ ParseArrayType()

◆ ParseChildEnumerators()

◆ ParseChildMembers()

◆ ParseChildParameters()

◆ ParseCXXMethod()

std::pair< bool, TypeSP > DWARFASTParserClang::ParseCXXMethod ( const lldb_private::plugin::dwarf::DWARFDIE & die,
lldb_private::CompilerType clang_type,
const ParsedDWARFTypeAttributes & attrs,
const lldb_private::plugin::dwarf::DWARFDIE & decl_ctx_die,
const lldb_private::plugin::dwarf::DWARFDIE & object_parameter,
bool & ignore_containing_context )
private

Helper function called by ParseSubroutine when parsing C++ methods.

Parameters
[in]dieThe DIE that represents the C++ method being parsed.
[in]clang_typeThe CompilerType representing the function prototype of the C++ method being parsed.
[in]attrsDWARF attributes for die.
[in]decl_ctx_dieThe DIE representing the DeclContext of the C++ method being parsed.
[in]object_parameterThe DIE of this subprogram's object parameter. May be an invalid DIE for C++ static methods.
[out]ignore_containing_contextWill get set to true if the caller should treat this C++ method as-if it was not a C++ method. Currently used as a hack to work around templated C++ methods causing class definitions to mismatch between CUs.
Returns
A pair of <bool, TypeSP>. The first element is 'true' on success. The second element is non-null if we have previously parsed this method (a null TypeSP does not indicate failure).

Definition at line 1174 of file DWARFASTParserClang.cpp.

References ParsedDWARFTypeAttributes::abstract_origin, ParsedDWARFTypeAttributes::accessibility, CopyUniqueClassMethodTypes(), DIE_IS_BEING_PARSED, lldb::eAccessNone, lldb::eAccessPublic, GetClangASTImporter(), GetClangDeclContextForDIE(), lldb_private::ConstString::GetCString(), lldb_private::TypeSystemClang::GetDeclContextForType(), lldb_private::plugin::dwarf::DWARFDIE::GetDIE(), lldb_private::plugin::dwarf::DWARFBaseDIE::GetDWARF(), lldb_private::Type::GetForwardCompilerType(), lldb_private::plugin::dwarf::DWARFBaseDIE::GetID(), lldb_private::UserID::GetID(), lldb_private::GetLog(), lldb_private::plugin::dwarf::DWARFDIE::GetName(), lldb_private::plugin::dwarf::DWARFBaseDIE::GetOffset(), lldb_private::CompilerType::GetOpaqueQualType(), lldb_private::plugin::dwarf::DWARFBaseDIE::HasChildren(), ParsedDWARFTypeAttributes::is_artificial, ParsedDWARFTypeAttributes::is_explicit, ParsedDWARFTypeAttributes::is_inline, ParsedDWARFTypeAttributes::is_virtual, IsClangModuleFwdDecl(), lldb_private::TypeSystemClang::IsCXXClassType(), lldb_private::plugin::dwarf::DWARFBaseDIE::IsValid(), lldb_private::plugin::dwarf::DWARFFormValue::IsValid(), LinkDeclContextToDIE(), LLDB_LOGF, lldb_private::Lookups, m_ast, MakeLLDBFuncAsmLabel(), ParsedDWARFTypeAttributes::name, PrepareContextToReceiveMembers(), lldb_private::plugin::dwarf::DWARFFormValue::Reference(), lldb_private::ClangASTMetadata::SetObjectPtrName(), lldb_private::ClangASTMetadata::SetUserID(), ParsedDWARFTypeAttributes::specification, and lldb_private::TypeCompletion.

Referenced by ParseSubroutine().

◆ ParseEnum()

TypeSP DWARFASTParserClang::ParseEnum ( const lldb_private::SymbolContext & sc,
const lldb_private::plugin::dwarf::DWARFDIE & die,
ParsedDWARFTypeAttributes & attrs )
private

◆ ParseFunctionFromDWARF()

◆ ParseInheritance()

void DWARFASTParserClang::ParseInheritance ( const lldb_private::plugin::dwarf::DWARFDIE & die,
const lldb_private::plugin::dwarf::DWARFDIE & parent_die,
const lldb_private::CompilerType class_clang_type,
const lldb::AccessType default_accessibility,
const lldb::ModuleSP & module_sp,
std::vector< std::unique_ptr< clang::CXXBaseSpecifier > > & base_classes,
lldb_private::ClangASTImporter::LayoutInfo & layout_info )
private

Parses a DW_TAG_inheritance DIE into a base/super class.

Parameters
dieThe DW_TAG_inheritance DIE to parse.
parent_dieThe parent DIE of the given DIE.
class_clang_typeThe C++/Objective-C class representing parent_die. For an Objective-C class this method sets the super class on success. For a C++ class this will not add the result as a base class.
default_accessibilityThe default accessibility that is given to base classes if they don't have an explicit accessibility set.
module_spThe current Module.
base_classesThe list of C++ base classes that will be appended with the parsed base class on success.
layout_infoThe layout information that will be updated for C++ base classes with the base offset.

Definition at line 1568 of file DWARFASTParserClang.cpp.

References lldb_private::plugin::dwarf::DWARFAttributes::AttributeAtIndex(), lldb_private::ClangASTImporter::LayoutInfo::base_offsets, lldb_private::plugin::dwarf::DWARFFormValue::Boolean(), ExtractDataMemberLocation(), lldb_private::plugin::dwarf::DWARFAttributes::ExtractFormValueAtIndex(), lldb_private::plugin::dwarf::DWARFASTParser::GetAccessTypeFromDWARF(), lldb_private::plugin::dwarf::DWARFBaseDIE::GetAttributes(), lldb_private::Type::GetFullCompilerType(), lldb_private::plugin::dwarf::DWARFBaseDIE::GetOffset(), lldb_private::CompilerType::GetOpaqueQualType(), lldb_private::CompilerType::GetTypeSystem(), lldb_private::TypeSystemClang::IsObjCObjectOrInterfaceType(), lldb_private::plugin::dwarf::DWARFFormValue::Reference(), lldb_private::plugin::dwarf::DWARFDIE::ResolveTypeUID(), lldb_private::plugin::dwarf::DWARFAttributes::Size(), and lldb_private::plugin::dwarf::DWARFFormValue::Unsigned().

Referenced by ParseChildMembers().

◆ ParseObjCMethod()

bool DWARFASTParserClang::ParseObjCMethod ( const lldb_private::ObjCLanguage::ObjCMethodName & objc_method,
const lldb_private::plugin::dwarf::DWARFDIE & die,
lldb_private::CompilerType clang_type,
const ParsedDWARFTypeAttributes & attrs,
bool is_variadic )
private

Helper function called by ParseSubroutine when parsing ObjC-methods.

Parameters
[in]objc_methodName of the ObjC method being parsed.
[in]dieThe DIE that represents the ObjC method being parsed.
[in]clang_typeThe CompilerType representing the function prototype of the ObjC method being parsed.
[in]attrsDWARF attributes for die.
[in]is_variadicIs true iff we're parsing a variadic method.
Returns
true on success

Definition at line 1127 of file DWARFASTParserClang.cpp.

References lldb_private::plugin::dwarf::DW_TAG_value_to_name(), lldb_private::ObjCLanguage::ObjCMethodName::GetClassName(), lldb_private::ConstString::GetCString(), lldb_private::plugin::dwarf::DWARFBaseDIE::GetDWARF(), lldb_private::plugin::dwarf::DWARFBaseDIE::GetID(), lldb_private::plugin::dwarf::DWARFBaseDIE::GetOffset(), ParsedDWARFTypeAttributes::is_artificial, ParsedDWARFTypeAttributes::is_objc_direct_call, lldb_private::TypeSystemClang::IsObjCObjectOrInterfaceType(), LinkDeclContextToDIE(), m_ast, ParsedDWARFTypeAttributes::name, and lldb_private::plugin::dwarf::DWARFBaseDIE::Tag().

Referenced by ParseSubroutine().

◆ ParseObjCProperty()

void DWARFASTParserClang::ParseObjCProperty ( const lldb_private::plugin::dwarf::DWARFDIE & die,
const lldb_private::plugin::dwarf::DWARFDIE & parent_die,
const lldb_private::CompilerType & class_clang_type,
DelayedPropertyList & delayed_properties )
private

Parses a DW_TAG_APPLE_property DIE and appends the parsed data to the list of delayed Objective-C properties.

Note: The delayed property needs to be finalized to actually create the property declarations in the module AST.

Parameters
dieThe DW_TAG_APPLE_property DIE that will be parsed.
parent_dieThe parent DIE.
class_clang_typeThe Objective-C class that will contain the created property.
delayed_propertiesThe list of delayed properties that the result will be appended to.

Definition at line 2840 of file DWARFASTParserClang.cpp.

References DWARFASTParserClang::MemberAttributes::encoding_form, lldb_private::plugin::dwarf::DWARFBaseDIE::GetDWARF(), lldb_private::plugin::dwarf::DWARFBaseDIE::GetID(), lldb_private::Type::GetLayoutCompilerType(), lldb_private::ModuleChild::GetModule(), lldb_private::SymbolFileCommon::GetObjectFile(), lldb_private::plugin::dwarf::DWARFBaseDIE::GetOffset(), lldb_private::plugin::dwarf::DWARFFormValue::Reference(), lldb_private::plugin::dwarf::DWARFDIE::ResolveTypeUID(), lldb_private::ClangASTMetadata::SetUserID(), and lldb_private::plugin::dwarf::DWARFBaseDIE::Tag().

Referenced by ParseChildMembers().

◆ ParsePointerToMemberType()

◆ ParseRustVariantPart()

void DWARFASTParserClang::ParseRustVariantPart ( lldb_private::plugin::dwarf::DWARFDIE & die,
const lldb_private::plugin::dwarf::DWARFDIE & parent_die,
const lldb_private::CompilerType & class_clang_type,
const lldb::AccessType default_accesibility,
lldb_private::ClangASTImporter::LayoutInfo & layout_info )
private

Parses DW_TAG_variant_part DIE into a structure that encodes all variants Note that this is currently being emitted by rustc and not Clang.

Parameters
dieDW_TAG_variant_part DIE to parse
parent_dieThe parent DW_TAG_structure_type to parse
class_clang_typeThe Rust struct representing parent_die.
default_accesibilityThe default accessibility that is given to base classes if they don't have an explicit accessibility set
layout_infoThe layout information that will be updated for

Definition at line 3866 of file DWARFASTParserClang.cpp.

References lldb::eAccessPublic, lldb::eLanguageTypeRust, lldb_private::ClangASTImporter::LayoutInfo::field_offsets, lldb_private::plugin::dwarf::DWARFBaseDIE::GetCU(), lldb_private::plugin::dwarf::DWARFBaseDIE::GetDWARF(), lldb_private::plugin::dwarf::SymbolFileDWARF::GetLanguage(), lldb_private::ModuleChild::GetModule(), lldb_private::SymbolFileCommon::GetObjectFile(), lldb_private::CompilerType::GetTypeName(), m_ast, lldb_private::plugin::dwarf::DWARFDIE::ResolveTypeUID(), and lldb_private::plugin::dwarf::DWARFBaseDIE::Tag().

Referenced by ParseChildMembers().

◆ ParseSingleMember()

void DWARFASTParserClang::ParseSingleMember ( const lldb_private::plugin::dwarf::DWARFDIE & die,
const lldb_private::plugin::dwarf::DWARFDIE & parent_die,
const lldb_private::CompilerType & class_clang_type,
lldb::AccessType default_accessibility,
lldb_private::ClangASTImporter::LayoutInfo & layout_info,
FieldInfo & last_field_info )
private

Definition at line 2971 of file DWARFASTParserClang.cpp.

References DWARFASTParserClang::MemberAttributes::accessibility, lldb_private::TypeSystemClang::AddFieldToRecordType(), AddUnnamedBitfieldToRecordTypeIfNeeded(), DWARFASTParserClang::FieldInfo::bit_offset, DWARFASTParserClang::MemberAttributes::bit_offset, DWARFASTParserClang::FieldInfo::bit_size, DWARFASTParserClang::MemberAttributes::bit_size, DWARFASTParserClang::MemberAttributes::byte_size, CreateStaticMemberVariable(), DWARFASTParserClang::MemberAttributes::data_bit_offset, lldb_private::plugin::dwarf::DW_TAG_value_to_name(), lldb::eAccessNone, lldb::eByteOrderLittle, DWARFASTParserClang::MemberAttributes::encoding_form, lldb_private::ClangASTImporter::LayoutInfo::field_offsets, lldb_private::plugin::dwarf::DWARFBaseDIE::GetAttributeValueAsUnsigned(), lldb_private::ObjectFile::GetByteOrder(), lldb_private::Type::GetByteSize(), lldb_private::CompilerType::GetCompleteType(), lldb_private::plugin::dwarf::DWARFBaseDIE::GetCU(), lldb_private::plugin::dwarf::DWARFBaseDIE::GetDWARF(), DWARFASTParserClang::FieldInfo::GetEffectiveFieldEnd(), DWARFASTParserClang::FieldInfo::GetFieldEnd(), lldb_private::plugin::dwarf::DWARFBaseDIE::GetID(), lldb_private::Type::GetLayoutCompilerType(), lldb_private::ModuleChild::GetModule(), lldb_private::SymbolFileCommon::GetObjectFile(), lldb_private::plugin::dwarf::DWARFBaseDIE::GetOffset(), GetUnitName(), DWARFASTParserClang::MemberAttributes::is_artificial, DWARFASTParserClang::FieldInfo::is_bitfield, DWARFASTParserClang::MemberAttributes::is_declaration, lldb_private::CompilerType::IsArrayType(), DWARFASTParserClang::FieldInfo::IsBitfield(), lldb_private::CompilerType::IsCompleteType(), lldb_private::TypeSystemClang::IsObjCObjectOrInterfaceType(), m_ast, DWARFASTParserClang::MemberAttributes::member_byte_offset, DWARFASTParserClang::MemberAttributes::name, DWARFASTParserClang::FieldInfo::NextBitfieldOffsetIsValid(), lldb_private::plugin::dwarf::DWARFFormValue::Reference(), lldb_private::TypeSystemClang::RequireCompleteType(), lldb_private::plugin::dwarf::DWARFDIE::ResolveTypeUID(), DWARFASTParserClang::FieldInfo::SetEffectiveFieldEnd(), DWARFASTParserClang::FieldInfo::SetIsArtificial(), DWARFASTParserClang::FieldInfo::SetIsBitfield(), ShouldIgnoreArtificialField(), lldb_private::plugin::dwarf::DWARFUnit::Supports_unnamed_objc_bitfields(), lldb_private::plugin::dwarf::DWARFBaseDIE::Tag(), UINT32_MAX, and UINT64_MAX.

Referenced by ParseChildMembers().

◆ ParseStructureLikeDIE()

TypeSP DWARFASTParserClang::ParseStructureLikeDIE ( const lldb_private::SymbolContext & sc,
const lldb_private::plugin::dwarf::DWARFDIE & die,
ParsedDWARFTypeAttributes & attrs )
protected

Parse a structure, class, or union type DIE.

Definition at line 1752 of file DWARFASTParserClang.cpp.

References ParsedDWARFTypeAttributes::accessibility, lldb_private::ConstString::AsCString(), ParsedDWARFTypeAttributes::byte_size, ParsedDWARFTypeAttributes::calling_convention, ParsedDWARFTypeAttributes::class_language, DEBUG_PRINTF, ParsedDWARFTypeAttributes::decl, DeclKindIsCXXClass(), lldb_private::plugin::dwarf::DW_TAG_value_to_name(), lldb::eAccessNone, lldb::eAccessPrivate, lldb::eAccessPublic, lldb_private::Type::eEncodingIsUID, lldb::eLanguageTypeObjC, lldb::eLanguageTypeObjC_plus_plus, ParsedDWARFTypeAttributes::exports_symbols, lldb_private::plugin::dwarf::SymbolFileDWARFDebugMap::FindCompleteObjCDefinitionTypeForDIE(), lldb_private::Type::Forward, GetCachedClangDeclContextForDIE(), GetClangASTImporter(), GetClangDeclContextContainingDIE(), lldb_private::ConstString::GetCString(), lldb_private::plugin::dwarf::DWARFBaseDIE::GetCU(), lldb_private::TypeSystemClang::GetDeclContextForType(), lldb_private::plugin::dwarf::DWARFDIE::GetDIE(), lldb_private::plugin::dwarf::DWARFBaseDIE::GetDIERef(), lldb_private::plugin::dwarf::DWARFBaseDIE::GetDWARF(), lldb_private::plugin::dwarf::DWARFBaseDIE::GetID(), lldb_private::plugin::dwarf::SymbolFileDWARF::GetLanguage(), lldb_private::GetLog(), lldb_private::CompilerType::GetOpaqueQualType(), GetOwningClangModule(), GetUniqueTypeNameAndDeclaration(), ParsedDWARFTypeAttributes::is_complete_objc_class, ParsedDWARFTypeAttributes::is_forward_declaration, LinkDeclContextToDIE(), LLDB_INVALID_UID, lldb_private::Lookups, m_ast, ParsedDWARFTypeAttributes::name, ParseTemplateParameterInfos(), ParseTypeFromClangModule(), PrepareContextToReceiveMembers(), lldb_private::ClangUtil::RemoveFastQualifiers(), lldb_private::ClangASTMetadata::SetIsDynamicCXXType(), lldb_private::ClangASTMetadata::SetUserID(), lldb_private::plugin::dwarf::DWARFBaseDIE::Tag(), lldb_private::TypeCompletion, and UNUSED_IF_ASSERT_DISABLED.

Referenced by ParseTypeFromDWARF().

◆ ParseSubroutine()

TypeSP DWARFASTParserClang::ParseSubroutine ( const lldb_private::plugin::dwarf::DWARFDIE & die,
const ParsedDWARFTypeAttributes & attrs )
private

Definition at line 1307 of file DWARFASTParserClang.cpp.

References ParsedDWARFTypeAttributes::abstract_origin, ConvertDWARFCallingConventionToClang(), lldb_private::ObjCLanguage::ObjCMethodName::Create(), DEBUG_PRINTF, ParsedDWARFTypeAttributes::decl, DeclKindIsCXXClass(), lldb_private::plugin::dwarf::DW_TAG_value_to_name(), lldb::eBasicTypeVoid, lldb_private::Type::eEncodingIsUID, lldb_private::Type::Full, GetCachedClangDeclContextForDIE(), GetClangDeclContextContainingDIE(), GetCXXMethodCVQuals(), lldb_private::plugin::dwarf::DWARFBaseDIE::GetDWARF(), lldb_private::Type::GetForwardCompilerType(), lldb_private::plugin::dwarf::DWARFBaseDIE::GetID(), lldb_private::GetLog(), lldb_private::plugin::dwarf::DWARFDIE::GetName(), GetObjectParameter(), GetOwningClangModule(), lldb_private::ClangUtil::GetQualType(), lldb_private::ConstString::GetStringRef(), lldb_private::plugin::dwarf::DWARFBaseDIE::HasChildren(), ParsedDWARFTypeAttributes::is_inline, lldb_private::plugin::dwarf::DWARFFormValue::IsValid(), LinkDeclContextToDIE(), LLDB_INVALID_UID, LLDB_LOGF, lldbassert, lldb_private::Lookups, m_ast, MakeLLDBFuncAsmLabel(), ParsedDWARFTypeAttributes::mangled_name, ParsedDWARFTypeAttributes::name, ParseChildParameters(), ParseCXXMethod(), ParseObjCMethod(), ParseTemplateParameterInfos(), ParsedDWARFTypeAttributes::ref_qual, lldb_private::plugin::dwarf::DWARFFormValue::Reference(), lldb_private::ClangASTMetadata::SetObjectPtrName(), lldb_private::ClangASTMetadata::SetUserID(), ParsedDWARFTypeAttributes::storage, lldb_private::plugin::dwarf::DWARFBaseDIE::Tag(), ParsedDWARFTypeAttributes::type, and lldb_private::TypeCompletion.

Referenced by ParseTypeFromDWARF().

◆ ParseTemplateDIE()

◆ ParseTemplateParameterInfos()

◆ ParseTypeFromClangModule()

◆ ParseTypeFromDWARF()

◆ ParseTypeModifier()

lldb::TypeSP DWARFASTParserClang::ParseTypeModifier ( const lldb_private::SymbolContext & sc,
const lldb_private::plugin::dwarf::DWARFDIE & die,
ParsedDWARFTypeAttributes & attrs )
private

Definition at line 734 of file DWARFASTParserClang.cpp.

References ParsedDWARFTypeAttributes::byte_size, lldb_private::plugin::dwarf::DWARFDIE::children(), lldb_private::plugin::dwarf::DWARFFormValue::Clear(), DEBUG_PRINTF, ParsedDWARFTypeAttributes::decl, lldb_private::plugin::dwarf::DW_TAG_value_to_name(), lldb::eBasicTypeNullPtr, lldb::eBasicTypeObjCClass, lldb::eBasicTypeObjCID, lldb::eBasicTypeObjCSel, lldb_private::Type::eEncodingIsAtomicUID, lldb_private::Type::eEncodingIsConstUID, lldb_private::Type::eEncodingIsLLVMPtrAuthUID, lldb_private::Type::eEncodingIsLValueReferenceUID, lldb_private::Type::eEncodingIsPointerUID, lldb_private::Type::eEncodingIsRestrictUID, lldb_private::Type::eEncodingIsRValueReferenceUID, lldb_private::Type::eEncodingIsTypedefUID, lldb_private::Type::eEncodingIsUID, lldb_private::Type::eEncodingIsVolatileUID, lldb::eLanguageTypeObjC, lldb::eLanguageTypeObjC_plus_plus, ParsedDWARFTypeAttributes::encoding, lldb_private::Type::Full, lldb_private::plugin::dwarf::DWARFBaseDIE::GetAttributeValueAsUnsigned(), GetClangASTImporter(), GetClangDeclContextContainingDIE(), lldb_private::ConstString::GetCString(), lldb_private::plugin::dwarf::DWARFBaseDIE::GetCU(), lldb_private::plugin::dwarf::DWARFBaseDIE::GetDWARF(), lldb_private::plugin::dwarf::DWARFBaseDIE::GetID(), lldb_private::plugin::dwarf::SymbolFileDWARF::GetLanguage(), lldb_private::GetLog(), lldb_private::plugin::dwarf::DWARFDIE::GetName(), lldb_private::plugin::dwarf::DWARFBaseDIE::GetOffset(), GetOwningClangModule(), GetPtrAuthMofidierPayload(), lldb_private::plugin::dwarf::DWARFDIE::GetReferencedDIE(), lldb_private::ConstString::GetStringRef(), lldb_private::plugin::dwarf::DWARFFormValue::IsValid(), lldb_private::Lookups, m_ast, ParsedDWARFTypeAttributes::name, ParseTypeFromClangModule(), ParseTypeFromDWARF(), PrepareContextToReceiveMembers(), lldb_private::plugin::dwarf::DWARFFormValue::Reference(), lldb_private::plugin::dwarf::DWARFBaseDIE::Tag(), ParsedDWARFTypeAttributes::type, lldb_private::TypeCompletion, and lldb_private::Type::Unresolved.

Referenced by ParseTypeFromDWARF().

◆ ResolveBlockDIE()

◆ ResolveImportedDeclarationDIE()

clang::NamespaceDecl * DWARFASTParserClang::ResolveImportedDeclarationDIE ( const lldb_private::plugin::dwarf::DWARFDIE & die)
protected

Returns the namespace decl that a DW_TAG_imported_declaration imports.

Parameters
[in]dieThe import declaration to resolve. If the DIE is not a DW_TAG_imported_declaration the behaviour is undefined.
Returns
The decl corresponding to the namespace that the specified 'die' imports. If the imported entity is not a namespace or another import declaration, returns nullptr. If an error occurs, returns nullptr.

Definition at line 3575 of file DWARFASTParserClang.cpp.

References lldb_private::plugin::dwarf::DWARFDIE::GetAttributeValueAsReferenceDIE(), lldb_private::plugin::dwarf::DWARFDIE::GetDIE(), LinkDeclContextToDIE(), m_die_to_decl_ctx, ResolveImportedDeclarationDIE(), ResolveNamespaceDIE(), and lldb_private::plugin::dwarf::DWARFBaseDIE::Tag().

Referenced by GetClangDeclContextForDIE(), and ResolveImportedDeclarationDIE().

◆ ResolveNamespaceDIE()

◆ ShouldCreateUnnamedBitfield()

bool DWARFASTParserClang::ShouldCreateUnnamedBitfield ( FieldInfo const & last_field_info,
uint64_t last_field_end,
FieldInfo const & this_field_info,
lldb_private::ClangASTImporter::LayoutInfo const & layout_info ) const
private

Returns 'true' if we should create an unnamed bitfield and add it to the parser's current AST.

Parameters
[in]last_field_infoFieldInfo of the previous DW_TAG_member we parsed.
[in]last_field_endOffset (in bits) where the last parsed field ended.
[in]this_field_infoFieldInfo of the current DW_TAG_member being parsed.
[in]layout_infoLayout information of all decls parsed by the current parser.

Definition at line 3797 of file DWARFASTParserClang.cpp.

References lldb_private::ClangASTImporter::LayoutInfo::base_offsets, DWARFASTParserClang::FieldInfo::bit_offset, DWARFASTParserClang::FieldInfo::bit_size, and DWARFASTParserClang::FieldInfo::IsArtificial().

Referenced by AddUnnamedBitfieldToRecordTypeIfNeeded().

◆ UpdateSymbolContextScopeForType()

Member Data Documentation

◆ m_ast

◆ m_clang_ast_importer_up

std::unique_ptr<lldb_private::ClangASTImporter> DWARFASTParserClang::m_clang_ast_importer_up
protected

Definition at line 155 of file DWARFASTParserClang.h.

Referenced by GetClangASTImporter().

◆ m_decl_ctx_to_die

DeclContextToDIEMap DWARFASTParserClang::m_decl_ctx_to_die
protected

◆ m_die_to_decl

DIEToDeclMap DWARFASTParserClang::m_die_to_decl
protected

Definition at line 151 of file DWARFASTParserClang.h.

Referenced by GetClangDeclForDIE().

◆ m_die_to_decl_ctx

◆ m_die_to_module

DIEToModuleMap DWARFASTParserClang::m_die_to_module
protected

Definition at line 154 of file DWARFASTParserClang.h.

Referenced by GetOwningClangModule().


The documentation for this class was generated from the following files: