From ef83d4c558ba98cb37065fc5c5290960de648cbc Mon Sep 17 00:00:00 2001 From: Kostya Serebryany Date: Sat, 13 Feb 2016 03:59:26 +0000 Subject: [PATCH] [libFuzzer] remove the C++-ish variant of FuzzerDriver from the interface llvm-svn: 260801 --- lib/Fuzzer/FuzzerDriver.cpp | 13 +++++++------ lib/Fuzzer/FuzzerInterface.h | 6 ------ 2 files changed, 7 insertions(+), 12 deletions(-) diff --git a/lib/Fuzzer/FuzzerDriver.cpp b/lib/Fuzzer/FuzzerDriver.cpp index 16a14703698..92971b76bd0 100644 --- a/lib/Fuzzer/FuzzerDriver.cpp +++ b/lib/Fuzzer/FuzzerDriver.cpp @@ -241,12 +241,8 @@ static bool AllInputsAreFiles() { return true; } -int FuzzerDriver(int argc, char **argv, UserCallback Callback) { - std::vector Args(argv, argv + argc); - return FuzzerDriver(Args, Callback); -} - -int FuzzerDriver(const std::vector &Args, UserCallback Callback) { +static int FuzzerDriver(const std::vector &Args, + UserCallback Callback) { using namespace fuzzer; assert(!Args.empty()); ProgName = new std::string(Args[0]); @@ -377,4 +373,9 @@ int FuzzerDriver(const std::vector &Args, UserCallback Callback) { exit(0); // Don't let F destroy itself. } +int FuzzerDriver(int argc, char **argv, UserCallback Callback) { + std::vector Args(argv, argv + argc); + return FuzzerDriver(Args, Callback); +} + } // namespace fuzzer diff --git a/lib/Fuzzer/FuzzerInterface.h b/lib/Fuzzer/FuzzerInterface.h index 04e9b8350b9..48a5c1bf71e 100644 --- a/lib/Fuzzer/FuzzerInterface.h +++ b/lib/Fuzzer/FuzzerInterface.h @@ -16,11 +16,8 @@ #ifndef LLVM_FUZZER_INTERFACE_H #define LLVM_FUZZER_INTERFACE_H -#include #include #include -#include -#include // Plain C interface. Should be sufficient for most uses. extern "C" { @@ -73,9 +70,6 @@ int main(int argc, char **argv) { */ int FuzzerDriver(int argc, char **argv, UserCallback Callback); -/// More C++-ish interface. -int FuzzerDriver(const std::vector &Args, UserCallback Callback); - // Same interface as LLVMFuzzerTestOneInput. // Can be used inside the user-supplied LLVMFuzzerTestOneInput. size_t Mutate(uint8_t *Data, size_t Size, size_t MaxSize, unsigned int Seed);