diff options
author | Alexey Samsonov <vonosmas@gmail.com> | 2014-07-30 20:54:37 +0000 |
---|---|---|
committer | Alexey Samsonov <vonosmas@gmail.com> | 2014-07-30 20:54:37 +0000 |
commit | 31d7dc0896a77d80376509c44a5c1ff281bf59a2 (patch) | |
tree | 6c2e7618d625dc0f5366b4a62b6dca327a748744 /lib/sanitizer_common/sanitizer_suppressions.h | |
parent | bc7f9f77a7352c05c75c0e3879bc218e7ba2c353 (diff) |
[Sanitizer] Make SuppressionContext a singleton class, residing in sanitizer_common.
Convert TSan and LSan to the new interface. More changes will follow:
1) "suppressions" should become a common runtime flag.
2) Code for parsing suppressions file should be moved to SuppressionContext::Init().
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@214334 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/sanitizer_common/sanitizer_suppressions.h')
-rw-r--r-- | lib/sanitizer_common/sanitizer_suppressions.h | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/sanitizer_common/sanitizer_suppressions.h b/lib/sanitizer_common/sanitizer_suppressions.h index 772b9aab5..593b7a5e8 100644 --- a/lib/sanitizer_common/sanitizer_suppressions.h +++ b/lib/sanitizer_common/sanitizer_suppressions.h @@ -39,14 +39,20 @@ struct Suppression { class SuppressionContext { public: - SuppressionContext() : suppressions_(1), can_parse_(true) {} void Parse(const char *str); bool Match(const char* str, SuppressionType type, Suppression **s); uptr SuppressionCount() const; const Suppression *SuppressionAt(uptr i) const; void GetMatched(InternalMmapVector<Suppression *> *matched); + // Create a SuppressionContext singleton. Not thread safe. Must be called + // early during initialization. + static void Init(); + // Returns a SuppressionContext singleton. + static SuppressionContext *Get(); + private: + SuppressionContext() : suppressions_(1), can_parse_(true) {} InternalMmapVector<Suppression> suppressions_; bool can_parse_; |