diff options
| author | Sergey Matveev <earthdok@google.com> | 2013-12-05 12:04:51 +0000 |
|---|---|---|
| committer | Sergey Matveev <earthdok@google.com> | 2013-12-05 12:04:51 +0000 |
| commit | 9be70fbda9e3efbb33a285f600e13c16d41f59e1 (patch) | |
| tree | 5c642e3b1c16bedc44ffb7c408f057b0f9f491d5 /compiler-rt/lib/asan/asan_thread.cc | |
| parent | a611c0f40508a5d74ebbfc4e658e2ec30735dada (diff) | |
| download | bcm5719-llvm-9be70fbda9e3efbb33a285f600e13c16d41f59e1.tar.gz bcm5719-llvm-9be70fbda9e3efbb33a285f600e13c16d41f59e1.zip | |
[sanitizer] Introduce VReport and VPrintf macros and use them in sanitizer code.
Instead of "if (common_flags()->verbosity) Report(...)" we now have macros.
llvm-svn: 196497
Diffstat (limited to 'compiler-rt/lib/asan/asan_thread.cc')
| -rw-r--r-- | compiler-rt/lib/asan/asan_thread.cc | 23 |
1 files changed, 8 insertions, 15 deletions
diff --git a/compiler-rt/lib/asan/asan_thread.cc b/compiler-rt/lib/asan/asan_thread.cc index 77156ebe737..cbbfe76783d 100644 --- a/compiler-rt/lib/asan/asan_thread.cc +++ b/compiler-rt/lib/asan/asan_thread.cc @@ -87,16 +87,13 @@ AsanThread *AsanThread::Create(thread_callback_t start_routine, void AsanThread::TSDDtor(void *tsd) { AsanThreadContext *context = (AsanThreadContext*)tsd; - if (common_flags()->verbosity >= 1) - Report("T%d TSDDtor\n", context->tid); + VReport(1, "T%d TSDDtor\n", context->tid); if (context->thread) context->thread->Destroy(); } void AsanThread::Destroy() { - if (common_flags()->verbosity >= 1) { - Report("T%d exited\n", tid()); - } + VReport(1, "T%d exited\n", tid()); malloc_storage().CommitBack(); if (flags()->use_sigaltstack) UnsetAlternateSignalStack(); @@ -142,12 +139,10 @@ void AsanThread::Init() { CHECK(AddrIsInMem(stack_bottom_)); CHECK(AddrIsInMem(stack_top_ - 1)); ClearShadowForThreadStackAndTLS(); - if (common_flags()->verbosity >= 1) { - int local = 0; - Report("T%d: stack [%p,%p) size 0x%zx; local=%p\n", - tid(), (void*)stack_bottom_, (void*)stack_top_, - stack_top_ - stack_bottom_, &local); - } + int local = 0; + VReport(1, "T%d: stack [%p,%p) size 0x%zx; local=%p\n", tid(), + (void *)stack_bottom_, (void *)stack_top_, stack_top_ - stack_bottom_, + &local); fake_stack_ = 0; // Will be initialized lazily if needed. AsanPlatformThreadInit(); } @@ -267,10 +262,8 @@ AsanThread *GetCurrentThread() { void SetCurrentThread(AsanThread *t) { CHECK(t->context()); - if (common_flags()->verbosity >= 2) { - Report("SetCurrentThread: %p for thread %p\n", - t->context(), (void*)GetThreadSelf()); - } + VReport(2, "SetCurrentThread: %p for thread %p\n", t->context(), + (void *)GetThreadSelf()); // Make sure we do not reset the current AsanThread. CHECK_EQ(0, AsanTSDGet()); AsanTSDSet(t->context()); |

