Skip to content

Commit 88abe76

Browse files
committed
Move the computing code into the 'if' block
1 parent fe6a395 commit 88abe76

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8474,20 +8474,20 @@ bool TypeSystemClang::CompleteTagDeclarationDefinition(
84748474
if (enum_decl->isCompleteDefinition())
84758475
return true;
84768476

8477-
clang::ASTContext &ast = lldb_ast->getASTContext();
8477+
QualType integer_type(enum_decl->getIntegerType());
8478+
if (!integer_type.isNull()) {
8479+
clang::ASTContext &ast = lldb_ast->getASTContext();
84788480

8479-
unsigned NumNegativeBits = 0;
8480-
unsigned NumPositiveBits = 0;
8481-
ast.computeEnumBits(enum_decl->enumerators(), NumNegativeBits,
8482-
NumPositiveBits);
8481+
unsigned NumNegativeBits = 0;
8482+
unsigned NumPositiveBits = 0;
8483+
ast.computeEnumBits(enum_decl->enumerators(), NumNegativeBits,
8484+
NumPositiveBits);
84838485

8484-
clang::QualType BestPromotionType;
8485-
clang::QualType BestType;
8486-
ast.computeBestEnumTypes(/*IsPacked=*/false, NumNegativeBits, NumPositiveBits,
8487-
BestType, BestPromotionType);
8486+
clang::QualType BestPromotionType;
8487+
clang::QualType BestType;
8488+
ast.computeBestEnumTypes(/*IsPacked=*/false, NumNegativeBits,
8489+
NumPositiveBits, BestType, BestPromotionType);
84888490

8489-
QualType integer_type(enum_decl->getIntegerType());
8490-
if (!integer_type.isNull()) {
84918491
enum_decl->completeDefinition(enum_decl->getIntegerType(),
84928492
BestPromotionType, NumPositiveBits,
84938493
NumNegativeBits);

0 commit comments

Comments
 (0)