[compiler-rt] [rtsan][NFC] Remove unncessary namespace specifiers (PR #110197)
via llvm-commits
llvm-commits at lists.llvm.org
Thu Sep 26 19:08:42 PDT 2024
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-compiler-rt-sanitizer
Author: Chris Apple (cjappl)
<details>
<summary>Changes</summary>
---
Full diff: https://github.com/llvm/llvm-project/pull/110197.diff
3 Files Affected:
- (modified) compiler-rt/lib/rtsan/rtsan.cpp (+4-4)
- (modified) compiler-rt/lib/rtsan/rtsan_context.cpp (+7-6)
- (modified) compiler-rt/lib/rtsan/rtsan_diagnostics.cpp (+1-1)
``````````diff
diff --git a/compiler-rt/lib/rtsan/rtsan.cpp b/compiler-rt/lib/rtsan/rtsan.cpp
index 6fcff5e326a52f..f9741b4fe3509d 100644
--- a/compiler-rt/lib/rtsan/rtsan.cpp
+++ b/compiler-rt/lib/rtsan/rtsan.cpp
@@ -114,19 +114,19 @@ SANITIZER_INTERFACE_ATTRIBUTE bool __rtsan_is_initialized() {
}
SANITIZER_INTERFACE_ATTRIBUTE void __rtsan_realtime_enter() {
- __rtsan::GetContextForThisThread().RealtimePush();
+ GetContextForThisThread().RealtimePush();
}
SANITIZER_INTERFACE_ATTRIBUTE void __rtsan_realtime_exit() {
- __rtsan::GetContextForThisThread().RealtimePop();
+ GetContextForThisThread().RealtimePop();
}
SANITIZER_INTERFACE_ATTRIBUTE void __rtsan_disable() {
- __rtsan::GetContextForThisThread().BypassPush();
+ GetContextForThisThread().BypassPush();
}
SANITIZER_INTERFACE_ATTRIBUTE void __rtsan_enable() {
- __rtsan::GetContextForThisThread().BypassPop();
+ GetContextForThisThread().BypassPop();
}
SANITIZER_INTERFACE_ATTRIBUTE void
diff --git a/compiler-rt/lib/rtsan/rtsan_context.cpp b/compiler-rt/lib/rtsan/rtsan_context.cpp
index 1cf1791f0aaf83..536d62e81e2fb6 100644
--- a/compiler-rt/lib/rtsan/rtsan_context.cpp
+++ b/compiler-rt/lib/rtsan/rtsan_context.cpp
@@ -17,6 +17,7 @@
#include <pthread.h>
using namespace __sanitizer;
+using namespace __rtsan;
static pthread_key_t context_key;
static pthread_once_t key_once = PTHREAD_ONCE_INIT;
@@ -31,12 +32,12 @@ static __rtsan::Context &GetContextForThisThreadImpl() {
};
pthread_once(&key_once, MakeThreadLocalContextKey);
- __rtsan::Context *current_thread_context =
- static_cast<__rtsan::Context *>(pthread_getspecific(context_key));
+ Context *current_thread_context =
+ static_cast<Context *>(pthread_getspecific(context_key));
if (current_thread_context == nullptr) {
- current_thread_context = static_cast<__rtsan::Context *>(
- __sanitizer::InternalAlloc(sizeof(__rtsan::Context)));
- new (current_thread_context) __rtsan::Context();
+ current_thread_context =
+ static_cast<Context *>(InternalAlloc(sizeof(Context)));
+ new (current_thread_context) Context();
pthread_setspecific(context_key, current_thread_context);
}
@@ -57,6 +58,6 @@ bool __rtsan::Context::InRealtimeContext() const { return realtime_depth_ > 0; }
bool __rtsan::Context::IsBypassed() const { return bypass_depth_ > 0; }
-__rtsan::Context &__rtsan::GetContextForThisThread() {
+Context &__rtsan::GetContextForThisThread() {
return GetContextForThisThreadImpl();
}
diff --git a/compiler-rt/lib/rtsan/rtsan_diagnostics.cpp b/compiler-rt/lib/rtsan/rtsan_diagnostics.cpp
index cfe71481d3dc78..ecba30d2ab8df5 100644
--- a/compiler-rt/lib/rtsan/rtsan_diagnostics.cpp
+++ b/compiler-rt/lib/rtsan/rtsan_diagnostics.cpp
@@ -31,7 +31,7 @@ void BufferedStackTrace::UnwindImpl(uptr pc, uptr bp, void *context,
} // namespace __sanitizer
namespace {
-class Decorator : public __sanitizer::SanitizerCommonDecorator {
+class Decorator : public SanitizerCommonDecorator {
public:
Decorator() : SanitizerCommonDecorator() {}
const char *FunctionName() const { return Green(); }
``````````
</details>
https://github.com/llvm/llvm-project/pull/110197
More information about the llvm-commits
mailing list