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.
10 //===----------------------------------------------------------------------===//
11 #ifndef SANITIZER_SUPPRESSIONS_H
12 #define SANITIZER_SUPPRESSIONS_H
14 #include "sanitizer_common.h"
15 #include "sanitizer_atomic.h"
16 #include "sanitizer_internal_defs.h"
18 namespace __sanitizer
{
21 Suppression() { internal_memset(this, 0, sizeof(*this)); }
24 atomic_uint32_t hit_count
;
28 class SuppressionContext
{
30 // Create new SuppressionContext capable of parsing given suppression types.
31 SuppressionContext(const char *supprression_types
[],
32 int suppression_types_num
);
34 void ParseFromFile(const char *filename
);
35 void Parse(const char *str
);
37 bool Match(const char *str
, const char *type
, Suppression
**s
);
38 uptr
SuppressionCount() const;
39 bool HasSuppressionType(const char *type
) const;
40 const Suppression
*SuppressionAt(uptr i
) const;
41 void GetMatched(InternalMmapVector
<Suppression
*> *matched
);
44 static const int kMaxSuppressionTypes
= 32;
45 const char **const suppression_types_
;
46 const int suppression_types_num_
;
48 InternalMmapVector
<Suppression
> suppressions_
;
49 bool has_suppression_type_
[kMaxSuppressionTypes
];
53 } // namespace __sanitizer
55 #endif // SANITIZER_SUPPRESSIONS_H