[clang] [clang] Increase VecLib bitfield size to 4 bits in CodeGenOptions.def (PR #108804)
Aaron Ballman via cfe-commits
cfe-commits at lists.llvm.org
Tue Sep 17 06:49:44 PDT 2024
================
@@ -375,8 +375,13 @@ ENUM_CODEGENOPT(Inlining, InliningMethod, 2, NormalInlining)
/// The maximum stack size a function can have to be considered for inlining.
VALUE_CODEGENOPT(InlineMaxStackSize, 32, UINT_MAX)
+// Ensure the VecLib bitfield has enough space for future vector libraries.
+// If new vector libraries are added beyond the current limit of 16, this static assertion will fail.
+static_assert(static_cast<int>(llvm::driver::VectorLibrary::NoLibrary) <= 16,
----------------
AaronBallman wrote:
This doesn't actually protect against anything because `NoLibrary` is the first enumerator, not the last one.
(Also, I suspect we're missing significant test coverage if we managed to add new libraries and zero tests failed as a result of the too-small bit-field.)
https://github.com/llvm/llvm-project/pull/108804
More information about the cfe-commits
mailing list