summaryrefslogtreecommitdiffstats
path: root/compiler-rt/lib/xray/xray_trampoline_powerpc64.cc
diff options
context:
space:
mode:
authorTim Shen <timshen91@gmail.com>2017-02-14 02:05:47 +0000
committerTim Shen <timshen91@gmail.com>2017-02-14 02:05:47 +0000
commitb94588eb88bad5db1522e0f22f0ddca4a6d9e3c4 (patch)
tree7894dc5a4507b5dd2fe95baf3b9b9109b1d7de6e /compiler-rt/lib/xray/xray_trampoline_powerpc64.cc
parentc27b3d7623cfa6476c8db5957d3c7f937603ec44 (diff)
downloadbcm5719-llvm-b94588eb88bad5db1522e0f22f0ddca4a6d9e3c4.tar.gz
bcm5719-llvm-b94588eb88bad5db1522e0f22f0ddca4a6d9e3c4.zip
Re-commit r294826 and r294781, with a fix on the cmake file to only
compile on powerpc64le. I cannot locally reproduce this test failure: http://lab.llvm.org:8011/builders/sanitizer-ppc64le-linux/builds/1363/steps/test%20standalone%20compiler-rt/logs/stdio Let's see how the buildbot goes. Differential Revision: https://reviews.llvm.org/D29742 llvm-svn: 295017
Diffstat (limited to 'compiler-rt/lib/xray/xray_trampoline_powerpc64.cc')
-rw-r--r--compiler-rt/lib/xray/xray_trampoline_powerpc64.cc15
1 files changed, 15 insertions, 0 deletions
diff --git a/compiler-rt/lib/xray/xray_trampoline_powerpc64.cc b/compiler-rt/lib/xray/xray_trampoline_powerpc64.cc
new file mode 100644
index 00000000000..878c46930fe
--- /dev/null
+++ b/compiler-rt/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
OpenPOWER on IntegriCloud