15#include "llvm/ADT/Triple.h"
16#include "llvm/CodeGen/IntrinsicLowering.h"
17#include "llvm/IR/Constants.h"
18#include "llvm/IR/Instructions.h"
19#include "llvm/IR/Module.h"
38 const llvm::TargetLowering *
TLI;
42 llvm::Function *
getIntrinsic(llvm::Module &M,
unsigned IID, llvm::Type **Tys,
44 llvm::Function *
getIntrinsic(llvm::Module &M,
unsigned IID, llvm::Type *Ty0) {
61 llvm::IntrinsicLowering *
IL;
68 IL(new
llvm::IntrinsicLowering(TD)) {}
144 typedef std::vector<SwitchCase>::iterator
CaseItr;
149 llvm::BasicBlock *origBlock,
150 llvm::BasicBlock *defaultBlock);
181 static const llvm::FunctionType *
getFunctionType(
const llvm::GlobalValue *gv);
182 static bool checkType(
const llvm::GlobalValue *match,
const llvm::GlobalValue *replacement);
183 static bool tryToReplace(llvm::GlobalValue *match, llvm::GlobalValue *replacement);
188#ifdef USE_WORKAROUND_LLVM_PR39177
192class WorkaroundLLVMPR39177Pass :
public llvm::ModulePass {
195 WorkaroundLLVMPR39177Pass() :
llvm::ModulePass(ID) {}
196 bool runOnModule(llvm::Module &M)
override;
bool runOnModule(llvm::Module &M) override
static const llvm::FunctionType * getFunctionType(const llvm::GlobalValue *gv)
static bool checkType(const llvm::GlobalValue *match, const llvm::GlobalValue *replacement)
bool runOnModule(llvm::Module &M) override
static bool isFunctionOrGlobalFunctionAlias(const llvm::GlobalValue *gv)
static bool tryToReplace(llvm::GlobalValue *match, llvm::GlobalValue *replacement)
InstructionOperandTypeCheckPass()
bool runOnModule(llvm::Module &M) override
bool instructionOperandsConform
bool runOnModule(llvm::Module &M) override
const llvm::DataLayout & DataLayout
bool runOnBasicBlock(llvm::BasicBlock &b, llvm::Module &M)
IntrinsicCleanerPass(const llvm::DataLayout &TD)
llvm::IntrinsicLowering * IL
void processSwitchInst(llvm::SwitchInst *SI)
std::vector< SwitchCase > CaseVector
bool runOnFunction(llvm::Function &F) override
void switchConvert(CaseItr begin, CaseItr end, llvm::Value *value, llvm::BasicBlock *origBlock, llvm::BasicBlock *defaultBlock)
std::vector< SwitchCase >::iterator CaseItr
Instruments every function that contains a KLEE function call as nonopt.
bool runOnModule(llvm::Module &M) override
bool runOnModule(llvm::Module &M) override
bool runOnFunction(llvm::Function &f) override
bool runOnModule(llvm::Module &M) override
bool runOnInstruction(llvm::Module &M, llvm::Instruction *I)
const llvm::TargetLowering * TLI
llvm::Function * getIntrinsic(llvm::Module &M, unsigned IID, llvm::Type *Ty0)
llvm::Function * getIntrinsic(llvm::Module &M, unsigned IID, llvm::Type **Tys, unsigned NumTys)
SwitchCase(llvm::Constant *v, llvm::BasicBlock *b)