LLVM
8.0.1
|
Strategy that injects operations into the function. More...
#include "llvm/FuzzMutate/IRMutator.h"
Public Member Functions | |
InjectorIRStrategy (std::vector< fuzzerop::OpDescriptor > &&Operations) | |
uint64_t | getWeight (size_t CurrentSize, size_t MaxSize, uint64_t CurrentWeight) override |
Provide a weight to bias towards choosing this strategy for a mutation. More... | |
void | mutate (Function &F, RandomIRBuilder &IB) override |
void | mutate (BasicBlock &BB, RandomIRBuilder &IB) override |
Public Member Functions inherited from llvm::IRMutationStrategy | |
virtual | ~IRMutationStrategy ()=default |
virtual void | mutate (Module &M, RandomIRBuilder &IB) |
virtual void | mutate (Instruction &I, RandomIRBuilder &IB) |
Static Public Member Functions | |
static std::vector< fuzzerop::OpDescriptor > | getDefaultOps () |
Strategy that injects operations into the function.
Definition at line 75 of file IRMutator.h.
|
inline |
Definition at line 82 of file IRMutator.h.
|
static |
Definition at line 85 of file IRMutator.cpp.
References llvm::describeFuzzerAggregateOps(), llvm::describeFuzzerControlFlowOps(), llvm::describeFuzzerFloatOps(), llvm::describeFuzzerIntOps(), llvm::describeFuzzerPointerOps(), llvm::describeFuzzerVectorOps(), llvm::make_filter_range(), llvm::makeSampler(), llvm::None, and llvm::RandomIRBuilder::Rand.
|
inlineoverridevirtual |
Provide a weight to bias towards choosing this strategy for a mutation.
The value of the weight is arbitrary, but a good default is "the number of
distinct ways in which this strategy can mutate a unit". This can also be used to prefer strategies that shrink the overall size of the result when we start getting close to MaxSize
.
Implements llvm::IRMutationStrategy.
Definition at line 86 of file IRMutator.h.
References F(), and llvm::IRMutationStrategy::mutate().
|
overridevirtual |
Reimplemented from llvm::IRMutationStrategy.
Definition at line 80 of file IRMutator.cpp.
References eliminateDeadCode(), and llvm::IRMutationStrategy::mutate().
|
overridevirtual |
Reimplemented from llvm::IRMutationStrategy.
Definition at line 107 of file IRMutator.cpp.
References llvm::RandomIRBuilder::connectToSink(), E, llvm::BasicBlock::end(), llvm::RandomIRBuilder::findOrCreateSource(), llvm::BasicBlock::getFirstInsertionPt(), I, llvm::makeArrayRef(), llvm::SmallVectorTemplateBase< T >::push_back(), llvm::RandomIRBuilder::Rand, and llvm::SmallVectorBase::size().