llvm.org GIT mirror llvm / 5a08f1b
[libFuzzer] remove the C++-ish variant of FuzzerDriver from the interface git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260801 91177308-0d34-0410-b5e6-96231b3b80d8 Kostya Serebryany 4 years ago
2 changed file(s) with 7 addition(s) and 12 deletion(s). Raw diff Collapse all Expand all
240240 return true;
241241 }
242242
243 int FuzzerDriver(int argc, char **argv, UserCallback Callback) {
244 std::vector Args(argv, argv + argc);
245 return FuzzerDriver(Args, Callback);
246 }
247
248 int FuzzerDriver(const std::vector &Args, UserCallback Callback) {
243 static int FuzzerDriver(const std::vector &Args,
244 UserCallback Callback) {
249245 using namespace fuzzer;
250246 assert(!Args.empty());
251247 ProgName = new std::string(Args[0]);
376372 exit(0); // Don't let F destroy itself.
377373 }
378374
375 int FuzzerDriver(int argc, char **argv, UserCallback Callback) {
376 std::vector Args(argv, argv + argc);
377 return FuzzerDriver(Args, Callback);
378 }
379
379380 } // namespace fuzzer
1515 #ifndef LLVM_FUZZER_INTERFACE_H
1616 #define LLVM_FUZZER_INTERFACE_H
1717
18 #include
1918 #include
2019 #include
21 #include
22 #include
2320
2421 // Plain C interface. Should be sufficient for most uses.
2522 extern "C" {
7269 */
7370 int FuzzerDriver(int argc, char **argv, UserCallback Callback);
7471
75 /// More C++-ish interface.
76 int FuzzerDriver(const std::vector &Args, UserCallback Callback);
77
7872 // Same interface as LLVMFuzzerTestOneInput.
7973 // Can be used inside the user-supplied LLVMFuzzerTestOneInput.
8074 size_t Mutate(uint8_t *Data, size_t Size, size_t MaxSize, unsigned int Seed);