aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/libs/clang16-rt/lib/tsan/rtl/tsan_ignoreset.h
blob: 4e2511291ce4d608c83dac318156748bd9682d23 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
//===-- tsan_ignoreset.h ----------------------------------------*- C++ -*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
//
// This file is a part of ThreadSanitizer (TSan), a race detector.
//
// IgnoreSet holds a set of stack traces where ignores were enabled.
//===----------------------------------------------------------------------===//
#ifndef TSAN_IGNORESET_H
#define TSAN_IGNORESET_H

#include "tsan_defs.h"

namespace __tsan {

class IgnoreSet {
 public:
  IgnoreSet();
  void Add(StackID stack_id);
  void Reset() { size_ = 0; }
  uptr Size() const { return size_; }
  StackID At(uptr i) const;

 private:
  static constexpr uptr kMaxSize = 16;
  uptr size_;
  StackID stacks_[kMaxSize];
};

}  // namespace __tsan

#endif  // TSAN_IGNORESET_H