[all-commits] [llvm/llvm-project] a6494a: [HLSL][RootSignature] Allow for multiple parsing e...

Finn Plummer via All-commits all-commits at lists.llvm.org
Sun Jul 13 22:23:07 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: a6494a3bbf0620ec472d44db4e79c4c508618a61
      https://github.com/llvm/llvm-project/commit/a6494a3bbf0620ec472d44db4e79c4c508618a61
  Author: Finn Plummer <finn.c.plum at gmail.com>
  Date:   2025-07-13 (Sun, 13 Jul 2025)

  Changed paths:
    M clang/include/clang/Parse/ParseHLSLRootSignature.h
    M clang/lib/Parse/ParseHLSLRootSignature.cpp
    M clang/test/SemaHLSL/RootSignature-err.hlsl

  Log Message:
  -----------
  [HLSL][RootSignature] Allow for multiple parsing errors in `RootSignatureParser` (#147832)

This pr implements returning multiple parsing errors at the granularity
of a `RootElement`

This is achieved by adding a new interface onto `RootSignatureParser`,
namely, `skipUntilExpectedToken`. This will be used to consume all the
intermediate tokens between when an error has occurred and when the next
`RootElement` begins.

At this granularity, the implementation is somewhat straight forward, as
we can just implement this `skip` function when we return from a
`parse[RootElement]` method and continue in the main `parse` loop. With
the exception that the `parseDescriptorTable` will also have to skip
ahead to the next expected closing `')'`.

If we want to provide any finer granularity, then the skip logic becomes
significantly more complicated. Skipping to the next root element will
provide a good ratio of user experience benefit to complexity of
implementation.

For more context see linked issue.

- Updates `HLSLRootSignatureParser` with a `skipUntilExpectedToken` and `skipUntilClosedParen`
interface
- Updates the `parse` loops to use the skip interface when an error is
found on parsing a root element
- Updates `parseDescriptorTable` to skip ahead to the next `')'` if it
was inside a clause
- Adds test-case to demonstrate multiple error being reported

Resolves: https://github.com/llvm/llvm-project/issues/145818



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