<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/59875>59875</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[LLVM-C] Expose getContext() on BuilderRef and ValueRef for C API
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
mratsim
</td>
</tr>
</table>
<pre>
Currently it is not possible to access the parent context of a BuilderRef in the C API.
For ValueRef we need an extra indirection via `LLVMGetTypeContext(LLVMTypeOf(my_value))`
Ideally LLVM-C mirrors `LLVMGetTypeContext` and `LLVMGetModuleContext` and provides:
- LLVMGetBuilderContext
- LLVMGetValueContext
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJx0Ul2L2zAQ_DXyy5Igrz8SP-jhLqnLwR0tpdxrka1NoiJLRpJz8b8vctJernBgbNiZ3fHOjgxBHy2RYNUjq_aZnOLJeTF4GYMess6pWewm78lGM4OOoANYF2F0IejOEEQHsu8pBIgnglEmJvTORrpEcAeQ8Dhpo8j_oANou7B28PD9ac34nvGH67t1Hl6lmSix3ggskQJpgS7RS9BWaU991M7CWUtgNX9-fn35SvHnPNLuKsZwm4qp8u3AcDvMv85pIsMmPTW_13tSJI2ZIXWsdjBo750PnwyuOUir7sAXpybzPzx6d9aKAituGiu40W8G_OV_BJetP0CZEoVqikZmJPJ6U-R5XhSYnQQvi04q2ZS8oZpX2DTUlYec9ygVrzvMtECOBc_5Jt_wbYXrUklVFgWnHHne94qVnAapzdqY87B2_pjpECYSVbPdVJmRHZmwJAHR0hssIENMwfAi9ay66RhYyY0OMbxPiTqaJUJXP1m1hy-X0QWCI8X3-zBswNn7QCTj_t394Pw1GtnkjTjFOC5mYsuwPep4mrp17waGbdK9fVajd7-pjwzb5W8Dw3bZ5k8AAAD__3Ae6oo">