<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/147799>147799</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            [HLSL][RootSignature] Simplify and Audit `RootSignatureParser` Diagnostics
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            HLSL
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
            inbelic
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          inbelic
      </td>
    </tr>
</table>

<pre>
    This issue tracks a final "polishing/auditing" of the diagnostics produced in `RootSignatureParser` diagnostics.

Namely, 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](https://github.com/llvm/llvm-project/pull/147350#discussion_r2193717272) and [here](https://github.com/llvm/llvm-project/pull/145827#discussion_r2169406679).

As part of addressing this, it was also discovered that there was some test gaps in the diagnostics produced for enum/flags. This issue will also track the implementation of this as well.

This issue is resolved when we have split the current uses of `diag::err_hlsl_unexpected_end_of_params` into separate more direct cases, and also extend the use of such to enum/flag parsing.

AC:
- [ ] Removes all uses of `diag::err_hlsl_unexpected_end_of_params` in `RootSigantureParser`
- [ ] Introduce a new more direct diagnostic for an invalid value/param of the RootSignature
- [ ] In each of these cases, replace the diagnostic with either the new diagnostic or `diag::err_expected` accordingly
- [ ] Update `HLSLRootSignatureParserTest` to account for diagnostic changes
- [ ] Increase test coverage of `HLSLRootSignatureParserTest` for enum/flag diagnostics
- [ ] Increase test coverage of `RootSignatures-err` for enum/flag diagnostics
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJysVc2O4zYTfBr60lhDpiRrdNDBs4bxfcAiCHY2Z6NFtiQmNCmwKXvn7QNyPBl7Nsnm72RBtKq6u6qayGxGR9SJ-lFIaVxP1ighpaj3K1zi5EN3fbnqvX7uvkyGwTAvBDGg-oUBYTAOLQgpZ28NT8aNQh5w0SbmRwl-gDgRaIOj8xy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