From 10ab2ace1359fd96cd662ad235797e29f9ba3daa Mon Sep 17 00:00:00 2001 From: George Karpenkov Date: Mon, 21 Aug 2017 23:25:50 +0000 Subject: Move libFuzzer to compiler_rt. Resulting library binaries will be named libclang_rt.fuzzer*, and will be placed in Clang toolchain, allowing redistribution. Differential Revision: https://reviews.llvm.org/D36908 llvm-svn: 311407 --- compiler-rt/lib/fuzzer/FuzzerExtFunctions.h | 35 +++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 compiler-rt/lib/fuzzer/FuzzerExtFunctions.h (limited to 'compiler-rt/lib/fuzzer/FuzzerExtFunctions.h') diff --git a/compiler-rt/lib/fuzzer/FuzzerExtFunctions.h b/compiler-rt/lib/fuzzer/FuzzerExtFunctions.h new file mode 100644 index 00000000000..2672a385478 --- /dev/null +++ b/compiler-rt/lib/fuzzer/FuzzerExtFunctions.h @@ -0,0 +1,35 @@ +//===- FuzzerExtFunctions.h - Interface to external functions ---*- C++ -* ===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +// Defines an interface to (possibly optional) functions. +//===----------------------------------------------------------------------===// + +#ifndef LLVM_FUZZER_EXT_FUNCTIONS_H +#define LLVM_FUZZER_EXT_FUNCTIONS_H + +#include +#include + +namespace fuzzer { + +struct ExternalFunctions { + // Initialize function pointers. Functions that are not available will be set + // to nullptr. Do not call this constructor before ``main()`` has been + // entered. + ExternalFunctions(); + +#define EXT_FUNC(NAME, RETURN_TYPE, FUNC_SIG, WARN) \ + RETURN_TYPE(*NAME) FUNC_SIG = nullptr + +#include "FuzzerExtFunctions.def" + +#undef EXT_FUNC +}; +} // namespace fuzzer + +#endif -- cgit v1.2.3