[clang] [Clang] speed up -Wassign-enum via enumerator caching (PR #176560)
Erich Keane via cfe-commits
cfe-commits at lists.llvm.org
Thu Jan 29 06:07:30 PST 2026
================
@@ -3544,6 +3544,10 @@ class Sema final : public SemaBase {
/// attribute.
mutable llvm::DenseMap<const EnumDecl *, llvm::APInt> FlagBitsCache;
+ /// A cache of enumerator values for enums checked by -Wassign-enum.
+ llvm::DenseMap<const EnumDecl *, llvm::SmallVector<llvm::APSInt, 64>>
----------------
erichkeane wrote:
IF you omit the size, SmallVector makes 'best guess', which is usually 4. Probably worth just leaving it blank unless we have a REALLY good reason.
https://github.com/llvm/llvm-project/pull/176560
More information about the cfe-commits
mailing list