Issue |
139902
|
Summary |
[compiler-rt][XRay] xray_interface.h not C compliant
|
Labels |
new issue
|
Assignees |
|
Reporter |
Thyre
|
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?
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs