#include "llvm/FuzzMutate/IRMutator.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/SmallSet.h"
#include "llvm/Analysis/TargetLibraryInfo.h"
#include "llvm/Bitcode/BitcodeReader.h"
#include "llvm/Bitcode/BitcodeWriter.h"
#include "llvm/FuzzMutate/Operations.h"
#include "llvm/FuzzMutate/Random.h"
#include "llvm/FuzzMutate/RandomIRBuilder.h"
#include "llvm/IR/BasicBlock.h"
#include "llvm/IR/FMF.h"
#include "llvm/IR/Function.h"
#include "llvm/IR/InstIterator.h"
#include "llvm/IR/Instructions.h"
#include "llvm/IR/Module.h"
#include "llvm/IR/Operator.h"
#include "llvm/IR/PassInstrumentation.h"
#include "llvm/IR/Verifier.h"
#include "llvm/Support/MemoryBuffer.h"
#include "llvm/Support/SourceMgr.h"
#include "llvm/Transforms/Scalar/DCE.h"
#include "llvm/Transforms/Utils/BasicBlockUtils.h"
#include <map>
#include <optional>
usingnamespacellvm;
void IRMutationStrategy::mutate(Module &M, RandomIRBuilder &IB) { … }
void IRMutationStrategy::mutate(Function &F, RandomIRBuilder &IB) { … }
void IRMutationStrategy::mutate(BasicBlock &BB, RandomIRBuilder &IB) { … }
size_t llvm::IRMutator::getModuleSize(const Module &M) { … }
void IRMutator::mutateModule(Module &M, int Seed, size_t MaxSize) { … }
static void eliminateDeadCode(Function &F) { … }
void InjectorIRStrategy::mutate(Function &F, RandomIRBuilder &IB) { … }
std::vector<fuzzerop::OpDescriptor> InjectorIRStrategy::getDefaultOps() { … }
std::optional<fuzzerop::OpDescriptor>
InjectorIRStrategy::chooseOperation(Value *Src, RandomIRBuilder &IB) { … }
static inline iterator_range<BasicBlock::iterator>
getInsertionRange(BasicBlock &BB) { … }
void InjectorIRStrategy::mutate(BasicBlock &BB, RandomIRBuilder &IB) { … }
uint64_t InstDeleterIRStrategy::getWeight(size_t CurrentSize, size_t MaxSize,
uint64_t CurrentWeight) { … }
void InstDeleterIRStrategy::mutate(Function &F, RandomIRBuilder &IB) { … }
void InstDeleterIRStrategy::mutate(Instruction &Inst, RandomIRBuilder &IB) { … }
void InstModificationIRStrategy::mutate(Instruction &Inst,
RandomIRBuilder &IB) { … }
static uint64_t getUniqueCaseValue(SmallSet<uint64_t, 4> &CasesTaken,
uint64_t MaxValue, RandomIRBuilder &IB) { … }
void InsertFunctionStrategy::mutate(BasicBlock &BB, RandomIRBuilder &IB) { … }
void InsertCFGStrategy::mutate(BasicBlock &BB, RandomIRBuilder &IB) { … }
void InsertCFGStrategy::connectBlocksToSink(ArrayRef<BasicBlock *> Blocks,
BasicBlock *Sink,
RandomIRBuilder &IB) { … }
void InsertPHIStrategy::mutate(BasicBlock &BB, RandomIRBuilder &IB) { … }
void SinkInstructionStrategy::mutate(Function &F, RandomIRBuilder &IB) { … }
void SinkInstructionStrategy::mutate(BasicBlock &BB, RandomIRBuilder &IB) { … }
void ShuffleBlockStrategy::mutate(BasicBlock &BB, RandomIRBuilder &IB) { … }
std::unique_ptr<Module> llvm::parseModule(const uint8_t *Data, size_t Size,
LLVMContext &Context) { … }
size_t llvm::writeModule(const Module &M, uint8_t *Dest, size_t MaxSize) { … }
std::unique_ptr<Module> llvm::parseAndVerify(const uint8_t *Data, size_t Size,
LLVMContext &Context) { … }