#include "BugDriver.h"
#include "llvm/IR/Constants.h"
#include "llvm/IR/DataLayout.h"
#include "llvm/IR/DerivedTypes.h"
#include "llvm/IR/LLVMContext.h"
#include "llvm/IR/LegacyPassManager.h"
#include "llvm/IR/Module.h"
#include "llvm/IR/Verifier.h"
#include "llvm/Pass.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/FileUtilities.h"
#include "llvm/Support/Path.h"
#include "llvm/Support/Signals.h"
#include "llvm/Support/ToolOutputFile.h"
#include "llvm/Transforms/IPO.h"
#include "llvm/Transforms/Scalar.h"
#include "llvm/Transforms/Utils/Cloning.h"
#include "llvm/Transforms/Utils/CodeExtractor.h"
#include <set>
usingnamespacellvm;
#define DEBUG_TYPE …
namespace llvm {
bool DisableSimplifyCFG = …;
extern cl::opt<std::string> OutputPrefix;
}
namespace {
cl::opt<bool> NoDCE("disable-dce",
cl::desc("Do not use the -dce pass to reduce testcases"));
cl::opt<bool, true>
NoSCFG("disable-simplifycfg", cl::location(DisableSimplifyCFG),
cl::desc("Do not use the -simplifycfg pass to reduce testcases"));
Function *globalInitUsesExternalBA(GlobalVariable *GV) { … }
}
std::unique_ptr<Module>
BugDriver::deleteInstructionFromProgram(const Instruction *I,
unsigned Simplification) { … }
std::unique_ptr<Module>
BugDriver::performFinalCleanups(std::unique_ptr<Module> M,
bool MayModifySemantics) { … }
std::unique_ptr<Module> BugDriver::extractLoop(Module *M) { … }
static void eliminateAliases(GlobalValue *GV) { … }
void llvm::DeleteGlobalInitializer(GlobalVariable *GV) { … }
void llvm::DeleteFunctionBody(Function *F) { … }
static Constant *GetTorInit(std::vector<std::pair<Function *, int>> &TorList) { … }
static void SplitStaticCtorDtor(const char *GlobalName, Module *M1, Module *M2,
ValueToValueMapTy &VMap) { … }
std::unique_ptr<Module>
llvm::SplitFunctionsOutOfModule(Module *M, const std::vector<Function *> &F,
ValueToValueMapTy &VMap) { … }
std::unique_ptr<Module>
BugDriver::extractMappedBlocksFromModule(const std::vector<BasicBlock *> &BBs,
Module *M) { … }