<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/146393>146393</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[NFC][HLSL] Move resource range logic from `SemaHLSL` to `RootSignatureValidations`
</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 the work to abstract out the logic of detecting resource range overlap from `SemaHLSL` into the `RootSignatureValidations` library.
This logic includes the detection of if the `ResourceClass`, `space` and `visibility` are overlapping and thus the underlying ranges overlap contained in the `handleHLSLRootSignatureDecl` function [here](https://github.com/llvm/llvm-project/blob/de7c2f29405ff08a91a34bc0f152cfa1cd0d9801/clang/lib/Sema/SemaHLSL.cpp#L1080).
This is a non-functional change, but it will require a slight change to the `RangeInfo` structure such that each `RangeInfo` can be mapped back to its `RootElement`. The proposed solution is to use an `Index` on each `RangeInfo` that will retain this.
AC:
- [ ] Update `RangeInfo` to have an `Index` field that can be used to map back to its relevant diagnostic information
- [ ] Move the validation logic from `SemaHLSL` to `RootSignatureValidations`
- [ ] Update `SemaHLSL` to use the new interface for the validations
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJykVEtv4zYQ_jX0ZRCDoiTHOujgJDW6QNpDs-19RA4ldmlS5cNp_n1BWU43j6IoehJEceZ7jL7BGM3oiHrW3jEhjBvIGsmEYO3DBnOafOjXw83g1Uv_dTIRTIyZIAWU3yKkieDZh2-QPOAQy2kCn9PywfrRSPAaFCWSybgRAkWfgyQI6EYCf6ZgcQYd_AnYjj_RCX98fHpkOw7GJb-0YTv-i_fpyYwOUw70G1qjMBnvYrlnzRAwvGwZPzB-WChegI2TNiu6kFwpeFf4GP3aeOVzbzGWbkzcl-M4o6TSHJ0q72cTzWCsSS_LYXhlPhdR5VKa8gUoO0XBvixii8b4KlJ6l9A4UmDcFX9CpywVyW8kPpC0BUlndyHN2ruJArH2gYn9lNIcWX1g4sjEcTRpysNW-hMTR2vP18fNHPzvJBMTx8H6gYmjolsptOga3mrN99hVWDeD5LpqhdRYScVVt-cVE0dp0Y2lkSmFZSzro1Ddynlmon6s-J4z0X3vvImA4Ly7uTJHC3IqPhRnh5zAJHg21kKgP7IJBAjRmnFK6zX4bujl_YvTvjgRU8iyWAMxywnShAkI5fThokQHA8EJ55kUDCiXf9OkeP2PfrB0IpfYjm_h60QwBz_7SAqit3kx28RSkiMBulL1xSn6s_T27nPMhc2qqowY0mTiasvhvkyKH27KDIG1D_DrrDB9VJg8THj-gKkNWXVBWKXlQjb5IvGNvkCWzugSKIOj8zEtGdA-nJawvOHwkz_T4vP5NUxraj6LYvL_EsJ_0PeuR3G0YDp6LummoFESaB_eMYkb1deqqzvcUF_dtlXNm24vNlMv9xob4p1qpCasudBNtSO5l7umqRTuN6YXXLR8V_Pqtt4JsdVt29VDQ7ruKtm1xBpOJzR2WyKy9WHcLPusr5pd3dUbiwPZuC7EhfplG4Z-idSQx8gabk1M8e8OySS7LNGfj_cloe3dUnm1-d3O-x82b3Kw_X9O_yIwMnFcNZ578VcAAAD__8p8-IA">