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