LLVM 22.0.0git
|
Strategy to split a random block and insert a random CFG in between. More...
#include "llvm/FuzzMutate/IRMutator.h"
Public Member Functions | |
InsertCFGStrategy (uint64_t MNC=8) | |
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. | |
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 (Function &F, RandomIRBuilder &IB) |
virtual void | mutate (Instruction &I, RandomIRBuilder &IB) |
Strategy to split a random block and insert a random CFG in between.
Definition at line 150 of file IRMutator.h.
|
inline |
Definition at line 156 of file IRMutator.h.
|
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 157 of file IRMutator.h.
|
overridevirtual |
Reimplemented from llvm::IRMutationStrategy.
Definition at line 511 of file IRMutator.cpp.
References llvm::ArrayRef(), assert(), llvm::Block, llvm::CallingConv::C, llvm::cast(), Cond, llvm::BasicBlock::Create(), llvm::BranchInst::Create(), llvm::SwitchInst::Create(), F, getInsertionRange(), llvm::Type::getInt1Ty(), llvm::BasicBlock::getParent(), getUniqueCaseValue(), llvm::make_filter_range(), llvm::make_pointer_range(), llvm::makeSampler(), llvm::fuzzerop::onlyType(), llvm::ReplaceInstWithInst(), llvm::SmallVectorTemplateCommon< T, typename >::size(), and llvm::uniform().