[libFuzzer] introduce LLVMFuzzerInitialize
llvm-svn: 257980
diff --git a/llvm/lib/Fuzzer/FuzzerInterface.h b/llvm/lib/Fuzzer/FuzzerInterface.h
index 683ce92..b64dff8 100644
--- a/llvm/lib/Fuzzer/FuzzerInterface.h
+++ b/llvm/lib/Fuzzer/FuzzerInterface.h
@@ -23,7 +23,6 @@
#include <string>
namespace fuzzer {
-typedef std::vector<uint8_t> Unit;
/// Returns an int 0. Values other than zero are reserved for future.
typedef int (*UserCallback)(const uint8_t *Data, size_t Size);
@@ -39,6 +38,15 @@
return 0;
}
+// Optional.
+// Define this only if you need to read/modify argc/argv at startup
+// and you are using libFuzzer's main().
+// Must return 0.
+int LLVMFuzzerInitialize(int *argc, char ***argv) {
+ ReadAndMaybeModify(argc, argv);
+ return 0;
+}
+
// Implement your own main() or use the one from FuzzerMain.cpp.
int main(int argc, char **argv) {
InitializeMeIfNeeded();