<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/112799>112799</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[DEBUGINFO] Add DILabel Functions to LLVM-C
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
tf2spi
</td>
</tr>
</table>
<pre>
Hello LLVM Team,
This is my first issue request in LLVM, so apologies if I've misspoken or acted poorly for any reason.
I'm currently using the LLVM-C bindings in a [PR for Odin Lang](https://github.com/odin-lang/Odin/pull/4385) and a really nice API in LLVM that's unfortunately missing in the C bindings is [llvm::DIBuilder::createLabel](https://llvm.org/doxygen/DIBuilder_8cpp_source.html#l00830) and [llvm::DIBuilder::insertLabel](https://llvm.org/doxygen/DIBuilder_8cpp_source.html#l01013) which are helpful when outputting debug info for various labels in Odin. There's even the [LLVMDILabelMetadataKind](https://llvm.org/doxygen/llvm-c_2DebugInfo_8h_source.html#l00187) kind but no way to actually make a DILabel from the C API as far as I'm aware.
For UNIX-like platforms, I was still able to link to the C++ function directly and use the C references which are wrappers around the C++ types. However, we have a build of the LLVM C DLL for Windows in the repo which does not export the C++ functions so it's not feasible right now to output debug info for labels on Windows.
In both cases, it would be more ideal if these were exported as C functions that we could then use in Odin. Programming languages with labels and whose compilers are written in C, whether now or in the future, would likely appreciate this as well.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyslU1v4zYQhn8NfRnEkClrLR98iO26azT7gSLb9hZQ4khkQ5EqP6z1vy-GtrNJu1j00IsNCeLMM_O-wxEh6N4ibli1ZdV-JlJUzm9ix8OoZ42T5817NMbBw8NvH-ARxcD4jhV7Vtxffh-VDqADDGfotA8RdAgJweNfCenJ5pOM7yA4EKMzrtcYQHdwZHx1Qhh0CKN7RgvOg2gjShid8-YMHb2wZ_AogrPz11np7ABt8h5tNGdIQdseosKc7W4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