1 //===-- dfsan.h -------------------------------------------------*- C++ -*-===//
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
7 //===----------------------------------------------------------------------===//
9 // This file is a part of DataFlowSanitizer.
11 // Private DFSan header.
12 //===----------------------------------------------------------------------===//
17 #include "sanitizer_common/sanitizer_internal_defs.h"
18 #include "dfsan_platform.h"
20 using __sanitizer::uptr
;
21 using __sanitizer::u16
;
23 // Copy declarations from public sanitizer/dfsan_interface.h header here.
24 typedef u16 dfsan_label
;
26 struct dfsan_label_info
{
34 void dfsan_add_label(dfsan_label label
, void *addr
, uptr size
);
35 void dfsan_set_label(dfsan_label label
, void *addr
, uptr size
);
36 dfsan_label
dfsan_read_label(const void *addr
, uptr size
);
37 dfsan_label
dfsan_union(dfsan_label l1
, dfsan_label l2
);
41 void dfsan_set_label(dfsan_label label
, T
&data
) { // NOLINT
42 dfsan_set_label(label
, (void *)&data
, sizeof(T
));
47 void InitializeInterceptors();
49 inline dfsan_label
*shadow_for(void *ptr
) {
50 return (dfsan_label
*) ((((uptr
) ptr
) & ShadowMask()) << 1);
53 inline const dfsan_label
*shadow_for(const void *ptr
) {
54 return shadow_for(const_cast<void *>(ptr
));
58 #define DFSAN_FLAG(Type, Name, DefaultValue, Description) Type Name;
59 #include "dfsan_flags.inc"
65 extern Flags flags_data
;
66 inline Flags
&flags() {
70 } // namespace __dfsan