Skip to content

Commit e91e0f5

Browse files
authored
[CodeGen][NFCI] Don't re-implement parts of ASTContext::getIntWidth (#101765)
ASTContext::getIntWidth returns 1 if isBooleanType(), and falls back on getTypeSize in the default case, which itself just returns the Width from getTypeInfo's returned struct, so can be used in all cases here, not just for _BitInt types.
1 parent f7ad495 commit e91e0f5

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

clang/lib/CodeGen/CGBuiltin.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -756,9 +756,7 @@ static WidthAndSignedness
756756
getIntegerWidthAndSignedness(const clang::ASTContext &context,
757757
const clang::QualType Type) {
758758
assert(Type->isIntegerType() && "Given type is not an integer.");
759-
unsigned Width = Type->isBooleanType() ? 1
760-
: Type->isBitIntType() ? context.getIntWidth(Type)
761-
: context.getTypeInfo(Type).Width;
759+
unsigned Width = context.getIntWidth(Type);
762760
bool Signed = Type->isSignedIntegerType();
763761
return {Width, Signed};
764762
}

0 commit comments

Comments
 (0)