1 //===-- sanitizer_suppressions.h --------------------------------*- C++ -*-===//
3 // This file is distributed under the University of Illinois Open Source
4 // License. See LICENSE.TXT for details.
6 //===----------------------------------------------------------------------===//
8 // Suppression parsing/matching code shared between TSan and LSan.
10 //===----------------------------------------------------------------------===//
11 #ifndef SANITIZER_SUPPRESSIONS_H
12 #define SANITIZER_SUPPRESSIONS_H
14 #include "sanitizer_common.h"
15 #include "sanitizer_internal_defs.h"
17 namespace __sanitizer
{
19 enum SuppressionType
{
37 class SuppressionContext
{
39 SuppressionContext() : suppressions_(1), can_parse_(true) {}
40 void Parse(const char *str
);
41 bool Match(const char* str
, SuppressionType type
, Suppression
**s
);
42 uptr
SuppressionCount() const;
43 const Suppression
*SuppressionAt(uptr i
) const;
44 void GetMatched(InternalMmapVector
<Suppression
*> *matched
);
47 InternalMmapVector
<Suppression
> suppressions_
;
50 friend class SuppressionContextTest
;
53 const char *SuppressionTypeString(SuppressionType t
);
55 bool TemplateMatch(char *templ
, const char *str
);
57 } // namespace __sanitizer
59 #endif // SANITIZER_SUPPRESSIONS_H