LLVM 22.0.0git
llvm::IRMutator Class Reference

Entry point for configuring and running IR mutations. More...

#include "llvm/FuzzMutate/IRMutator.h"

Public Member Functions

 IRMutator (std::vector< TypeGetter > &&AllowedTypes, std::vector< std::unique_ptr< IRMutationStrategy > > &&Strategies)
LLVM_ABI void mutateModule (Module &M, int Seed, size_t MaxSize)
 Mutate given module.

Static Public Member Functions

static LLVM_ABI size_t getModuleSize (const Module &M)
 Calculate the size of module as the number of objects in it, i.e.

Detailed Description

Entry point for configuring and running IR mutations.

Definition at line 64 of file IRMutator.h.

Constructor & Destructor Documentation

◆ IRMutator()

llvm::IRMutator::IRMutator ( std::vector< TypeGetter > && AllowedTypes,
std::vector< std::unique_ptr< IRMutationStrategy > > && Strategies )
inline

Definition at line 69 of file IRMutator.h.

References llvm::move().

Member Function Documentation

◆ getModuleSize()

size_t llvm::IRMutator::getModuleSize ( const Module & M)
static

Calculate the size of module as the number of objects in it, i.e.

instructions, basic blocks, functions, and aliases.

Parameters
Mmodule
Returns
number of objects in module

Definition at line 62 of file IRMutator.cpp.

Referenced by mutateModule().

◆ mutateModule()

void IRMutator::mutateModule ( Module & M,
int Seed,
size_t MaxSize )

Mutate given module.

No change will be made if no strategy is selected.

Parameters
Mmodule to mutate
Seedseed for random mutation
MaxSizemax module size (see getModuleSize)

Definition at line 66 of file IRMutator.cpp.

References getModuleSize(), llvm::makeSampler(), and Seed.


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