Path: blob/main/contrib/llvm-project/compiler-rt/lib/fuzzer/FuzzerDefs.h
35262 views
//===- FuzzerDefs.h - Internal header for the Fuzzer ------------*- C++ -* ===//1//2// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.3// See https://llvm.org/LICENSE.txt for license information.4// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception5//6//===----------------------------------------------------------------------===//7// Basic definitions.8//===----------------------------------------------------------------------===//910#ifndef LLVM_FUZZER_DEFS_H11#define LLVM_FUZZER_DEFS_H1213#include <cassert>14#include <cstddef>15#include <cstdint>16#include <cstring>17#include <memory>18#include <set>19#include <string>20#include <vector>212223namespace fuzzer {2425template <class T> T Min(T a, T b) { return a < b ? a : b; }26template <class T> T Max(T a, T b) { return a > b ? a : b; }2728class Random;29class Dictionary;30class DictionaryEntry;31class MutationDispatcher;32struct FuzzingOptions;33class InputCorpus;34struct InputInfo;35struct ExternalFunctions;3637// Global interface to functions that may or may not be available.38extern ExternalFunctions *EF;3940typedef std::vector<uint8_t> Unit;41typedef std::vector<Unit> UnitVector;42typedef int (*UserCallback)(const uint8_t *Data, size_t Size);4344int FuzzerDriver(int *argc, char ***argv, UserCallback Callback);4546uint8_t *ExtraCountersBegin();47uint8_t *ExtraCountersEnd();48void ClearExtraCounters();4950extern bool RunningUserCallback;5152} // namespace fuzzer5354#endif // LLVM_FUZZER_DEFS_H555657