[compiler-rt] [compiler-rt] Replace deprecated os_trace calls on mac (PR #138908)

via llvm-commits llvm-commits at lists.llvm.org
Fri May 9 05:35:33 PDT 2025


github-actions[bot] wrote:

<!--LLVM CODE FORMAT COMMENT: {clang-format}-->


:warning: C/C++ code formatter, clang-format found issues in your code. :warning:

<details>
<summary>
You can test this locally with the following command:
</summary>

``````````bash
git-clang-format --diff HEAD~1 HEAD --extensions cpp -- compiler-rt/lib/sanitizer_common/sanitizer_mac.cpp
``````````

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_mac.cpp b/compiler-rt/lib/sanitizer_common/sanitizer_mac.cpp
index c1a4d5ac3..d9ff0c961 100644
--- a/compiler-rt/lib/sanitizer_common/sanitizer_mac.cpp
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_mac.cpp
@@ -844,26 +844,26 @@ void LogMessageOnPrintf(const char *str) {
 
 void LogFullErrorReport(const char *buffer) {
 #if !SANITIZER_GO
-#  if SANITIZER_OS_TRACE
-   // Log with os_log_error. This will make it into the crash log.
-   if (GetMacosAlignedVersion() >= MacosVersion(10, 12)) {
-     if (internal_strncmp(SanitizerToolName, "AddressSanitizer",
-                          sizeof("AddressSanitizer") - 1) == 0)
-       os_log_error(OS_LOG_DEFAULT, "Address Sanitizer reported a failure.");
-     else if (internal_strncmp(SanitizerToolName, "UndefinedBehaviorSanitizer",
-                               sizeof("UndefinedBehaviorSanitizer") - 1) == 0)
-     os_log_error(OS_LOG_DEFAULT,
-                  "Undefined Behavior Sanitizer reported a failure.");
-     else if (internal_strncmp(SanitizerToolName, "ThreadSanitizer",
-                               sizeof("ThreadSanitizer") - 1) == 0)
-       os_log_error(OS_LOG_DEFAULT, "Thread Sanitizer reported a failure.");
-     else
-       os_log_error(OS_LOG_DEFAULT, "Sanitizer tool reported a failure.");
-
-     if (common_flags()->log_to_syslog)
-       os_log_error(OS_LOG_DEFAULT, "Consult syslog for more information.");
-   }
-#  endif // SANITIZER_OS_TRACE
+#    if SANITIZER_OS_TRACE
+  // Log with os_log_error. This will make it into the crash log.
+  if (GetMacosAlignedVersion() >= MacosVersion(10, 12)) {
+    if (internal_strncmp(SanitizerToolName, "AddressSanitizer",
+                         sizeof("AddressSanitizer") - 1) == 0)
+      os_log_error(OS_LOG_DEFAULT, "Address Sanitizer reported a failure.");
+    else if (internal_strncmp(SanitizerToolName, "UndefinedBehaviorSanitizer",
+                              sizeof("UndefinedBehaviorSanitizer") - 1) == 0)
+      os_log_error(OS_LOG_DEFAULT,
+                   "Undefined Behavior Sanitizer reported a failure.");
+    else if (internal_strncmp(SanitizerToolName, "ThreadSanitizer",
+                              sizeof("ThreadSanitizer") - 1) == 0)
+      os_log_error(OS_LOG_DEFAULT, "Thread Sanitizer reported a failure.");
+    else
+      os_log_error(OS_LOG_DEFAULT, "Sanitizer tool reported a failure.");
+
+    if (common_flags()->log_to_syslog)
+      os_log_error(OS_LOG_DEFAULT, "Consult syslog for more information.");
+  }
+#    endif  // SANITIZER_OS_TRACE
 
   // Log to syslog.
   // The logging on OS X may call pthread_create so we need the threading

``````````

</details>


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


More information about the llvm-commits mailing list