<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/56237>56237</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            libc++: __cxa_free_exception cannot be overridden properly because of inlining
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          t-8ch
      </td>
    </tr>
</table>

<pre>
    Environment: libc++ 14.0.6 on Linux x86_64

I'm building a support library that extends the builtin exception machinery of the standard C++ runtime.
For this the library overrides `__cxa_allocate_free()`, `__cxa_free_exception() and `__cxa_throw()` to perform its own additional logic and then calls back into the original functions.

Unfortunately in libc++ the call to `__cxa_free_exception()` from `__cxa_decrement_exception_refcount()` is inlined and therefore my custom function is not called.

This works on libstdc++ and also on libc++ when I mark `__cxa_free_exception()` as noinline.

Is this something that could be supported?
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyFk01vozAQhn8NXKwiYgikBw792EiV9rh7Rv4Yg7fGjmzTJP9-x6SUVlp1JZQA8847z3gG7uS1-2HftHd2Ahuz6oEYzUVGH_Eiu7ooi4Y4S35qO1_I5dD0TZ2Vz1n5cPt9yWg7ET5rI7UdCCNhPp2cj8nFM38lcWSRwCWClQEfYNFGbfGdgFPU6D0xMWoLKHZqkYTIrGRekqd3Dj_bqCcobjWPzqNM3-zWOu4NvNcSAsmasu_FhfXMGCdYhF55gIweMnqPsYw-bZIU6T9IbhqCxTdFHL07fyST6MgJvHJ-IjoG4s6WMCl1ymaGGDdoseQjmiUCCQLhTLwSbTEz8TqvB520arYipYXi83n-tugdZ4vY5opZn6eR0pNlgvi2gwSqvJs2lQThIQ14k_YelHB4sFsOHqm2Bkch1x5Q4zyQ6UrEHCI6rtRJa11ceEB-aeFXGs3Z-deQFgf5Q5RrC8mWmeDeI-vrczqtF1wE__r_zliqfOP8Uvcl3LYiuAnwBrdx2T3s0UjCYd1MkFl1zGVXyfvqnuVRRwPdxpK-gH_Vx05tahiN3ldNIvPJO1wHnBQHweYAaYMXNCyfz950Y4yngJ4ZPeI16DjOvBBuwgdj3ta_O_T5AwJHcdQhzBDwZt_Qqs3Hrq0oPxzkYddSuVecclWDhHqnlGrLqqW5YRxM6LL9Y7Z_znVHS0rLhrZlU-9oW6i64YqpHePVTrCmyeoSJqZNkQoXzg-57xYGPg8Bg0aHGLYgC0EPFmD1Z3Mcne_i3UGM-QLbLaR_AXCqbpA">