Skip to content

[HLSL][RootSignature] Allow for multiple parsing errors in RootSignatureParser #145818

@inbelic

Description

@inbelic

At the moment, the RootSignatureParser will early exit when it encounters it's first error. To be more in line with Clang error parsing, and to hopefully reduce the number of compile cycles for users, we can modify the parser to continue looking for parsing errors even after we encounter the first one.

We will do this at the granularity of a RootElement. To do so we will add a new interface onto RootSignatureParser, namely, skipUntilExpectedToken. This will be used to consume all the intermediate tokens between when an error has occured and when the next RootElement begins.

At this granularity, the implementation is quite 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. Then continue the loop.

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.

AC:

  • Update HLSLRootSignatureParser with a skipUntilExpectedToken interface
  • Update parse loop to use the skip interface when an error is found on parsing a root element
  • Add test-cases to demonstrate multiple error being reported

Metadata

Metadata

Assignees

Labels

HLSLHLSL Language Support

Type

No type

Projects

Status

Closed

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions