[HLSL][RootSignature] Audit RootSignatureParser
diagnostic production
#147800
+558
−77
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pr audits the diagnostics produced in
RootSignatureParser
diagnostics.First, it has been noted more than once that the current
diag::err_hlsl_unexpected_end_of_params
is not direct and can be misleading. For instance, here and here.This pr address this by removing this diagnostic and replacing it with a more direct
diag::err_expected_either
. However, doing so removes the nuance between the case where it is a missing comma and when it was an invalid parameter.Hence, we introduce the
diag::err_hlsl_invalid_token
for the latter case, which does so in a direct way. Further, we can apply the same diagnostic to the parsing of parameter values.As part of this, we see that there was a test gap in testing the diagnostics produced from
diag::err_expected_after
and for the parsing of enum/flag values. As such, these are also addressed here to provide sufficient unit/sema test coverage.diag::err_hlsl_unexpected_end_of_params
inRootSigantureParser
diag::err_hlsl_invalid_token
to provide a direct diagnosticdiag::err_hlsl_invalid_token
ordiag::err_expected_either
accordinglyHLSLRootSignatureParserTest
to account for diagnostic changesHLSLRootSignatureParserTest
for enum/flag diagnosticsRootSignatures-err
for enum/flag diagnosticsdiag::err_expected_after
and add test to demonstrate usageResolves: #147799