diff options
| author | Alexey Samsonov <vonosmas@gmail.com> | 2015-02-19 22:56:49 +0000 |
|---|---|---|
| committer | Alexey Samsonov <vonosmas@gmail.com> | 2015-02-19 22:56:49 +0000 |
| commit | 1ec3c5bc995c31d304e951da88ae4f26431adad9 (patch) | |
| tree | df6ea23c521a05264258df4183eda457d235cd92 /compiler-rt/lib/sanitizer_common/sanitizer_libignore.cc | |
| parent | d2c20c49f81f1fcf7257ea8c8a1522e1a2b36619 (diff) | |
| download | bcm5719-llvm-1ec3c5bc995c31d304e951da88ae4f26431adad9.tar.gz bcm5719-llvm-1ec3c5bc995c31d304e951da88ae4f26431adad9.zip | |
[Sanitizer] Drop LibIgnore dependency on SuppressionContext. NFC.
Let each LibIgnore user (for now it's only TSan) manually go
through SuppressionContext and pass ignored library templates to
LibIgnore.
llvm-svn: 229924
Diffstat (limited to 'compiler-rt/lib/sanitizer_common/sanitizer_libignore.cc')
| -rw-r--r-- | compiler-rt/lib/sanitizer_common/sanitizer_libignore.cc | 26 |
1 files changed, 10 insertions, 16 deletions
diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_libignore.cc b/compiler-rt/lib/sanitizer_common/sanitizer_libignore.cc index 8df0467b1e9..cefb1dc97a1 100644 --- a/compiler-rt/lib/sanitizer_common/sanitizer_libignore.cc +++ b/compiler-rt/lib/sanitizer_common/sanitizer_libignore.cc @@ -19,24 +19,18 @@ namespace __sanitizer { LibIgnore::LibIgnore(LinkerInitialized) { } -void LibIgnore::Init(const SuppressionContext &supp) { +void LibIgnore::AddIgnoredLibrary(const char *name_templ) { BlockingMutexLock lock(&mutex_); - CHECK_EQ(count_, 0); - const uptr n = supp.SuppressionCount(); - for (uptr i = 0; i < n; i++) { - const Suppression *s = supp.SuppressionAt(i); - if (s->type != SuppressionLib) - continue; - if (count_ >= kMaxLibs) { - Report("%s: too many called_from_lib suppressions (max: %d)\n", - SanitizerToolName, kMaxLibs); - Die(); - } - Lib *lib = &libs_[count_++]; - lib->templ = internal_strdup(s->templ); - lib->name = 0; - lib->loaded = false; + if (count_ >= kMaxLibs) { + Report("%s: too many ignored libraries (max: %d)\n", SanitizerToolName, + kMaxLibs); + Die(); } + Lib *lib = &libs_[count_++]; + lib->templ = internal_strdup(name_templ); + lib->name = nullptr; + lib->real_name = nullptr; + lib->loaded = false; } void LibIgnore::OnLibraryLoaded(const char *name) { |

