[lib/Fuzzer] extend the fuzzer interface to allow user-supplied mutators
[oota-llvm.git] / lib / Fuzzer / FuzzerInterface.cpp
1 //===- FuzzerInterface.cpp - Mutate a test input --------------------------===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 // Parts of public interface for libFuzzer.
10 //===----------------------------------------------------------------------===//
11
12
13 #include "FuzzerInterface.h"
14 #include "FuzzerInternal.h"
15
16 namespace fuzzer {
17 size_t UserSuppliedFuzzer::BasicMutate(uint8_t *Data, size_t Size,
18                                        size_t MaxSize) {
19   return ::fuzzer::Mutate(Data, Size, MaxSize);
20 }
21 size_t UserSuppliedFuzzer::BasicCrossOver(const uint8_t *Data1, size_t Size1,
22                                           const uint8_t *Data2, size_t Size2,
23                                           uint8_t *Out, size_t MaxOutSize) {
24   return ::fuzzer::CrossOver(Data1, Size1, Data2, Size2, Out, MaxOutSize);
25 }
26
27 }  // namespace fuzzer.