Skip to content

Commit b2f5a17

Browse files
committed
Fix enum's underlying type retrieval
1 parent 5290832 commit b2f5a17

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2328,8 +2328,8 @@ size_t DWARFASTParserClang::ParseChildEnumerators(
23282328
if (!NumPositiveBits && !NumNegativeBits)
23292329
NumPositiveBits = 1;
23302330

2331-
clang::QualType qual_type(ClangUtil::GetQualType(clang_type));
2332-
clang::EnumDecl *enum_decl = qual_type->getAs<clang::EnumType>()->getDecl();
2331+
clang::EnumDecl *enum_decl =
2332+
ClangUtil::GetQualType(clang_type)->getAs<clang::EnumType>()->getDecl();
23332333
enum_decl->setNumPositiveBits(NumPositiveBits);
23342334
enum_decl->setNumNegativeBits(NumNegativeBits);
23352335

@@ -2368,7 +2368,8 @@ size_t DWARFASTParserClang::ParseChildEnumerators(
23682368
} else {
23692369
BestWidth = Context.getTargetInfo().getLongLongWidth();
23702370
}
2371-
BestPromotionType = (BestWidth <= IntWidth ? Context.IntTy : qual_type);
2371+
BestPromotionType =
2372+
BestWidth <= IntWidth ? Context.IntTy : enum_decl->getIntegerType();
23722373
} else {
23732374
// If there is no negative value, figure out the smallest type that fits
23742375
// all of the enumerator values.

0 commit comments

Comments
 (0)