brintos

brintos / llvm-project-archived public Read only

0
0
Text · 420 B · 878c469 Raw
16 lines · cpp
1#include <atomic>2#include <xray/xray_interface.h>3 4namespace __xray {5 6extern std::atomic<void (*)(int32_t, XRayEntryType)> XRayPatchedFunction;7 8// Implement this in C++ instead of assembly, to avoid dealing with ToC by hand.9void CallXRayPatchedFunction(int32_t FuncId, XRayEntryType Type) {10  auto fptr = __xray::XRayPatchedFunction.load();11  if (fptr != nullptr)12    (*fptr)(FuncId, Type);13}14 15} // namespace __xray16