1//===-- tsan_flags.h --------------------------------------------*- 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// This file is a part of ThreadSanitizer (TSan), a race detector.
10// NOTE: This file may be included into user code.
11//===----------------------------------------------------------------------===//
12
13#ifndef TSAN_FLAGS_H
14#define TSAN_FLAGS_H
15
16#include "sanitizer_common/sanitizer_flags.h"
17#include "sanitizer_common/sanitizer_deadlock_detector_interface.h"
18
19#if SANITIZER_APPLE && !SANITIZER_GO
20enum LockDuringWriteSetting {
21 kLockDuringAllWrites,
22 kNoLockDuringWritesCurrentProcess,
23 kNoLockDuringWritesAllProcesses,
24};
25#endif
26
27namespace __tsan {
28
29struct Flags : DDFlags {
30#define TSAN_FLAG(Type, Name, DefaultValue, Description) Type Name;
31#include "tsan_flags.inc"
32#undef TSAN_FLAG
33
34 void SetDefaults();
35 void ParseFromString(const char *str);
36};
37
38void InitializeFlags(Flags *flags, const char *env,
39 const char *env_option_name = nullptr);
40} // namespace __tsan
41
42#endif // TSAN_FLAGS_H
43