[clang] [clang][Sema] Move computing enum bits into a separate function (PR #126096)

Ilia Kuklin via cfe-commits cfe-commits at lists.llvm.org
Thu Feb 6 09:41:14 PST 2025


kuilpd wrote:

The code needs to be called from LLDB as well (#115005), so this is an NFC patch to move it to `ASTContext.h`, plus this cleans up a bit the code in `Sema::ActOnEnumBody`. 
`isRepresentableIntegerValue` also had to be moved to `ASTContext.h`, but since it requires `ASTContext` as a first argument anyway, it seems like it's a better location for this function anyway.
The only question is that `computeEnumBits` has a raw template in order to function with different collections that Sema and LLDB use, so the function has to be defined in the header. Can this be a problem?

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


More information about the cfe-commits mailing list