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

via cfe-commits cfe-commits at lists.llvm.org
Mon Jan 13 10:11:30 PST 2025


================
@@ -20008,6 +20008,87 @@ bool Sema::IsValueInFlagEnum(const EnumDecl *ED, const llvm::APInt &Val,
   return !(FlagMask & Val) || (AllowMask && !(FlagMask & ~Val));
 }
 
+bool Sema::ComputeBestEnumProperties(ASTContext &Context, EnumDecl *Enum,
+                                     bool is_cpp, bool isPacked,
----------------
Sirraide wrote:

Moving the function into `EnumDecl` would probably work, but considering how many occurences of `Context.` there are in the function, it feels more like it really does belong in `ASTContext`.

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


More information about the cfe-commits mailing list