class IRMutationStrategy

Declaration

class IRMutationStrategy { /* full declaration omitted */ };

Description

Base class for describing how to mutate a module. mutation functions for each IR unit forward to the contained unit.

Declared at: llvm/include/llvm/FuzzMutate/IRMutator.h:35

Method Overview

  • public virtual uint64_t getWeight(size_t CurrentSize, size_t MaxSize, uint64_t CurrentWeight)
  • public virtual void mutate(llvm::Module & M, llvm::RandomIRBuilder & IB)
  • public virtual void mutate(llvm::Function & F, llvm::RandomIRBuilder & IB)
  • public virtual void mutate(llvm::BasicBlock & BB, llvm::RandomIRBuilder & IB)
  • public virtual void mutate(llvm::Instruction & I, llvm::RandomIRBuilder & IB)
  • public virtual ~IRMutationStrategy()

Methods

virtual uint64_t getWeight(size_t CurrentSize,
                           size_t MaxSize,
                           uint64_t CurrentWeight)

Description

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 \c MaxSize.

Declared at: llvm/include/llvm/FuzzMutate/IRMutator.h:45

Parameters

size_t CurrentSize
size_t MaxSize
uint64_t CurrentWeight

virtual void mutate(llvm::Module& M,
                    llvm::RandomIRBuilder& IB)

Description

@ { Mutators for each IR unit. By default these forward to a contained instance of the next smaller unit.

Declared at: llvm/include/llvm/FuzzMutate/IRMutator.h:51

Parameters

llvm::Module& M
llvm::RandomIRBuilder& IB

virtual void mutate(llvm::Function& F,
                    llvm::RandomIRBuilder& IB)

Declared at: llvm/include/llvm/FuzzMutate/IRMutator.h:52

Parameters

llvm::Function& F
llvm::RandomIRBuilder& IB

virtual void mutate(llvm::BasicBlock& BB,
                    llvm::RandomIRBuilder& IB)

Declared at: llvm/include/llvm/FuzzMutate/IRMutator.h:53

Parameters

llvm::BasicBlock& BB
llvm::RandomIRBuilder& IB

virtual void mutate(llvm::Instruction& I,
                    llvm::RandomIRBuilder& IB)

Declared at: llvm/include/llvm/FuzzMutate/IRMutator.h:54

Parameters

llvm::Instruction& I
llvm::RandomIRBuilder& IB

virtual ~IRMutationStrategy()

Declared at: llvm/include/llvm/FuzzMutate/IRMutator.h:37