From a83691d6626a4a3b4881534d5680153a5df2e951 Mon Sep 17 00:00:00 2001 From: Andrea Fioraldi Date: Tue, 18 Feb 2020 15:27:35 +0100 Subject: fix insertion of __cmplog_rtn_hook --- llvm_mode/cmplog-routines-pass.cc | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'llvm_mode/cmplog-routines-pass.cc') diff --git a/llvm_mode/cmplog-routines-pass.cc b/llvm_mode/cmplog-routines-pass.cc index 309ea65e..7e3acae2 100644 --- a/llvm_mode/cmplog-routines-pass.cc +++ b/llvm_mode/cmplog-routines-pass.cc @@ -280,9 +280,8 @@ bool CmpLogRoutines::hookRtns(Module &M) { Value *v1P = callInst->getArgOperand(0), *v2P = callInst->getArgOperand(1); - BasicBlock *bb = callInst->getParent(); - BasicBlock::iterator IP = bb->getFirstInsertionPt(); - IRBuilder<> IRB(&*IP); + IRBuilder<> IRB(callInst->getParent()); + IRB.SetInsertPoint(callInst); std::vector args; args.push_back(v1P); @@ -290,7 +289,7 @@ bool CmpLogRoutines::hookRtns(Module &M) { IRB.CreateCall(cmplogHookFn, args, "tmp"); - errs() << callInst->getCalledFunction()->getName() << "\n"; + // errs() << callInst->getCalledFunction()->getName() << "\n"; } -- cgit 1.4.1