tsan_suppressions.h revision 39968339a07d790aadcf27534f92a0de8c0c90fb
1//===-- tsan_suppressions.h -------------------------------------*- C++ -*-===//
2//
3//                     The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9//
10// This file is a part of ThreadSanitizer (TSan), a race detector.
11//
12//===----------------------------------------------------------------------===//
13#ifndef TSAN_SUPPRESSIONS_H
14#define TSAN_SUPPRESSIONS_H
15
16#include "tsan_report.h"
17
18namespace __tsan {
19
20// Exposed for testing.
21enum SuppressionType {
22  SuppressionNone,
23  SuppressionRace,
24  SuppressionMutex,
25  SuppressionThread,
26  SuppressionSignal
27};
28
29struct Suppression {
30  Suppression *next;
31  SuppressionType type;
32  char *templ;
33  int hit_count;
34};
35
36void InitializeSuppressions();
37void FinalizeSuppressions();
38void PrintMatchedSuppressions();
39uptr IsSuppressed(ReportType typ, const ReportStack *stack, Suppression **sp);
40uptr IsSuppressed(ReportType typ, const ReportLocation *loc, Suppression **sp);
41Suppression *SuppressionParse(Suppression *head, const char* supp);
42bool SuppressionMatch(char *templ, const char *str);
43
44}  // namespace __tsan
45
46#endif  // TSAN_SUPPRESSIONS_H
47