[compiler-rt] [tsan] Allow unloading of ignored librairies (PR #105660)

via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 22 06:48:21 PDT 2024


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 2e789900433834b3b5cd6a55ccf64da6a9ec4505 2a52bd00a79b4b6ad761b7bb0c35d2d440a26bc1 --extensions h,cpp -- compiler-rt/lib/sanitizer_common/sanitizer_libignore.cpp compiler-rt/lib/sanitizer_common/sanitizer_libignore.h compiler-rt/test/tsan/ignore_lib3.cpp
``````````

</details>

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

``````````diff
diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_libignore.cpp b/compiler-rt/lib/sanitizer_common/sanitizer_libignore.cpp
index 85b97ac0e7..1df97181a7 100644
--- a/compiler-rt/lib/sanitizer_common/sanitizer_libignore.cpp
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_libignore.cpp
@@ -92,9 +92,10 @@ void LibIgnore::OnLibraryLoaded(const char *name) {
       }
     }
     if (lib->loaded && !loaded) {
-      VReport(1, "%s: library '%s' that was matched against called_from_lib"
-             " suppression '%s' is unloaded\n",
-             SanitizerToolName, lib->name, lib->templ);
+      VReport(1,
+              "%s: library '%s' that was matched against called_from_lib"
+              " suppression '%s' is unloaded\n",
+              SanitizerToolName, lib->name, lib->templ);
       // The library is unloaded so mark the ignored code range as unloaded.
       CHECK_NE(lib->ignored_code_range_id, kInvalidCodeRangeId);
       ignored_code_ranges_[lib->ignored_code_range_id].loaded = 0;
diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_libignore.h b/compiler-rt/lib/sanitizer_common/sanitizer_libignore.h
index 228d15b373..b4f891ca1d 100644
--- a/compiler-rt/lib/sanitizer_common/sanitizer_libignore.h
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_libignore.h
@@ -71,10 +71,10 @@ class LibIgnore {
       begin_ = begin >> 1;
     }
 
-  private:
+   private:
     uptr begin_ : 63;
 
-  public:
+   public:
     uptr loaded : 1;
     uptr end;
   };
diff --git a/compiler-rt/test/tsan/ignore_lib3.cpp b/compiler-rt/test/tsan/ignore_lib3.cpp
index c1fac0138f..a919a3ee4e 100644
--- a/compiler-rt/test/tsan/ignore_lib3.cpp
+++ b/compiler-rt/test/tsan/ignore_lib3.cpp
@@ -40,7 +40,7 @@ int main(int argc, char **argv) {
 
 #else  // #ifdef LIB
 
-#include "ignore_lib_lib.h"
+#  include "ignore_lib_lib.h"
 
 #endif  // #ifdef LIB
 
@@ -49,4 +49,3 @@ int main(int argc, char **argv) {
 // CHECK: Matched called_from_lib suppression 'ignore_lib3.so'
 // CHECK: library '{{.*}}ignore_lib3.so' that was matched against called_from_lib suppression 'ignore_lib3.so' is unloaded
 // CHECK: OK
-

``````````

</details>


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


More information about the llvm-commits mailing list