Simplify IRBuilder::CreateCall* by using ArrayRef+initializer_list/braced init only

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237624 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
David Blaikie
2015-05-18 22:13:54 +00:00
parent 300c594636
commit 042dd34f9c
30 changed files with 213 additions and 245 deletions

View File

@@ -398,7 +398,7 @@ bool ThreadSanitizer::runOnFunction(Function &F) {
IRB.CreateCall(TsanFuncEntry, ReturnAddress);
for (auto RetInst : RetVec) {
IRBuilder<> IRBRet(RetInst);
IRBRet.CreateCall(TsanFuncExit);
IRBRet.CreateCall(TsanFuncExit, {});
}
Res = true;
}
@@ -427,9 +427,9 @@ bool ThreadSanitizer::instrumentLoadOrStore(Instruction *I,
if (StoredValue->getType()->isIntegerTy())
StoredValue = IRB.CreateIntToPtr(StoredValue, IRB.getInt8PtrTy());
// Call TsanVptrUpdate.
IRB.CreateCall2(TsanVptrUpdate,
IRB.CreatePointerCast(Addr, IRB.getInt8PtrTy()),
IRB.CreatePointerCast(StoredValue, IRB.getInt8PtrTy()));
IRB.CreateCall(TsanVptrUpdate,
{IRB.CreatePointerCast(Addr, IRB.getInt8PtrTy()),
IRB.CreatePointerCast(StoredValue, IRB.getInt8PtrTy())});
NumInstrumentedVtableWrites++;
return true;
}
@@ -481,16 +481,18 @@ static ConstantInt *createOrdering(IRBuilder<> *IRB, AtomicOrdering ord) {
bool ThreadSanitizer::instrumentMemIntrinsic(Instruction *I) {
IRBuilder<> IRB(I);
if (MemSetInst *M = dyn_cast<MemSetInst>(I)) {
IRB.CreateCall3(MemsetFn,
IRB.CreatePointerCast(M->getArgOperand(0), IRB.getInt8PtrTy()),
IRB.CreateIntCast(M->getArgOperand(1), IRB.getInt32Ty(), false),
IRB.CreateIntCast(M->getArgOperand(2), IntptrTy, false));
IRB.CreateCall(
MemsetFn,
{IRB.CreatePointerCast(M->getArgOperand(0), IRB.getInt8PtrTy()),
IRB.CreateIntCast(M->getArgOperand(1), IRB.getInt32Ty(), false),
IRB.CreateIntCast(M->getArgOperand(2), IntptrTy, false)});
I->eraseFromParent();
} else if (MemTransferInst *M = dyn_cast<MemTransferInst>(I)) {
IRB.CreateCall3(isa<MemCpyInst>(M) ? MemcpyFn : MemmoveFn,
IRB.CreatePointerCast(M->getArgOperand(0), IRB.getInt8PtrTy()),
IRB.CreatePointerCast(M->getArgOperand(1), IRB.getInt8PtrTy()),
IRB.CreateIntCast(M->getArgOperand(2), IntptrTy, false));
IRB.CreateCall(
isa<MemCpyInst>(M) ? MemcpyFn : MemmoveFn,
{IRB.CreatePointerCast(M->getArgOperand(0), IRB.getInt8PtrTy()),
IRB.CreatePointerCast(M->getArgOperand(1), IRB.getInt8PtrTy()),
IRB.CreateIntCast(M->getArgOperand(2), IntptrTy, false)});
I->eraseFromParent();
}
return false;