diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp b/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp index 6602dd763ba69..dca193fc11b55 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp +++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp @@ -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 " @@ -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;