LLVM
15.0.0git
|
#include "llvm/FuzzMutate/IRMutator.h"
Public Member Functions | |
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 (Instruction &Inst, RandomIRBuilder &IB) override |
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) |
![]() | |
virtual | ~IRMutationStrategy ()=default |
virtual void | mutate (Module &M, RandomIRBuilder &IB) |
virtual void | mutate (Function &F, RandomIRBuilder &IB) |
virtual void | mutate (BasicBlock &BB, RandomIRBuilder &IB) |
Definition at line 108 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 110 of file IRMutator.h.
void IRMutationStrategy::mutate |
Definition at line 55 of file IRMutator.cpp.
void IRMutationStrategy::mutate |
Definition at line 51 of file IRMutator.cpp.
|
inline |
Definition at line 54 of file IRMutator.h.
|
overridevirtual |
Reimplemented from llvm::IRMutationStrategy.
Definition at line 209 of file IRMutator.cpp.
References llvm::MCID::Add, function, GEP, llvm::Instruction::getOpcode(), llvm::CmpInst::ICMP_EQ, llvm::CmpInst::ICMP_NE, llvm::CmpInst::ICMP_SGE, llvm::CmpInst::ICMP_SGT, llvm::CmpInst::ICMP_SLE, llvm::CmpInst::ICMP_SLT, llvm::CmpInst::ICMP_UGE, llvm::CmpInst::ICMP_UGT, llvm::CmpInst::ICMP_ULE, llvm::CmpInst::ICMP_ULT, llvm::makeSampler(), Mul, llvm::RandomIRBuilder::Rand, llvm::Instruction::setHasNoSignedWrap(), llvm::Instruction::setHasNoUnsignedWrap(), and llvm::CmpInst::setPredicate().
void IRMutationStrategy::mutate |
Mutators for each IR unit. By default these forward to a contained instance of the next smaller unit.
Definition at line 39 of file IRMutator.cpp.