<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/145819>145819</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[HLSL][RootSignature] Retain `SourceLocation` of `RootElement` for use in Diags with `SemaHLSL`
</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>
At the moment, when we report diagnostics from `SemaHLSL` we only provide the source location of the attr. This allows for significantly less helpful diagnostics (for eg. reporting resource range overlaps).
This issue tracks implementing a way to retain the source location of a root element when it is parsed, so that we can output its `SourceLocation` in the diagnostics produce during semantic analysis.
Potential solutions:
- [ ] Using a `DenseMap` to point from a `RootElement` to its `SourceLocation`
- [ ] Creating a wrapper `clang::hlsl::RootElement` struct that wraps the `llvm::hlsl::rootsig::RootElement` equivalent, that will hold all additional diagnostic data that wouldn't be available to `llvm::hlsl:rootsig::RootElement`.
A potential solution should be listed as a proposed solution before it is ready for refinement.
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJx8VM2O4zYMfhrlQkygKLF3fPAhs2nQwxQodtoHoC3aVitLrkgnyNsXsl3s7nR2Twkskt8Pf5DZ9YGoVsWLMsaFhrxrlTGquOxwliGmevu4a6J91GcBGQjGOFIQZT7DfaAAd4JEU0wC1mEfIotrGboUR1ClfqMRf319e1WlzpEx-AdMKd6cpaUYxzm1BD62KC4GiN3yGUXSHv4YHAN6H-8MXUyQ-brOtRjEP8ATMwzkp27232Er85yjqd9vzFzoIdEGlTD0BPFGyePEylR7pc9KnxcwxzwTSML2bwY3Tp6y1pyPcMcHSIREgi78iDxCilGA1sTVISfgGCZMTDbbxhFkQMl-tBggzjLNAk54MWyp-bqVzLZtYN8qnFK0c0tg55S5MY0YxLWAAf2DHW-Sfo-S2aMHjn7O9Vgd88MTqOIFVHGBP3kVp0p9ocD0G04ZUyJM0QVZ-7g8f4lRflllbRE_YvwdwOdE-J-BCaeJUs5pPYY-czmeB89-_fcOgSXNrWxWJZx4sUGV2vvb-D43u86u_7AQ_TO7G_ptaNd6znsYord5vACtdZk7fjtHYFFwi46zt0GZTwINAd7QeWw8ZQ8-ovMTLltjzjD9rzXAQ4bJCN6xkAVkwNzqKTLZr3ENdTHRNlWJ0D6W5UjUubDg7He2PtrqWOGO6sOnQj9Xpan0bqhRl0353Nju2LWmq06VtlV7bPXBVt2pssedq402hS5NqbU-FXpvD6ai6nDoTIklVpU6aRrR-X1WvY-p3y0rUx9OxfOh2nlsyPN2UZa9X89JqnP8UzP3rE466-OvFcSJX67QklBcVPGSXXtzfUCZE-Ux-rJu3YcLErsP5jNbMjPl7bk47BnuToZ3F2k3J18PItOyFuaqzLV3MszNvo2jMtels-vP05TiX9SKMtdFMCtz3TTfavNvAAAA__-Gk8hw">