<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/65682>65682</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[libc] Replace headergen with standalone utility
</td>
</tr>
<tr>
<th>Labels</th>
<td>
enhancement,
libc,
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
michaelrj-google
</td>
</tr>
</table>
<pre>
Currently LLVM-libc uses a tablegen based utility called headergen (sometimes hdrgen) to generate its headers based on what functions and headers are available for the target platform. This is fine for building libc in-tree, but causes difficulties for users that want to pull in just the libc slice (e.g. Fuchsia). It also causes build issues in-tree for runtimes builds that don't include the llvm directory.
Ideally we would do this replacement in several steps to ensure that it never breaks our users.
The first step is to make a utility that can consume the existing td spec files and command line arguments and output something functionally equivalent to the current headers.
The second step is to remove the current headergen, which can be done after the new headergen is feature complete and has been thoroughly broken in.
The third step would be to create a new format for the spec files that is suited for our needs. The existing tablegen syntax is more complex than we need for our relatively simple use case.
The fourth step is to support the new format in the new headergen. It will likely need to support both formats for a while.
The fifth step is to replace the td spec files with the new format spec files, finally replacing the last piece of tablegen.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJxsVcFy2zgM_Rr5golHpp3UPvjQTSYzneledjp7h0hIYkORWgKM67_fAaW4adOLNRYJvIeHBwiZ_RCJzs39X8390waLjCmfJ29HpJC_3w0pDYE2XXLX82PJmaKEK3z9-u_fd8F3FgoTA4JgF2igCB0yOSjig5crWAyBHIyEjrIeN-bIaSLxEzGMTt815gSSYKBIGYXAC68BvGZLES4jCvQlWvEpMmB0tzuYCfAVfVAK0KcMMhII5oEE5oDSpzxt4dvoGTxD7-Nyqys-OB8HqHX4eCeZqDGP0BUBi7Uw5_ve2xLEE9egwgopyuaCUZT4XEIAH-F7YanQNR8Hb0nLpe2whediR_bYmNMWvghg4PQGUWmAZy7EbywqVC5xkaneWEFdio35JOCjDcXRgh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