xref: /openbsd-src/gnu/llvm/compiler-rt/lib/fuzzer/dataflow/DataFlow.h (revision 3cab2bb3f667058bece8e38b12449a63a9d73c4b)
1*3cab2bb3Spatrick /*===- DataFlow.h - a standalone DataFlow trace                     -------===//
2*3cab2bb3Spatrick //
3*3cab2bb3Spatrick // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4*3cab2bb3Spatrick // See https://llvm.org/LICENSE.txt for license information.
5*3cab2bb3Spatrick // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6*3cab2bb3Spatrick //
7*3cab2bb3Spatrick //===----------------------------------------------------------------------===//
8*3cab2bb3Spatrick // Internal header file to connect DataFlow.cpp and DataFlowCallbacks.cpp.
9*3cab2bb3Spatrick //===----------------------------------------------------------------------===*/
10*3cab2bb3Spatrick 
11*3cab2bb3Spatrick #ifndef __LIBFUZZER_DATAFLOW_H
12*3cab2bb3Spatrick #define __LIBFUZZER_DATAFLOW_H
13*3cab2bb3Spatrick 
14*3cab2bb3Spatrick #include <cstddef>
15*3cab2bb3Spatrick #include <cstdint>
16*3cab2bb3Spatrick #include <sanitizer/dfsan_interface.h>
17*3cab2bb3Spatrick 
18*3cab2bb3Spatrick // This data is shared between DataFlowCallbacks.cpp and DataFlow.cpp.
19*3cab2bb3Spatrick struct CallbackData {
20*3cab2bb3Spatrick   size_t NumFuncs, NumGuards;
21*3cab2bb3Spatrick   const uintptr_t *PCsBeg, *PCsEnd;
22*3cab2bb3Spatrick   dfsan_label *FuncLabels;  // Array of NumFuncs elements.
23*3cab2bb3Spatrick   bool *BBExecuted;         // Array of NumGuards elements.
24*3cab2bb3Spatrick };
25*3cab2bb3Spatrick 
26*3cab2bb3Spatrick extern CallbackData __dft;
27*3cab2bb3Spatrick 
28*3cab2bb3Spatrick enum {
29*3cab2bb3Spatrick   PCFLAG_FUNC_ENTRY = 1,
30*3cab2bb3Spatrick };
31*3cab2bb3Spatrick 
32*3cab2bb3Spatrick #endif  // __LIBFUZZER_DATAFLOW_H
33