<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/145814>145814</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[HLSL][RootSignature] Fix formatting of puncuator Tokens in `LexHLSL`
</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>
There is a bug in the diagnostic output of `ParseHLSLRootSignature` when outputting a punctuator. Instead of outputting the string literal of the token `','` it instead will treat it as an integer and output the ascii value.
Proposed solution:
Update the following switch statement to have a separate macro for `PUNCUATOR` that will output a string literal of the character as opposed to just the character.
https://github.com/llvm/llvm-project/blob/b413bea4355e51e3f3ff248b7d62b4d5d712c743/clang/include/clang/Lex/LexHLSLRootSignature.h#L46-L56
For instance: https://godbolt.org/z/vbY717qMh
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJyUU02P3DYM_TXyhcjAI1v-OPgwycJogWkbJLuHHmmLtpVqJFeiZ9P--kIeB8226KEXyaDJx_coPozRzI6oE-q9kNK4gawZhZRCPWW48eJDdwSzwes_uueFAoGJgDBsMxgHvBBog7Pzkc0IfuN1Y_ATiCr_iCHSD9fP10_e82czO-QtkKhyeF3IHbls3AwI6-ZG3pB9OMGPLjKhTijf5aROkUP6tIYpoE0JKcr-N3KpoZC1kB_SWeVgGMwB9GqsBQ6EnKIYAR0YxzRTAHT6G-uEhXE0Bu5oNzqJ_CLyy8fgVx9JQ_R2Y-OdKC6PPy-rRqa9bPLW-tfELb4aHheIjEw3cgzsYcE7AUKkFUOquOEYPEw-7FN6-fnDy-X5l0-JNC_ID7oHJ_wPzeOCAUdOAiL49cGQPXzZIr9NOGQszGtM1GUvZD8bXrbhNPqbkL2192_XuzX4LzSykP1g_ZCu8lwMhGWhFKkzFVMxTbJshlpXcii10vVZjnVZCNmPFt0sZG_caDdN30Wu9PVx_msbTouQxbWs3l1V9SDa-7A_HLqRRHGBfxD3evCWTz4k3D-F7O_Dr_W5_v2nJdNdoduixYy6c63yplWlbLOlq1o1tJPSU6GwnaioEJtmKqd8RD01TZWZTuZS5ZVUslC5bE9FU1dqGJpc6hrzthRlTjc09pRmlHpnJsaNunOpmnOZWRzIxsNFSeJhodDtMx22OYoytyZy_BuBDdvdeXuBehLq_VufqCfozde0Jjd8WMBPu092m8Bz2vqYPCiq_BitqPJsC7b734-9y4lC9oeieyf_CgAA__-snlt_">