================
@@ -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
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to