[clang] [clang][Sema] Move computing enum width and type to a separate function (PR #120965)

via cfe-commits cfe-commits at lists.llvm.org
Tue Jan 14 10:41:56 PST 2025


================
@@ -1726,6 +1726,12 @@ class ASTContext : public RefCountedBase<ASTContext> {
 
   QualType getEnumType(const EnumDecl *Decl) const;
 
+  /// Compute BestType and BestPromotionType for an enum based on the highest
+  /// number of negative and positive bits of its elements.
+  bool computeBestEnumTypes(bool isPacked, unsigned NumNegativeBits,
----------------
Sirraide wrote:

nit: maybe also mention that it returns `true` if there is no suitable integer type.

https://github.com/llvm/llvm-project/pull/120965


More information about the cfe-commits mailing list