[all-commits] [llvm/llvm-project] b0627c: [HLSL] Reject unbounded resource array and noinlin...
Kaitlin Peng via All-commits
all-commits at lists.llvm.org
Thu Jul 9 15:22:05 PDT 2026
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: b0627c0c94bd93b6e9e6dcedb2e7bfa69e6f4052
https://github.com/llvm/llvm-project/commit/b0627c0c94bd93b6e9e6dcedb2e7bfa69e6f4052
Author: Kaitlin Peng <kaitlinpeng at microsoft.com>
Date: 2026-07-09 (Thu, 09 Jul 2026)
Changed paths:
M clang/include/clang/Basic/DiagnosticSemaKinds.td
M clang/lib/Sema/SemaDecl.cpp
A clang/test/SemaHLSL/Resources/resource_params_noinline.hlsl
M clang/test/SemaHLSL/Resources/unbounded_resource_arrays.hlsl
Log Message:
-----------
[HLSL] Reject unbounded resource array and noinline function resource parameters (#208111)
Fixes #180808.
This issue involved two bugs:
- `noinline` functions accepted resource parameters in the frontend,
which crashed the backend since valid DXIL cannot be generated for
resources passed across a function call. This change adds a new check in
`SemaDecl.cpp` that rejects resource parameters on `noinline` functions,
as well as a new `resource_params_noinline.hlsl` test.
- The check for incomplete resource array parameters queried the array's
element type to decide if it was a resource. When the parameter was the
first use of the resource type, the element was still incomplete and
wouldn't register as a resource, so the check would be skipped and the
compiler would later crash. This change fixes the check to now force
element completion with `isCompleteType` before querying the type, and
updates `unbounded_resource_arrays.hlsl` to test this.
This change also fixes the `unbounded_resource_arrays.hlsl` test in
general; the `not` in the RUN command was inverting the result and
hiding an actual failure (one of the expected error messages was
misspelled).
Assisted by: Github Copilot
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