Skip to content

[lldb][DWARFASTParserClang] GetCXXObjectParameter to take DeclContext DIE parameter #144876

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -163,14 +163,14 @@ static bool TagIsRecordType(dw_tag_t tag) {
/// a default DWARFDIE. If \c containing_decl_ctx is not a valid
/// C++ declaration context for class methods, assume no object
/// parameter exists for the given \c subprogram.
static DWARFDIE
GetCXXObjectParameter(const DWARFDIE &subprogram,
const clang::DeclContext &containing_decl_ctx) {
static DWARFDIE GetCXXObjectParameter(const DWARFDIE &subprogram,
const DWARFDIE &decl_ctx_die) {
assert(subprogram);
assert(subprogram.Tag() == DW_TAG_subprogram ||
subprogram.Tag() == DW_TAG_inlined_subroutine ||
subprogram.Tag() == DW_TAG_subroutine_type);

if (!DeclKindIsCXXClass(containing_decl_ctx.getDeclKind()))
if (!decl_ctx_die.IsStructUnionOrClass())
return {};

if (DWARFDIE object_parameter =
Expand Down Expand Up @@ -1304,8 +1304,7 @@ DWARFASTParserClang::ParseSubroutine(const DWARFDIE &die,
clang::CallingConv calling_convention =
ConvertDWARFCallingConventionToClang(attrs);

const DWARFDIE object_parameter =
GetCXXObjectParameter(die, *containing_decl_ctx);
const DWARFDIE object_parameter = GetCXXObjectParameter(die, decl_ctx_die);

// clang_type will get the function prototype clang type after this
// call
Expand Down Expand Up @@ -2411,12 +2410,13 @@ DWARFASTParserClang::ConstructDemangledNameFromDWARF(const DWARFDIE &die) {
DWARFDeclContext decl_ctx = die.GetDWARFDeclContext();
sstr << decl_ctx.GetQualifiedName();

DWARFDIE decl_ctx_die;
clang::DeclContext *containing_decl_ctx =
GetClangDeclContextContainingDIE(die, nullptr);
GetClangDeclContextContainingDIE(die, &decl_ctx_die);
assert(containing_decl_ctx);

const unsigned cv_quals = GetCXXMethodCVQuals(
die, GetCXXObjectParameter(die, *containing_decl_ctx));
const unsigned cv_quals =
GetCXXMethodCVQuals(die, GetCXXObjectParameter(die, decl_ctx_die));

ParseChildParameters(containing_decl_ctx, die, is_variadic,
has_template_params, param_types, param_names);
Expand Down
Loading