diff options
| author | Sergey Matveev <earthdok@google.com> | 2014-05-12 14:27:36 +0000 |
|---|---|---|
| committer | Sergey Matveev <earthdok@google.com> | 2014-05-12 14:27:36 +0000 |
| commit | f37bd92c3a5f35e3f886c7f6fd8c45386a36d7e6 (patch) | |
| tree | 40bf2d13989b27a8260d2d10d2332e06f81a6e43 | |
| parent | 29fd7b9b20bda18490b3eab46a5c25dad163f288 (diff) | |
| download | bcm5719-llvm-f37bd92c3a5f35e3f886c7f6fd8c45386a36d7e6.tar.gz bcm5719-llvm-f37bd92c3a5f35e3f886c7f6fd8c45386a36d7e6.zip | |
[asan] Move the "coverage" flag to common flags.
The implementation lives in sanitizer_common and will need to access that flag.
llvm-svn: 208566
| -rw-r--r-- | compiler-rt/lib/asan/asan_flags.h | 1 | ||||
| -rw-r--r-- | compiler-rt/lib/asan/asan_rtl.cc | 9 | ||||
| -rw-r--r-- | compiler-rt/lib/sanitizer_common/sanitizer_flags.cc | 4 | ||||
| -rw-r--r-- | compiler-rt/lib/sanitizer_common/sanitizer_flags.h | 1 |
4 files changed, 8 insertions, 7 deletions
diff --git a/compiler-rt/lib/asan/asan_flags.h b/compiler-rt/lib/asan/asan_flags.h index cb1bcf47c48..11392041bd7 100644 --- a/compiler-rt/lib/asan/asan_flags.h +++ b/compiler-rt/lib/asan/asan_flags.h @@ -52,7 +52,6 @@ struct Flags { bool print_stats; bool print_legend; bool atexit; - bool coverage; bool disable_core; bool allow_reexec; bool print_full_thread_history; diff --git a/compiler-rt/lib/asan/asan_rtl.cc b/compiler-rt/lib/asan/asan_rtl.cc index 4022bb7c19e..39b186805f8 100644 --- a/compiler-rt/lib/asan/asan_rtl.cc +++ b/compiler-rt/lib/asan/asan_rtl.cc @@ -53,7 +53,7 @@ static void AsanDie() { UnmapOrDie((void*)kLowShadowBeg, kHighShadowEnd - kLowShadowBeg); } } - if (flags()->coverage) + if (common_flags()->coverage) __sanitizer_cov_dump(); if (death_callback) death_callback(); @@ -172,9 +172,6 @@ static void ParseFlagsFromString(Flags *f, const char *str) { ParseFlag(str, &f->atexit, "atexit", "If set, prints ASan exit stats even after program terminates " "successfully."); - ParseFlag(str, &f->coverage, "coverage", - "If set, coverage information will be dumped at program shutdown (if the " - "coverage instrumentation was enabled at compile time)."); ParseFlag(str, &f->disable_core, "disable_core", "Disable core dumping. By default, disable_core=1 on 64-bit to avoid " @@ -240,6 +237,7 @@ void InitializeFlags(Flags *f, const char *env) { cf->external_symbolizer_path = GetEnv("ASAN_SYMBOLIZER_PATH"); cf->malloc_context_size = kDefaultMallocContextSize; cf->intercept_tls_get_addr = true; + cf->coverage = false; internal_memset(f, 0, sizeof(*f)); f->quarantine_size = (ASAN_LOW_MEMORY) ? 1UL << 26 : 1UL << 28; @@ -266,7 +264,6 @@ void InitializeFlags(Flags *f, const char *env) { f->print_stats = false; f->print_legend = true; f->atexit = false; - f->coverage = false; f->disable_core = (SANITIZER_WORDSIZE == 64); f->allow_reexec = true; f->print_full_thread_history = true; @@ -665,7 +662,7 @@ static void AsanInitInternal() { if (flags()->atexit) Atexit(asan_atexit); - if (flags()->coverage) { + if (common_flags()->coverage) { __sanitizer_cov_init(); Atexit(__sanitizer_cov_dump); } diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_flags.cc b/compiler-rt/lib/sanitizer_common/sanitizer_flags.cc index cb287dfe799..86d70124efc 100644 --- a/compiler-rt/lib/sanitizer_common/sanitizer_flags.cc +++ b/compiler-rt/lib/sanitizer_common/sanitizer_flags.cc @@ -54,6 +54,7 @@ void SetCommonFlagsDefaults(CommonFlags *f) { f->color = "auto"; f->legacy_pthread_cond = false; f->intercept_tls_get_addr = false; + f->coverage = false; } void ParseCommonFlagsFromString(CommonFlags *f, const char *str) { @@ -122,6 +123,9 @@ void ParseCommonFlagsFromString(CommonFlags *f, const char *str) { ParseFlag(str, &f->mmap_limit_mb, "mmap_limit_mb", "Limit the amount of mmap-ed memory (excluding shadow) in Mb; " "not a user-facing flag, used mosly for testing the tools"); + ParseFlag(str, &f->coverage, "coverage", + "If set, coverage information will be dumped at program shutdown (if the " + "coverage instrumentation was enabled at compile time)."); // Do a sanity check for certain flags. if (f->malloc_context_size < 1) diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_flags.h b/compiler-rt/lib/sanitizer_common/sanitizer_flags.h index a322eadebbc..cf9afffaa25 100644 --- a/compiler-rt/lib/sanitizer_common/sanitizer_flags.h +++ b/compiler-rt/lib/sanitizer_common/sanitizer_flags.h @@ -53,6 +53,7 @@ struct CommonFlags { bool intercept_tls_get_addr; bool help; uptr mmap_limit_mb; + bool coverage; }; inline CommonFlags *common_flags() { |

