Skip to content

Commit 6c08eff

Browse files
committed
Fix nits
1 parent c5f1dcf commit 6c08eff

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

clang/include/clang/AST/ASTContext.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1728,7 +1728,8 @@ class ASTContext : public RefCountedBase<ASTContext> {
17281728

17291729
/// Compute BestType and BestPromotionType for an enum based on the highest
17301730
/// number of negative and positive bits of its elements.
1731-
bool computeBestEnumTypes(bool isPacked, unsigned NumNegativeBits,
1731+
/// Returns true if enum width is too large.
1732+
bool computeBestEnumTypes(bool IsPacked, unsigned NumNegativeBits,
17321733
unsigned NumPositiveBits, QualType &BestType,
17331734
QualType &BestPromotionType);
17341735

clang/include/clang/Sema/Sema.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3987,7 +3987,6 @@ class Sema final : public SemaBase {
39873987
SourceLocation IdLoc, IdentifierInfo *Id,
39883988
const ParsedAttributesView &Attrs,
39893989
SourceLocation EqualLoc, Expr *Val);
3990-
39913990
void ActOnEnumBody(SourceLocation EnumLoc, SourceRange BraceRange,
39923991
Decl *EnumDecl, ArrayRef<Decl *> Elements, Scope *S,
39933992
const ParsedAttributesView &Attr);

clang/lib/AST/ASTContext.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5209,7 +5209,7 @@ QualType ASTContext::getEnumType(const EnumDecl *Decl) const {
52095209
return QualType(newType, 0);
52105210
}
52115211

5212-
bool ASTContext::computeBestEnumTypes(bool isPacked, unsigned NumNegativeBits,
5212+
bool ASTContext::computeBestEnumTypes(bool IsPacked, unsigned NumNegativeBits,
52135213
unsigned NumPositiveBits,
52145214
QualType &BestType,
52155215
QualType &BestPromotionType) {
@@ -5222,11 +5222,11 @@ bool ASTContext::computeBestEnumTypes(bool isPacked, unsigned NumNegativeBits,
52225222
// If there is a negative value, figure out the smallest integer type (of
52235223
// int/long/longlong) that fits.
52245224
// If it's packed, check also if it fits a char or a short.
5225-
if (isPacked && NumNegativeBits <= CharWidth &&
5225+
if (IsPacked && NumNegativeBits <= CharWidth &&
52265226
NumPositiveBits < CharWidth) {
52275227
BestType = SignedCharTy;
52285228
BestWidth = CharWidth;
5229-
} else if (isPacked && NumNegativeBits <= ShortWidth &&
5229+
} else if (IsPacked && NumNegativeBits <= ShortWidth &&
52305230
NumPositiveBits < ShortWidth) {
52315231
BestType = ShortTy;
52325232
BestWidth = ShortWidth;
@@ -5251,11 +5251,11 @@ bool ASTContext::computeBestEnumTypes(bool isPacked, unsigned NumNegativeBits,
52515251
// If there is no negative value, figure out the smallest type that fits
52525252
// all of the enumerator values.
52535253
// If it's packed, check also if it fits a char or a short.
5254-
if (isPacked && NumPositiveBits <= CharWidth) {
5254+
if (IsPacked && NumPositiveBits <= CharWidth) {
52555255
BestType = UnsignedCharTy;
52565256
BestPromotionType = IntTy;
52575257
BestWidth = CharWidth;
5258-
} else if (isPacked && NumPositiveBits <= ShortWidth) {
5258+
} else if (IsPacked && NumPositiveBits <= ShortWidth) {
52595259
BestType = UnsignedShortTy;
52605260
BestPromotionType = IntTy;
52615261
BestWidth = ShortWidth;

clang/lib/Sema/SemaDecl.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20096,7 +20096,7 @@ void Sema::ActOnEnumBody(SourceLocation EnumLoc, SourceRange BraceRange,
2009620096

2009720097
BestWidth = Context.getIntWidth(BestType);
2009820098
} else {
20099-
const bool EnumTooLarge = Context.computeBestEnumTypes(
20099+
bool EnumTooLarge = Context.computeBestEnumTypes(
2010020100
Packed, NumNegativeBits, NumPositiveBits, BestType, BestPromotionType);
2010120101
BestWidth = Context.getIntWidth(BestType);
2010220102
if (EnumTooLarge)

0 commit comments

Comments
 (0)