* gcc.target/i386/fuse-caller-save-xmm.c (dg-options): Use
[official-gcc.git] / libsanitizer / sanitizer_common / sanitizer_suppressions.h
blob033ddc5f52adb35fbb37913d7519132ad87665ea
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 shared between TSan and LSan.
9 //
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 {
20 SuppressionNone,
21 SuppressionRace,
22 SuppressionMutex,
23 SuppressionThread,
24 SuppressionSignal,
25 SuppressionLeak,
26 SuppressionLib,
27 SuppressionDeadlock,
28 SuppressionTypeCount
31 struct Suppression {
32 SuppressionType type;
33 char *templ;
34 unsigned hit_count;
35 uptr weight;
38 class SuppressionContext {
39 public:
40 SuppressionContext() : suppressions_(1), can_parse_(true) {}
41 void Parse(const char *str);
42 bool Match(const char* str, SuppressionType type, Suppression **s);
43 uptr SuppressionCount() const;
44 const Suppression *SuppressionAt(uptr i) const;
45 void GetMatched(InternalMmapVector<Suppression *> *matched);
47 private:
48 InternalMmapVector<Suppression> suppressions_;
49 bool can_parse_;
51 friend class SuppressionContextTest;
54 const char *SuppressionTypeString(SuppressionType t);
56 bool TemplateMatch(char *templ, const char *str);
58 } // namespace __sanitizer
60 #endif // SANITIZER_SUPPRESSIONS_H