<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/108307>108307</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[Support] Subcommand support in `OptTable`
</td>
</tr>
<tr>
<th>Labels</th>
<td>
llvm:support
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
Prabhuk
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
petrhosek
</td>
</tr>
</table>
<pre>
There's a number of LLVM tools that use subcommands and thus cannot use `OptTable` even though it'd be a better fit for their needs.
This came up for example in https://github.com/llvm/llvm-project/pull/101461#discussion_r1700688501.
We should implement subcommands support in [`OptTable`](https://github.com/llvm/llvm-project/blob/828783177f71d95522763fba92ef1e42dc6101c7/llvm/lib/Option/OptTable.cpp) to bring it to parity with [`cl::opt`](https://github.com/llvm/llvm-project/blob/828783177f71d95522763fba92ef1e42dc6101c7/llvm/lib/Support/CommandLine.cpp).
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzEk01v_CYQxj8NvoxqweDXgw_brvaUKpUStccK7PFCg43FS9p8-8rebJs95vS_wEjAzG8enlEx2utKNLD6Z4b4W1Da5DeGyOpzoXIyPgwbpWB8pLdC--ljeDUUiGEbQcGaF00B_AxPT7__Csl7FyEZlSBHgpj16JdFrVMEtU6QTI4wqnX1t3PW8OctvSrtiDUc6J1WSMbnqwGbGLYTaAIFmlKiALNNMPsAyZANsBJNsQTGz4yfbuursXv6hSBvx036Ry2bI7ArmJS2yOSJ4YXh5WqTyboc_cLw4tz7fftpC_4vGhPDy5adY3gRXFSNYCgnG8cco_Xrn0G0nDddV3NRfq3_B0E0PrsJ7F52oTU9SBDztvmQdpxd7YfmWX1m2H2bUjuvGV467NpOiradWzH1dY3YNnLWqkeaBVU4jY3gYmy_5LH7u-ctWb_egoOkHLeNYQ_Jgw52vYJNe7ypYNMH_G2T-UQf3Y4pT35LP4z-5aYnw8svN4mf7HrvoCymQU697FVBg2ix4X1XtXVhhqrrtBQNYicbqqmqx1l0rdSyqceJZl3YATlWvBcCZdXWddlyKbGpscFeTDRpVnFalHXlTlP6cC1sjJkGwTvJ28IpTS5-DtQBLE_xjnrMVRgOIXS-RlZxZ2OK_-dKNrljHO_t1Wd4-c9FDyZ6cFCRgxu-_QUHeTyMfsC_D_hvAAAA__-7P0qG">