diff options
author | Tim Shen <timshen91@gmail.com> | 2017-02-15 22:40:29 +0000 |
---|---|---|
committer | Tim Shen <timshen91@gmail.com> | 2017-02-15 22:40:29 +0000 |
commit | fd096f77aa65c51e57af848ca9213a2416a2eead (patch) | |
tree | 19e6958d000abf6298adb6072921187256eb77e4 /lib/xray/xray_trampoline_powerpc64.cc | |
parent | f3a0049f4e18613f85a193f56d165dcdc5bf1e4e (diff) |
Re-commit r295017, since we have a potential fix of the tests, r295248, landed.
Differential Revision: https://reviews.llvm.org/D29742
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@295251 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/xray/xray_trampoline_powerpc64.cc')
-rw-r--r-- | lib/xray/xray_trampoline_powerpc64.cc | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/xray/xray_trampoline_powerpc64.cc b/lib/xray/xray_trampoline_powerpc64.cc new file mode 100644 index 000000000..878c46930 --- /dev/null +++ b/lib/xray/xray_trampoline_powerpc64.cc @@ -0,0 +1,15 @@ +#include <atomic> +#include <xray/xray_interface.h> + +namespace __xray { + +extern std::atomic<void (*)(int32_t, XRayEntryType)> XRayPatchedFunction; + +// Implement this in C++ instead of assembly, to avoid dealing with ToC by hand. +void CallXRayPatchedFunction(int32_t FuncId, XRayEntryType Type) { + auto fptr = __xray::XRayPatchedFunction.load(); + if (fptr != nullptr) + (*fptr)(FuncId, Type); +} + +} // namespace __xray |