[compiler-rt] [SystemZ][XRay] XRay runtime support for SystemZ (PR #113252)

Fangrui Song via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 22 21:43:33 PDT 2024


================
@@ -0,0 +1,88 @@
+//===-- xray_s390x.cpp ------------------------------------------*- C++ -*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+//
+// This file is a part of XRay, a dynamic runtime instrumentation system.
+//
+// Implementation of s390x routines.
+//
+//===----------------------------------------------------------------------===//
+#include "sanitizer_common/sanitizer_common.h"
+#include "xray_defs.h"
+#include "xray_interface_internal.h"
+#include <cassert>
+#include <cstring>
+
+bool __xray::patchFunctionEntry(const bool Enable, uint32_t FuncId,
+                                const XRaySledEntry &Sled,
+                                void (*Trampoline)()) XRAY_NEVER_INSTRUMENT {
+  const uint64_t Address = Sled.address();
----------------
MaskRay wrote:

Easier to cast Address to uint32_t * here to avoid reinterpret_cast below

https://github.com/llvm/llvm-project/pull/113252


More information about the llvm-commits mailing list