1 //===- FuzzerDFSan.h - Internal header for the Fuzzer -----------*- 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 //===----------------------------------------------------------------------===//
12 #ifndef LLVM_FUZZER_DFSAN_H
13 #define LLVM_FUZZER_DFSAN_H
15 #ifndef LLVM_FUZZER_SUPPORTS_DFSAN
16 # if defined(__linux__)
17 # define LLVM_FUZZER_SUPPORTS_DFSAN 1
19 # define LLVM_FUZZER_SUPPORTS_DFSAN 0
21 #endif // LLVM_FUZZER_SUPPORTS_DFSAN
23 #include <sanitizer/dfsan_interface.h>
24 #if LLVM_FUZZER_SUPPORTS_DFSAN
28 dfsan_label dfsan_create_label(const char *desc, void *userdata);
30 void dfsan_set_label(dfsan_label label, void *addr, size_t size);
32 void dfsan_add_label(dfsan_label label, void *addr, size_t size);
34 const struct dfsan_label_info *dfsan_get_label_info(dfsan_label label);
36 dfsan_label dfsan_read_label(const void *addr, size_t size);
40 static bool ReallyHaveDFSan() {
41 return &dfsan_create_label != nullptr;
46 static bool ReallyHaveDFSan() { return false; }
51 #endif // LLVM_FUZZER_DFSAN_H