LLVM  13.0.0git
Public Member Functions | List of all members
llvm::InstDeleterIRStrategy Class Reference

#include "llvm/FuzzMutate/IRMutator.h"

Inheritance diagram for llvm::InstDeleterIRStrategy:
Inheritance graph
[legend]
Collaboration diagram for llvm::InstDeleterIRStrategy:
Collaboration graph
[legend]

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 (Function &F, RandomIRBuilder &IB) override
 
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)
 
- Public Member Functions inherited from llvm::IRMutationStrategy
virtual ~IRMutationStrategy ()=default
 
virtual void mutate (Module &M, RandomIRBuilder &IB)
 
virtual void mutate (BasicBlock &BB, RandomIRBuilder &IB)
 

Detailed Description

Definition at line 95 of file IRMutator.h.

Member Function Documentation

◆ getWeight()

uint64_t InstDeleterIRStrategy::getWeight ( size_t  CurrentSize,
size_t  MaxSize,
uint64_t  CurrentWeight 
)
overridevirtual

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 139 of file IRMutator.cpp.

◆ mutate() [1/6]

void IRMutationStrategy::mutate

Definition at line 50 of file IRMutator.cpp.

◆ mutate() [2/6]

void IRMutationStrategy::mutate

Definition at line 46 of file IRMutator.cpp.

◆ mutate() [3/6]

void InstDeleterIRStrategy::mutate ( Function F,
RandomIRBuilder IB 
)
overridevirtual

Reimplemented from llvm::IRMutationStrategy.

Definition at line 153 of file IRMutator.cpp.

References eliminateDeadCode(), F, llvm::instructions(), and llvm::RandomIRBuilder::Rand.

◆ mutate() [4/6]

virtual void llvm::IRMutationStrategy::mutate
inline

Definition at line 51 of file IRMutator.h.

◆ mutate() [5/6]

void InstDeleterIRStrategy::mutate ( Instruction Inst,
RandomIRBuilder IB 
)
overridevirtual

◆ mutate() [6/6]

void IRMutationStrategy::mutate

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

Definition at line 35 of file IRMutator.cpp.


The documentation for this class was generated from the following files: