[compiler-rt] [rtsan][compiler-rt] Get rid of [[blocking]] stub in tests (PR #111392)

via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 7 09:07:22 PDT 2024


================
@@ -7,18 +7,11 @@
 #include <stdio.h>
 #include <stdlib.h>
 
-// TODO: Remove when [[blocking]] is implemented.
-extern "C" void __rtsan_notify_blocking_call(const char *function_name);
-
-void custom_blocking_function() {
-  // TODO: When [[blocking]] is implemented, don't call this directly.
-  __rtsan_notify_blocking_call(__func__);
+void custom_blocking_function() [[clang::blocking]] {
+  printf("In blocking function\n");
 }
 
-void safe_call() {
-  // TODO: When [[blocking]] is implemented, don't call this directly.
-  __rtsan_notify_blocking_call(__func__);
-}
+void safe_call() [[clang::blocking]] { printf("In safe call\n"); }
----------------
davidtrevelyan wrote:

I'm a bit confused as to why we have a function called `safe_call` that's attributed `[[clang::blocking]]`. The test assertions also check that `safe_call` is not printed. Was it originally a mistake to call `__rtsan_notify_blocking_call` in the test when it was first written, maybe?

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


More information about the llvm-commits mailing list