llvm/llvm/lib/FuzzMutate/IRMutator.cpp

//===-- IRMutator.cpp -----------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//

#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) {}

/// Return a case value that is not already taken to make sure we don't have two
/// cases with same value.
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) {}

/// The caller has to guarantee that these blocks are "empty", i.e. it doesn't
/// even have terminator.
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) {}