Vendor import of llvm-project branch release/19.x llvmorg-19.1.1-0-gd401987fe349...
[freebsd/src.git] / compiler-rt / lib / rtsan / rtsan_context.h
blob515bb8ade1eb97fe26f71b2d4d130292b07775e3
1 //===--- rtsan_context.h - Realtime Sanitizer -------------------*- C++ -*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 //===----------------------------------------------------------------------===//
11 #pragma once
13 namespace __rtsan {
15 class Context {
16 public:
17 Context();
19 void RealtimePush();
20 void RealtimePop();
22 void BypassPush();
23 void BypassPop();
25 void ExpectNotRealtime(const char *intercepted_function_name);
27 private:
28 bool InRealtimeContext() const;
29 bool IsBypassed() const;
30 void PrintDiagnostics(const char *intercepted_function_name);
32 int realtime_depth{0};
33 int bypass_depth{0};
36 Context &GetContextForThisThread();
38 } // namespace __rtsan