class InjectorIRStrategy

Declaration

class InjectorIRStrategy : public IRMutationStrategy { /* full declaration omitted */ };

Description

Strategy that injects operations into the function.

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

Inherits from: IRMutationStrategy

Method Overview

  • public InjectorIRStrategy(std::vector<fuzzerop::OpDescriptor> && Operations)
  • public static std::vector<fuzzerop::OpDescriptor> getDefaultOps()
  • public uint64_t getWeight(size_t CurrentSize, size_t MaxSize, uint64_t CurrentWeight)
  • public void mutate(llvm::Function & F, llvm::RandomIRBuilder & IB)
  • public void mutate(llvm::BasicBlock & BB, llvm::RandomIRBuilder & IB)

Inherited from IRMutationStrategy:

Methods

InjectorIRStrategy(
    std::vector<fuzzerop::OpDescriptor>&&
        Operations)

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

Parameters

std::vector<fuzzerop::OpDescriptor>&& Operations

static std::vector<fuzzerop::OpDescriptor>
getDefaultOps()

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

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:85

Parameters

size_t CurrentSize
size_t MaxSize
uint64_t CurrentWeight

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

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

Parameters

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

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

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

Parameters

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