[clang] [clang] Improve diagnostics for vector builtins (PR #125673)
Chris B via cfe-commits
cfe-commits at lists.llvm.org
Tue Feb 18 06:13:38 PST 2025
================
@@ -12411,16 +12411,13 @@ def err_builtin_is_within_lifetime_invalid_arg : Error<
"%select{non-|function }0pointer argument to '__builtin_is_within_lifetime' "
"is not allowed">;
-def err_builtin_invalid_arg_type: Error <
- "%ordinal0 argument must be "
- "%select{a vector, integer or floating point type|a matrix|"
- "a pointer to a valid matrix element type|"
- "a signed integer or floating point type|a vector type|"
- "a floating point type|"
- "a vector of integers|"
- "an unsigned integer|"
- "an 'int'|"
- "a vector of floating points}1 (was %2)">;
+def err_builtin_invalid_arg_type: Error<
+ "%ordinal0 argument must be a"
+ "%select{| scalar| vector| vector,| vector of| scalar or vector of}1"
+ "%select{| integer| signed integer| unsigned integer| 'int'|"
+ " matrix| pointer to a valid matrix element}2"
----------------
llvm-beanz wrote:
Should `matrix` be here or in the first select?
Logically I would think of the usage for this as: "argument index", "data dimensions (scalar/vector/matrix)", "type".
For HLSL we are planning builtins that will accept "scalar, vector, or matrix of 16 or 32-bit floating point type". Not that you need to handle that case today, but it would be nice if it was something we could build upon.
https://github.com/llvm/llvm-project/pull/125673
More information about the cfe-commits
mailing list