Lines Matching refs:llvm

20 #include "llvm/Support/raw_ostream.h"
21 #include "llvm/IR/Constants.h"
22 #include "llvm/IR/Function.h"
23 #include "llvm/IR/Instructions.h"
24 #include "llvm/IR/Module.h"
25 #include "llvm/IR/Value.h"
27 using namespace llvm;
97 PrintValue(llvm::Value *V, bool truncate = false)
144 Instrumenter (llvm::Module &module,
165 bool Inspect (llvm::Function &function)
198 virtual bool InstrumentInstruction(llvm::Instruction *inst) = 0;
206 void RegisterInstruction(llvm::Instruction &i)
221 virtual bool InspectInstruction(llvm::Instruction &i)
235 virtual bool InspectBasicBlock(llvm::BasicBlock &bb)
237 for (llvm::BasicBlock::iterator ii = bb.begin(), last_ii = bb.end();
257 virtual bool InspectFunction(llvm::Function &f)
259 for (llvm::Function::iterator bbi = f.begin(), last_bbi = f.end();
280 llvm::Value *BuildPointerValidatorFunc(lldb::addr_t start_address)
282 IntegerType *intptr_ty = llvm::Type::getIntNTy(m_module.getContext(),
283 (m_module.getPointerSize() == llvm::Module::Pointer64) ? 64 : 32);
285 llvm::Type *param_array[1];
287 param_array[0] = const_cast<llvm::PointerType*>(GetI8PtrTy());
289 ArrayRef<llvm::Type*> params(param_array, 1);
291 FunctionType *fun_ty = FunctionType::get(llvm::Type::getVoidTy(m_module.getContext()), params, true);
307 llvm::Value *BuildObjectCheckerFunc(lldb::addr_t start_address)
309 IntegerType *intptr_ty = llvm::Type::getIntNTy(m_module.getContext(),
310 (m_module.getPointerSize() == llvm::Module::Pointer64) ? 64 : 32);
312 llvm::Type *param_array[2];
314 param_array[0] = const_cast<llvm::PointerType*>(GetI8PtrTy());
315 param_array[1] = const_cast<llvm::PointerType*>(GetI8PtrTy());
317 ArrayRef<llvm::Type*> params(param_array, 2);
319 FunctionType *fun_ty = FunctionType::get(llvm::Type::getVoidTy(m_module.getContext()), params, true);
328 m_i8ptr_ty = llvm::Type::getInt8PtrTy(m_module.getContext());
333 typedef std::vector <llvm::Instruction *> InstVector;
337 llvm::Module &m_module; ///< The module which is being instrumented
346 ValidPointerChecker (llvm::Module &module,
357 bool InstrumentInstruction(llvm::Instruction *inst)
368 llvm::Value *dereferenced_ptr = NULL;
370 if (llvm::LoadInst *li = dyn_cast<llvm::LoadInst> (inst))
372 else if (llvm::StoreInst *si = dyn_cast<llvm::StoreInst> (inst))
386 llvm::Value *arg_array[1];
390 llvm::ArrayRef<llvm::Value *> args(arg_array, 1);
400 bool InspectInstruction(llvm::Instruction &i)
402 if (dyn_cast<llvm::LoadInst> (&i) ||
403 dyn_cast<llvm::StoreInst> (&i))
409 llvm::Value *m_valid_pointer_check_func;
415 ObjcObjectChecker(llvm::Module &module,
436 std::map <llvm::Instruction *, msgSend_type> msgSend_types;
439 bool InstrumentInstruction(llvm::Instruction *inst)
451 llvm::Value *target_object;
452 llvm::Value *selector;
483 llvm::Value *arg_array[2];
488 ArrayRef<llvm::Value*> args(arg_array, 2);
498 bool InspectInstruction(llvm::Instruction &i)
582 llvm::Value *m_objc_object_check_func;
598 IRDynamicChecks::runOnModule(llvm::Module &M)
602 llvm::Function* function = M.getFunction(StringRef(m_func_name.c_str()));