tsan: fix linux syscall hooks
[blocksruntime.git] / lib / dfsan / dfsan.h
blob7d023ed322cdcf634e280eba7c65f8a1e99d77c6
1 //===-- dfsan.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 DataFlowSanitizer.
12 // Private DFSan header.
13 //===----------------------------------------------------------------------===//
15 #ifndef DFSAN_H
16 #define DFSAN_H
18 #include "sanitizer/dfsan_interface.h"
20 namespace __dfsan {
22 void InitializeInterceptors();
24 inline dfsan_label *shadow_for(void *ptr) {
25 return (dfsan_label *) ((((uintptr_t) ptr) & ~0x700000000000) << 1);
28 inline const dfsan_label *shadow_for(const void *ptr) {
29 return shadow_for(const_cast<void *>(ptr));
32 struct Flags {
33 // Whether to warn on unimplemented functions.
34 bool warn_unimplemented;
35 // Whether to warn on non-zero labels.
36 bool warn_nonzero_labels;
39 extern Flags flags_data;
40 inline Flags &flags() {
41 return flags_data;
44 } // namespace __dfsan
46 #endif // DFSAN_H