[ASan] Use common flags parsing machinery.
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@159933 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/asan/asan_thread.cc b/lib/asan/asan_thread.cc
index e2fa416..2f27732 100644
--- a/lib/asan/asan_thread.cc
+++ b/lib/asan/asan_thread.cc
@@ -42,7 +42,7 @@
void AsanThreadSummary::TSDDtor(void *tsd) {
AsanThreadSummary *summary = (AsanThreadSummary*)tsd;
- if (FLAG_v >= 1) {
+ if (flags()->verbosity >= 1) {
Report("T%d TSDDtor\n", summary->tid());
}
if (summary->thread()) {
@@ -51,7 +51,7 @@
}
void AsanThread::Destroy() {
- if (FLAG_v >= 1) {
+ if (flags()->verbosity >= 1) {
Report("T%d exited\n", tid());
}
@@ -71,7 +71,7 @@
CHECK(AddrIsInMem(stack_bottom_));
CHECK(AddrIsInMem(stack_top_));
ClearShadowForThreadStack();
- if (FLAG_v >= 1) {
+ if (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_,
@@ -82,7 +82,7 @@
thread_return_t AsanThread::ThreadStart() {
Init();
- if (FLAG_use_sigaltstack) SetAlternateSignalStack();
+ if (flags()->use_sigaltstack) SetAlternateSignalStack();
if (!start_routine_) {
// start_routine_ == 0 if we're on the main thread or on one of the
@@ -94,7 +94,7 @@
thread_return_t res = start_routine_(arg_);
malloc_storage().CommitBack();
- if (FLAG_use_sigaltstack) UnsetAlternateSignalStack();
+ if (flags()->use_sigaltstack) UnsetAlternateSignalStack();
this->Destroy();