LLVM 20.0.0git
|
Base class for describing how to mutate a module. More...
#include "llvm/FuzzMutate/IRMutator.h"
Public Member Functions | |
virtual | ~IRMutationStrategy ()=default |
virtual uint64_t | getWeight (size_t CurrentSize, size_t MaxSize, uint64_t CurrentWeight)=0 |
Provide a weight to bias towards choosing this strategy for a mutation. | |
virtual void | mutate (Module &M, RandomIRBuilder &IB) |
virtual void | mutate (Function &F, RandomIRBuilder &IB) |
virtual void | mutate (BasicBlock &BB, RandomIRBuilder &IB) |
virtual void | mutate (Instruction &I, RandomIRBuilder &IB) |
Base class for describing how to mutate a module.
mutation functions for each IR unit forward to the contained unit.
Definition at line 35 of file IRMutator.h.
|
virtualdefault |
|
pure virtual |
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
.
Implemented in llvm::InjectorIRStrategy, llvm::InstDeleterIRStrategy, llvm::InstModificationIRStrategy, llvm::InsertFunctionStrategy, llvm::InsertCFGStrategy, llvm::InsertPHIStrategy, llvm::SinkInstructionStrategy, and llvm::ShuffleBlockStrategy.
|
virtual |
Reimplemented in llvm::InjectorIRStrategy, llvm::InstDeleterIRStrategy, llvm::InstModificationIRStrategy, llvm::InsertFunctionStrategy, llvm::InjectorIRStrategy, llvm::InsertFunctionStrategy, llvm::InsertCFGStrategy, llvm::InsertPHIStrategy, llvm::SinkInstructionStrategy, and llvm::ShuffleBlockStrategy.
Definition at line 56 of file IRMutator.cpp.
References llvm::make_pointer_range(), llvm::makeSampler(), and mutate().
|
virtual |
Reimplemented in llvm::InjectorIRStrategy, llvm::InstDeleterIRStrategy, llvm::InstModificationIRStrategy, llvm::InsertFunctionStrategy, llvm::InjectorIRStrategy, llvm::InstDeleterIRStrategy, and llvm::SinkInstructionStrategy.
Definition at line 49 of file IRMutator.cpp.
References F, llvm::make_filter_range(), llvm::make_pointer_range(), and Range.
|
inlinevirtual |
Reimplemented in llvm::InjectorIRStrategy, llvm::InstDeleterIRStrategy, llvm::InstModificationIRStrategy, llvm::InsertFunctionStrategy, llvm::InstDeleterIRStrategy, and llvm::InstModificationIRStrategy.
Definition at line 54 of file IRMutator.h.
References llvm_unreachable.
|
virtual |
Mutators for each IR unit. By default these forward to a contained instance of the next smaller unit.
Reimplemented in llvm::InjectorIRStrategy, llvm::InstDeleterIRStrategy, llvm::InstModificationIRStrategy, and llvm::InsertFunctionStrategy.
Definition at line 36 of file IRMutator.cpp.
Referenced by llvm::InjectorIRStrategy::mutate(), and mutate().