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

    <tr>
        <th>Summary</th>
        <td>
            [compiler-rt][XRay] xray_interface.h not C compliant
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

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

    <tr>
      <th>Reporter</th>
      <td>
          Thyre
      </td>
    </tr>
</table>

<pre>
    Heya ðŸ‘‹ 

We're currently looking into integrating a prototype developed by @sebastiankreutzer and @pauladelmann, which enables the usage of XRay for compiler instrumentation in the performance measurement infrastructure [Score-P](https://www.vi-hps.org/projects/score-p). The prototype so far uses C++, but we are looking to port it to C, as this prevents some issues we might run into down the line. A lot of work in that direction is already done, but we noticed an issue with `xray_interface.h`.

`xray_interface.h` includes two headers:

https://github.com/llvm/llvm-project/blob/7e7871d3f58b9da72ca180fcd7f0d2da3f92ec4a/compiler-rt/include/xray/xray_interface.h#L17-L18

Both headers are C++ heades, not compatible with C. A bit further down, we see `std::size_t` being used:

https://github.com/llvm/llvm-project/blob/7e7871d3f58b9da72ca180fcd7f0d2da3f92ec4a/compiler-rt/include/xray/xray_interface.h#L71

These issues seem to exist since XRay was introduced. Probably no tool tried to use this with C...
Fixing this should be straight-forward, replacing `#include <cstddef>` with `#include <stddef.h>`, `#include <cstdint>` with `#include <stdint.h>` and `std::size_t` with `size_t`.
But maybe we want to introduce a test to make sure that this header stays C compliant?
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJzMlcGOpDgPx58mdbEKQSgaONShq_pD32EOo92Rdm8jQ0yR7ZCgxDTDPP0qUNU7s2pptbeVWk3J2Mb---cEQ9A3S3QWxUUULweceXD-_GVYPR1ap9bz_2lFEE0q6kbUmaguINJnkT7_RkKWnqCbvSfLZgXj3Ku2N9CWXfxHN48cDQiTd-x4nQgUvZFxEyloVxCnNFCLgTXaV08zfycP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