[compiler-rt] [llvm] [compiler-rt][UBSan] Add __ubsan_default_suppressions() hook (PR #194862)
via llvm-commits
llvm-commits at lists.llvm.org
Wed Apr 29 06:44:13 PDT 2026
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 origin/main HEAD --extensions cpp,inc -- compiler-rt/test/ubsan/TestCases/Misc/Posix/ubsan_suppressions.cpp compiler-rt/lib/ubsan/ubsan_diag.cpp compiler-rt/lib/ubsan/ubsan_interface.inc --diff_from_common_commit
``````````
:warning:
The reproduction instructions above might return results for more than one PR
in a stack if you are using a stacked PR workflow. You can limit the results by
changing `origin/main` to the base branch/commit you want to compare against.
:warning:
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/compiler-rt/lib/ubsan/ubsan_diag.cpp b/compiler-rt/lib/ubsan/ubsan_diag.cpp
index 6ec81736d..54afa827f 100644
--- a/compiler-rt/lib/ubsan/ubsan_diag.cpp
+++ b/compiler-rt/lib/ubsan/ubsan_diag.cpp
@@ -12,10 +12,6 @@
#include "ubsan_platform.h"
#if CAN_SANITIZE_UB
-#include "ubsan_diag.h"
-#include "ubsan_init.h"
-#include "ubsan_flags.h"
-#include "ubsan_monitor.h"
#include "sanitizer_common/sanitizer_internal_defs.h"
#include "sanitizer_common/sanitizer_placement_new.h"
#include "sanitizer_common/sanitizer_report_decorator.h"
@@ -23,6 +19,10 @@
#include "sanitizer_common/sanitizer_stacktrace_printer.h"
#include "sanitizer_common/sanitizer_suppressions.h"
#include "sanitizer_common/sanitizer_symbolizer.h"
+#include "ubsan_diag.h"
+#include "ubsan_flags.h"
+#include "ubsan_init.h"
+#include "ubsan_monitor.h"
#include <stdio.h>
using namespace __ubsan;
diff --git a/compiler-rt/test/ubsan/TestCases/Misc/Posix/ubsan_suppressions.cpp b/compiler-rt/test/ubsan/TestCases/Misc/Posix/ubsan_suppressions.cpp
index 6936c56bb..cb6d8c9c7 100644
--- a/compiler-rt/test/ubsan/TestCases/Misc/Posix/ubsan_suppressions.cpp
+++ b/compiler-rt/test/ubsan/TestCases/Misc/Posix/ubsan_suppressions.cpp
@@ -1,7 +1,7 @@
// Test that we use the suppressions from __ubsan_default_suppressions.
// RUN: %clangxx -fsanitize=undefined %s -o %t && not %run %t 2>&1 | FileCheck %s
extern "C" {
- const char *__ubsan_default_suppressions() { return "FooBar"; }
+const char *__ubsan_default_suppressions() { return "FooBar"; }
}
// CHECK: UndefinedBehaviorSanitizer: failed to parse suppressions
int main() {}
``````````
</details>
https://github.com/llvm/llvm-project/pull/194862
More information about the llvm-commits
mailing list