[clang] [HLSL] Add NativeInt16Type langopt to control whether short type is supported. Enabled by default for all but HLSL. (PR #165584)

Justin Bogner via cfe-commits cfe-commits at lists.llvm.org
Thu Oct 30 10:24:48 PDT 2025


================
@@ -4614,12 +4615,16 @@ bool CompilerInvocation::ParseLangArgs(LangOptions &Opts, ArgList &Args,
           Diags.Report(diag::err_drv_hlsl_bad_shader_unsupported)
               << VulkanEnv << T.getOSName() << T.str();
         }
-        if (Args.getLastArg(OPT_fnative_half_type)) {
+        if (Args.getLastArg(OPT_fnative_half_type) ||
+            Args.getLastArg(OPT_fnative_int16_type)) {
----------------
bogner wrote:

We should probably add the `-fnative-int16-type` to `clang/test/Options/enable_16bit_types_validation_spirv.hlsl` for completeness here (I don't think we need to necessarily test every possible combination of flags for different error messages though)

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


More information about the cfe-commits mailing list