Clean up some minor white space issues in trans-decl.c and trans-expr.c
[official-gcc.git] / libsanitizer / sanitizer_common / sanitizer_suppressions.h
blobefec926476baa36e5045b79bd7358f3730afa222
1 //===-- sanitizer_suppressions.h --------------------------------*- C++ -*-===//
2 //
3 // This file is distributed under the University of Illinois Open Source
4 // License. See LICENSE.TXT for details.
5 //
6 //===----------------------------------------------------------------------===//
7 //
8 // Suppression parsing/matching code.
9 //
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 {
20 struct Suppression {
21 const char *type;
22 char *templ;
23 atomic_uint32_t hit_count;
24 uptr weight;
27 class SuppressionContext {
28 public:
29 // Create new SuppressionContext capable of parsing given suppression types.
30 SuppressionContext(const char *supprression_types[],
31 int suppression_types_num);
33 void ParseFromFile(const char *filename);
34 void Parse(const char *str);
36 bool Match(const char *str, const char *type, Suppression **s);
37 uptr SuppressionCount() const;
38 bool HasSuppressionType(const char *type) const;
39 const Suppression *SuppressionAt(uptr i) const;
40 void GetMatched(InternalMmapVector<Suppression *> *matched);
42 private:
43 static const int kMaxSuppressionTypes = 16;
44 const char **const suppression_types_;
45 const int suppression_types_num_;
47 InternalMmapVector<Suppression> suppressions_;
48 bool has_suppression_type_[kMaxSuppressionTypes];
49 bool can_parse_;
52 } // namespace __sanitizer
54 #endif // SANITIZER_SUPPRESSIONS_H