1 //===-- dfsan.h -------------------------------------------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This file is a part of DataFlowSanitizer.
12 // Private DFSan header.
13 //===----------------------------------------------------------------------===//
18 #include "sanitizer_common/sanitizer_internal_defs.h"
20 // Copy declarations from public sanitizer/dfsan_interface.h header here.
21 typedef u16 dfsan_label
;
23 struct dfsan_label_info
{
31 void dfsan_add_label(dfsan_label label
, void *addr
, uptr size
);
32 void dfsan_set_label(dfsan_label label
, void *addr
, uptr size
);
33 dfsan_label
dfsan_read_label(const void *addr
, uptr size
);
34 dfsan_label
dfsan_union(dfsan_label l1
, dfsan_label l2
);
38 void dfsan_set_label(dfsan_label label
, T
&data
) { // NOLINT
39 dfsan_set_label(label
, (void *)&data
, sizeof(T
));
44 void InitializeInterceptors();
46 inline dfsan_label
*shadow_for(void *ptr
) {
47 return (dfsan_label
*) ((((uptr
) ptr
) & ~0x700000000000) << 1);
50 inline const dfsan_label
*shadow_for(const void *ptr
) {
51 return shadow_for(const_cast<void *>(ptr
));
55 // Whether to warn on unimplemented functions.
56 bool warn_unimplemented
;
57 // Whether to warn on non-zero labels.
58 bool warn_nonzero_labels
;
59 // Whether to propagate labels only when there is an obvious data dependency
60 // (e.g., when comparing strings, ignore the fact that the output of the
61 // comparison might be data-dependent on the content of the strings). This
62 // applies only to the custom functions defined in 'custom.c'.
63 bool strict_data_dependencies
;
66 extern Flags flags_data
;
67 inline Flags
&flags() {
71 } // namespace __dfsan