[all-commits] [llvm/llvm-project] 420041: [HLSL] Add NativeInt16Type langopt to control whet...

Sarah Spall via All-commits all-commits at lists.llvm.org
Fri Oct 31 09:49:53 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 42004193f4e22a61dc68f6414b82077edd1314e2
      https://github.com/llvm/llvm-project/commit/42004193f4e22a61dc68f6414b82077edd1314e2
  Author: Sarah Spall <sarahspall at microsoft.com>
  Date:   2025-10-31 (Fri, 31 Oct 2025)

  Changed paths:
    M clang/include/clang/Basic/LangOptions.def
    M clang/include/clang/Driver/Options.td
    M clang/lib/Driver/ToolChains/Clang.cpp
    M clang/lib/Driver/ToolChains/HLSL.cpp
    M clang/lib/Frontend/CompilerInvocation.cpp
    M clang/lib/Frontend/InitPreprocessor.cpp
    M clang/lib/Parse/ParseDecl.cpp
    M clang/test/AST/HLSL/packoffset.hlsl
    M clang/test/AST/HLSL/vk.spec-constant.usage.hlsl
    M clang/test/CodeGenHLSL/BasicFeatures/StructElementwiseCast.hlsl
    M clang/test/CodeGenHLSL/BasicFeatures/frem_modulo.hlsl
    M clang/test/CodeGenHLSL/HLSLControlFlowHint.hlsl
    M clang/test/CodeGenHLSL/Operators/logical-not.hlsl
    M clang/test/CodeGenHLSL/basic_types.hlsl
    M clang/test/CodeGenHLSL/builtins/WaveActiveAllTrue.hlsl
    M clang/test/CodeGenHLSL/builtins/WaveActiveAnyTrue.hlsl
    M clang/test/CodeGenHLSL/builtins/WaveReadLaneAt.hlsl
    M clang/test/CodeGenHLSL/builtins/abs.hlsl
    M clang/test/CodeGenHLSL/builtins/acos.hlsl
    M clang/test/CodeGenHLSL/builtins/all.hlsl
    M clang/test/CodeGenHLSL/builtins/any.hlsl
    M clang/test/CodeGenHLSL/builtins/asfloat.hlsl
    M clang/test/CodeGenHLSL/builtins/asin.hlsl
    M clang/test/CodeGenHLSL/builtins/asint.hlsl
    M clang/test/CodeGenHLSL/builtins/asint16.hlsl
    M clang/test/CodeGenHLSL/builtins/asuint.hlsl
    M clang/test/CodeGenHLSL/builtins/asuint16.hlsl
    M clang/test/CodeGenHLSL/builtins/atan.hlsl
    M clang/test/CodeGenHLSL/builtins/atan2.hlsl
    M clang/test/CodeGenHLSL/builtins/ceil.hlsl
    M clang/test/CodeGenHLSL/builtins/clamp-builtin.hlsl
    M clang/test/CodeGenHLSL/builtins/clamp-overloads.hlsl
    M clang/test/CodeGenHLSL/builtins/clamp.hlsl
    M clang/test/CodeGenHLSL/builtins/clip-builtin.hlsl
    M clang/test/CodeGenHLSL/builtins/clip.hlsl
    M clang/test/CodeGenHLSL/builtins/cos.hlsl
    M clang/test/CodeGenHLSL/builtins/cosh.hlsl
    M clang/test/CodeGenHLSL/builtins/countbits.hlsl
    M clang/test/CodeGenHLSL/builtins/cross.hlsl
    M clang/test/CodeGenHLSL/builtins/degrees-builtin.hlsl
    M clang/test/CodeGenHLSL/builtins/degrees.hlsl
    M clang/test/CodeGenHLSL/builtins/distance.hlsl
    M clang/test/CodeGenHLSL/builtins/dot-builtin.hlsl
    M clang/test/CodeGenHLSL/builtins/dot.hlsl
    M clang/test/CodeGenHLSL/builtins/dot2add.hlsl
    M clang/test/CodeGenHLSL/builtins/dst.hlsl
    M clang/test/CodeGenHLSL/builtins/exp.hlsl
    M clang/test/CodeGenHLSL/builtins/exp2.hlsl
    M clang/test/CodeGenHLSL/builtins/faceforward.hlsl
    M clang/test/CodeGenHLSL/builtins/firstbithigh.hlsl
    M clang/test/CodeGenHLSL/builtins/firstbitlow.hlsl
    M clang/test/CodeGenHLSL/builtins/floor.hlsl
    M clang/test/CodeGenHLSL/builtins/fmod.hlsl
    M clang/test/CodeGenHLSL/builtins/frac-builtin.hlsl
    M clang/test/CodeGenHLSL/builtins/frac.hlsl
    M clang/test/CodeGenHLSL/builtins/isinf.hlsl
    M clang/test/CodeGenHLSL/builtins/isnan.hlsl
    M clang/test/CodeGenHLSL/builtins/ldexp.hlsl
    M clang/test/CodeGenHLSL/builtins/length.hlsl
    M clang/test/CodeGenHLSL/builtins/lerp-builtin.hlsl
    M clang/test/CodeGenHLSL/builtins/lerp-overloads.hlsl
    M clang/test/CodeGenHLSL/builtins/lerp.hlsl
    M clang/test/CodeGenHLSL/builtins/lit.hlsl
    M clang/test/CodeGenHLSL/builtins/log.hlsl
    M clang/test/CodeGenHLSL/builtins/log10.hlsl
    M clang/test/CodeGenHLSL/builtins/log2.hlsl
    M clang/test/CodeGenHLSL/builtins/mad.hlsl
    M clang/test/CodeGenHLSL/builtins/max-overloads.hlsl
    M clang/test/CodeGenHLSL/builtins/max.hlsl
    M clang/test/CodeGenHLSL/builtins/min-overloads.hlsl
    M clang/test/CodeGenHLSL/builtins/min.hlsl
    M clang/test/CodeGenHLSL/builtins/normalize-builtin.hlsl
    M clang/test/CodeGenHLSL/builtins/normalize.hlsl
    M clang/test/CodeGenHLSL/builtins/pow.hlsl
    M clang/test/CodeGenHLSL/builtins/radians-builtin.hlsl
    M clang/test/CodeGenHLSL/builtins/radians.hlsl
    M clang/test/CodeGenHLSL/builtins/rcp-builtin.hlsl
    M clang/test/CodeGenHLSL/builtins/rcp.hlsl
    M clang/test/CodeGenHLSL/builtins/reflect.hlsl
    M clang/test/CodeGenHLSL/builtins/refract.hlsl
    M clang/test/CodeGenHLSL/builtins/reversebits.hlsl
    M clang/test/CodeGenHLSL/builtins/round.hlsl
    M clang/test/CodeGenHLSL/builtins/rsqrt-builtin.hlsl
    M clang/test/CodeGenHLSL/builtins/rsqrt.hlsl
    M clang/test/CodeGenHLSL/builtins/saturate-builtin.hlsl
    M clang/test/CodeGenHLSL/builtins/saturate.hlsl
    M clang/test/CodeGenHLSL/builtins/sign.hlsl
    M clang/test/CodeGenHLSL/builtins/sin.hlsl
    M clang/test/CodeGenHLSL/builtins/sinh.hlsl
    M clang/test/CodeGenHLSL/builtins/smoothstep.hlsl
    M clang/test/CodeGenHLSL/builtins/splitdouble.hlsl
    M clang/test/CodeGenHLSL/builtins/sqrt.hlsl
    M clang/test/CodeGenHLSL/builtins/step.hlsl
    M clang/test/CodeGenHLSL/builtins/tan.hlsl
    M clang/test/CodeGenHLSL/builtins/tanh.hlsl
    M clang/test/CodeGenHLSL/builtins/transpose-builtin.hlsl
    M clang/test/CodeGenHLSL/builtins/trunc.hlsl
    M clang/test/CodeGenHLSL/enable-16bit-types.hlsl
    M clang/test/CodeGenHLSL/float3.hlsl
    M clang/test/CodeGenHLSL/no_int_promotion.hlsl
    M clang/test/CodeGenHLSL/resources/RasterizerOrderedStructuredBuffer-elementtype.hlsl
    M clang/test/CodeGenHLSL/resources/StructuredBuffers-elementtype.hlsl
    M clang/test/CodeGenHLSL/resources/TypedBuffers-elementtype.hlsl
    M clang/test/CodeGenHLSL/resources/cbuffer.hlsl
    M clang/test/CodeGenHLSL/vk-features/vk.spec-constant.hlsl
    A clang/test/Driver/dxc_enable16bittypes.hlsl
    M clang/test/Options/enable_16bit_types_validation_spirv.hlsl
    M clang/test/Preprocessor/predefined-macros-hlsl.hlsl
    M clang/test/SemaHLSL/BuiltIns/AddUint64-errors.hlsl
    M clang/test/SemaHLSL/BuiltIns/all-errors.hlsl
    M clang/test/SemaHLSL/BuiltIns/any-errors.hlsl
    M clang/test/SemaHLSL/BuiltIns/asfloat-errors.hlsl
    M clang/test/SemaHLSL/BuiltIns/asint-errors.hlsl
    M clang/test/SemaHLSL/BuiltIns/asint16-errors.hlsl
    M clang/test/SemaHLSL/BuiltIns/asuint-errors.hlsl
    M clang/test/SemaHLSL/BuiltIns/asuint16-errors.hlsl
    M clang/test/SemaHLSL/BuiltIns/clamp-errors-16bit.hlsl
    M clang/test/SemaHLSL/BuiltIns/clamp-errors.hlsl
    M clang/test/SemaHLSL/BuiltIns/clip-errors.hlsl
    M clang/test/SemaHLSL/BuiltIns/countbits-errors.hlsl
    M clang/test/SemaHLSL/BuiltIns/cross-errors.hlsl
    M clang/test/SemaHLSL/BuiltIns/distance-errors.hlsl
    M clang/test/SemaHLSL/BuiltIns/dot-errors.hlsl
    M clang/test/SemaHLSL/BuiltIns/dot2add-errors.hlsl
    M clang/test/SemaHLSL/BuiltIns/exp-errors.hlsl
    M clang/test/SemaHLSL/BuiltIns/faceforward-errors.hlsl
    M clang/test/SemaHLSL/BuiltIns/firstbithigh-errors.hlsl
    M clang/test/SemaHLSL/BuiltIns/firstbitlow-errors.hlsl
    M clang/test/SemaHLSL/BuiltIns/fmod-errors.hlsl
    M clang/test/SemaHLSL/BuiltIns/frac-errors.hlsl
    M clang/test/SemaHLSL/BuiltIns/half-float-only-errors.hlsl
    M clang/test/SemaHLSL/BuiltIns/half-float-only-errors2.hlsl
    M clang/test/SemaHLSL/BuiltIns/isinf-errors.hlsl
    M clang/test/SemaHLSL/BuiltIns/isnan-errors.hlsl
    M clang/test/SemaHLSL/BuiltIns/ldexp-errors.hlsl
    M clang/test/SemaHLSL/BuiltIns/length-errors.hlsl
    M clang/test/SemaHLSL/BuiltIns/lerp-errors.hlsl
    M clang/test/SemaHLSL/BuiltIns/mad-errors.hlsl
    M clang/test/SemaHLSL/BuiltIns/matrix-basic_types-errors.hlsl
    M clang/test/SemaHLSL/BuiltIns/max-errors-16bit.hlsl
    M clang/test/SemaHLSL/BuiltIns/min-errors-16bit.hlsl
    M clang/test/SemaHLSL/BuiltIns/normalize-errors.hlsl
    M clang/test/SemaHLSL/BuiltIns/radians-errors.hlsl
    M clang/test/SemaHLSL/BuiltIns/rcp-errors.hlsl
    M clang/test/SemaHLSL/BuiltIns/reflect-errors.hlsl
    M clang/test/SemaHLSL/BuiltIns/refract-errors.hlsl
    M clang/test/SemaHLSL/BuiltIns/reversebits-errors.hlsl
    M clang/test/SemaHLSL/BuiltIns/round-errors.hlsl
    M clang/test/SemaHLSL/BuiltIns/rsqrt-errors.hlsl
    M clang/test/SemaHLSL/BuiltIns/saturate-errors.hlsl
    M clang/test/SemaHLSL/BuiltIns/sign-errors.hlsl
    M clang/test/SemaHLSL/BuiltIns/smoothstep-errors.hlsl
    M clang/test/SemaHLSL/BuiltIns/splitdouble-errors.hlsl
    M clang/test/SemaHLSL/BuiltIns/step-errors.hlsl
    M clang/test/SemaHLSL/Operators/logical-not.hlsl
    M clang/test/SemaHLSL/Types/Arithmetic/half_size.hlsl
    A clang/test/SemaHLSL/Types/short-errors.hlsl
    M clang/test/SemaHLSL/Types/typedefs.hlsl
    M clang/test/SemaHLSL/VectorOverloadResolution.hlsl

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

Add a new langopt NativeInt16Type to control support for 16 bit
integers.
Enable by default for all languages but HLSL. 
HLSL defines uint16_t and int16_t as a typedef of short. If
-enable-16bit-types is not used, the typedefs don't exist so int16_t and
uint16_t can't be used. However, short was still allowed. This change
will produce an error 'unknown type name short' if -enable-16bit-types
isn't used.
Update failing tests. 
Add new test.
Closes #81779



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list