Skip to content

[lldb][TypeSystemClang] Fix enum signedness in CompleteEnumType #125203

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 4 commits into from
Jan 31, 2025
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
22 changes: 7 additions & 15 deletions lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1019,16 +1019,7 @@ TypeSP DWARFASTParserClang::ParseEnum(const SymbolContext &sc,
// Declaration DIE is inserted into the type map in ParseTypeFromDWARF
}


if (TypeSystemClang::StartTagDeclarationDefinition(clang_type)) {
if (def_die.HasChildren()) {
bool is_signed = false;
enumerator_clang_type.IsIntegerType(is_signed);
ParseChildEnumerators(clang_type, is_signed,
type_sp->GetByteSize(nullptr).value_or(0), def_die);
}
TypeSystemClang::CompleteTagDeclarationDefinition(clang_type);
} else {
if (!CompleteEnumType(def_die, type_sp.get(), clang_type)) {
dwarf->GetObjectFile()->GetModule()->ReportError(
"DWARF DIE at {0:x16} named \"{1}\" was not able to start its "
"definition.\nPlease file a bug and attach the file at the "
Expand Down Expand Up @@ -2221,13 +2212,14 @@ bool DWARFASTParserClang::CompleteRecordType(const DWARFDIE &die,
bool DWARFASTParserClang::CompleteEnumType(const DWARFDIE &die,
lldb_private::Type *type,
const CompilerType &clang_type) {
assert(clang_type.IsEnumerationType());

if (TypeSystemClang::StartTagDeclarationDefinition(clang_type)) {
if (die.HasChildren()) {
bool is_signed = false;
clang_type.IsIntegerType(is_signed);
ParseChildEnumerators(clang_type, is_signed,
if (die.HasChildren())
ParseChildEnumerators(clang_type,
clang_type.IsEnumerationIntegerTypeSigned(),
type->GetByteSize(nullptr).value_or(0), die);
}

TypeSystemClang::CompleteTagDeclarationDefinition(clang_type);
}
return (bool)clang_type;
Expand Down