<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/101736>101736</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[HLSL] Add warning and remove export functions in non-library shaders
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
hekota
</td>
</tr>
</table>
<pre>
Export functions in non-library shaders should not be included in compiled shader code. If an export function is found in a non-library shader we should report a warning and remove it.
Current behavior:
```
export void foo() {}
[numthreads(4,1,1)]
void csmain() {}
```
https://godbolt.org/z/x1f11Mqdj
**DXC**: Export function is not included in the compiled shader. No warning.
**Clang**: Export function in included in the compiled shader. No warning.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyUU09vnD4Q_TTmMgqyZ4GFA4fNbtDvJ6W99NKrwQM4NfbWNpukn76CEDWbRlUrmb-eee953owMQQ-WqGb5LctPiZzj6Hw90jcXZdI69VzfPZ2dj9DPtova2QDagnX2xujWS_8MYZSKfIAwutkosC5CS6BtZ2ZFaonu3HTWhtQWCp1TlML_PUgLdI0OOkDvZrvmyQ944JFemTytqRIepbfaDiDt8nNyFwIdU8ZPjB9e7sfZe7KLsFFetPNsd3i7zQq-rfVz03RxWkHvHMOSYQVsf8v2p6u0_NbOUxw9SRUYlhnDo3i5KpZvoStKFyap7UdA18xjjOewiMOGYTM41ToTU-cHhs0Phs2T6IX49F09XMnAZZ2-Hl9e2O4Ad79XdfHlrSlxpPfGpPDZvRYzfYt9NNIOf0C3_4ScqHqnql0lE6rFHrHAnFc8GetS7GRWIZWZzBQve04o231ZdBUvu0KIRNfIMeMlR1HmpeBppnrZ5yUhx0II3rKM0yS1SY25TEvdEh3CTLXgYr8rEiNbMmHtdURLj7DuMsSl9X29JN208xBYxo0OMfyCiTqadUj-u_9yz_ITHJT6qO_o74Ylmb2p35mt4zi3aecmhs3Cuz1uzt49UBcZNqvawLDZjnOp8WcAAAD__8mmMLk">