LLVM  6.0.0svn
Public Member Functions | Public Attributes | List of all members
llvm::RandomIRBuilder Struct Reference

#include "llvm/FuzzMutate/RandomIRBuilder.h"

Collaboration diagram for llvm::RandomIRBuilder:
Collaboration graph
[legend]

Public Member Functions

 RandomIRBuilder (int Seed, ArrayRef< Type *> AllowedTypes)
 
ValuefindOrCreateSource (BasicBlock &BB, ArrayRef< Instruction *> Insts)
 Find a "source" for some operation, which will be used in one of the operation's operands. More...
 
ValuefindOrCreateSource (BasicBlock &BB, ArrayRef< Instruction *> Insts, ArrayRef< Value *> Srcs, fuzzerop::SourcePred Pred)
 Find a "source" for some operation, which will be used in one of the operation's operands. More...
 
ValuenewSource (BasicBlock &BB, ArrayRef< Instruction *> Insts, ArrayRef< Value *> Srcs, fuzzerop::SourcePred Pred)
 Create some Value suitable as a source for some operation. More...
 
void connectToSink (BasicBlock &BB, ArrayRef< Instruction *> Insts, Value *V)
 Find a viable user for V in Insts, which should all be contained in BB. More...
 
void newSink (BasicBlock &BB, ArrayRef< Instruction *> Insts, Value *V)
 Create a user for V in BB. More...
 
ValuefindPointer (BasicBlock &BB, ArrayRef< Instruction *> Insts, ArrayRef< Value *> Srcs, fuzzerop::SourcePred Pred)
 
TypechooseType (LLVMContext &Context, ArrayRef< Value *> Srcs, fuzzerop::SourcePred Pred)
 

Public Attributes

RandomEngine Rand
 
SmallVector< Type *, 16 > KnownTypes
 

Detailed Description

Definition at line 26 of file RandomIRBuilder.h.

Constructor & Destructor Documentation

◆ RandomIRBuilder()

llvm::RandomIRBuilder::RandomIRBuilder ( int  Seed,
ArrayRef< Type *>  AllowedTypes 
)
inline

Member Function Documentation

◆ chooseType()

Type* llvm::RandomIRBuilder::chooseType ( LLVMContext Context,
ArrayRef< Value *>  Srcs,
fuzzerop::SourcePred  Pred 
)

Referenced by RandomIRBuilder().

◆ connectToSink()

void RandomIRBuilder::connectToSink ( BasicBlock BB,
ArrayRef< Instruction *>  Insts,
Value V 
)

Find a viable user for V in Insts, which should all be contained in BB.

This may also create some new instruction in BB and use that.

Definition at line 90 of file RandomIRBuilder.cpp.

References I, isCompatibleReplacement(), llvm::User::setOperand(), and llvm::cl::Sink.

Referenced by llvm::InjectorIRStrategy::mutate(), and RandomIRBuilder().

◆ findOrCreateSource() [1/2]

Value * RandomIRBuilder::findOrCreateSource ( BasicBlock BB,
ArrayRef< Instruction *>  Insts 
)

Find a "source" for some operation, which will be used in one of the operation's operands.

This either selects an instruction in Insts or returns some new arbitrary Value.

Definition at line 23 of file RandomIRBuilder.cpp.

References llvm::fuzzerop::anyType().

Referenced by llvm::InjectorIRStrategy::mutate(), and RandomIRBuilder().

◆ findOrCreateSource() [2/2]

Value * RandomIRBuilder::findOrCreateSource ( BasicBlock BB,
ArrayRef< Instruction *>  Insts,
ArrayRef< Value *>  Srcs,
fuzzerop::SourcePred  Pred 
)

Find a "source" for some operation, which will be used in one of the operation's operands.

This either selects an instruction in Insts that matches Pred, or returns some new Value that matches Pred. The values in Srcs should be source operands that have already been selected.

Definition at line 28 of file RandomIRBuilder.cpp.

References llvm::make_filter_range(), llvm::makeSampler(), and llvm::fuzzerop::SourcePred::matches().

◆ findPointer()

Value * RandomIRBuilder::findPointer ( BasicBlock BB,
ArrayRef< Instruction *>  Insts,
ArrayRef< Value *>  Srcs,
fuzzerop::SourcePred  Pred 
)

◆ newSink()

void RandomIRBuilder::newSink ( BasicBlock BB,
ArrayRef< Instruction *>  Insts,
Value V 
)

◆ newSource()

Value * RandomIRBuilder::newSource ( BasicBlock BB,
ArrayRef< Instruction *>  Insts,
ArrayRef< Value *>  Srcs,
fuzzerop::SourcePred  Pred 
)

Create some Value suitable as a source for some operation.

Definition at line 43 of file RandomIRBuilder.cpp.

References assert(), llvm::fuzzerop::SourcePred::generate(), llvm::BasicBlock::getFirstInsertionPt(), and I.

Referenced by llvm::InstDeleterIRStrategy::mutate(), and RandomIRBuilder().

Member Data Documentation

◆ KnownTypes

SmallVector<Type *, 16> llvm::RandomIRBuilder::KnownTypes

Definition at line 28 of file RandomIRBuilder.h.

◆ Rand

RandomEngine llvm::RandomIRBuilder::Rand

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