mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-09-27 00:21:03 +00:00
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:
@@ -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;
|
||||
|
Reference in New Issue
Block a user