summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Fuzzer/FuzzerInterface.cpp
diff options
context:
space:
mode:
authorKostya Serebryany <kcc@google.com>2015-05-22 22:35:31 +0000
committerKostya Serebryany <kcc@google.com>2015-05-22 22:35:31 +0000
commitf342459aa4f7aff7ae02e52513322f7f6921a2c2 (patch)
tree89fe8585b34a7c9e676201bc1085ff512710aece /llvm/lib/Fuzzer/FuzzerInterface.cpp
parentcb0829943bd6c7c1947d86ffffb23a274b1fba0d (diff)
downloadbcm5719-llvm-f342459aa4f7aff7ae02e52513322f7f6921a2c2.tar.gz
bcm5719-llvm-f342459aa4f7aff7ae02e52513322f7f6921a2c2.zip
[lib/Fuzzer] extend the fuzzer interface to allow user-supplied mutators
llvm-svn: 238059
Diffstat (limited to 'llvm/lib/Fuzzer/FuzzerInterface.cpp')
-rw-r--r--llvm/lib/Fuzzer/FuzzerInterface.cpp27
1 files changed, 27 insertions, 0 deletions
diff --git a/llvm/lib/Fuzzer/FuzzerInterface.cpp b/llvm/lib/Fuzzer/FuzzerInterface.cpp
new file mode 100644
index 00000000000..dcd4e746013
--- /dev/null
+++ b/llvm/lib/Fuzzer/FuzzerInterface.cpp
@@ -0,0 +1,27 @@
+//===- FuzzerInterface.cpp - Mutate a test input --------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+// Parts of public interface for libFuzzer.
+//===----------------------------------------------------------------------===//
+
+
+#include "FuzzerInterface.h"
+#include "FuzzerInternal.h"
+
+namespace fuzzer {
+size_t UserSuppliedFuzzer::BasicMutate(uint8_t *Data, size_t Size,
+ size_t MaxSize) {
+ return ::fuzzer::Mutate(Data, Size, MaxSize);
+}
+size_t UserSuppliedFuzzer::BasicCrossOver(const uint8_t *Data1, size_t Size1,
+ const uint8_t *Data2, size_t Size2,
+ uint8_t *Out, size_t MaxOutSize) {
+ return ::fuzzer::CrossOver(Data1, Size1, Data2, Size2, Out, MaxOutSize);
+}
+
+} // namespace fuzzer.
OpenPOWER on IntegriCloud