mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-25 13:24:46 +00:00
Simplify creation of a bunch of ArrayRefs by using None, makeArrayRef or just letting them be implicitly created.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216525 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -435,7 +435,7 @@ bool DataFlowSanitizer::doInitialization(Module &M) {
|
||||
DFSanSetLabelFnTy = FunctionType::get(Type::getVoidTy(*Ctx),
|
||||
DFSanSetLabelArgs, /*isVarArg=*/false);
|
||||
DFSanNonzeroLabelFnTy = FunctionType::get(
|
||||
Type::getVoidTy(*Ctx), ArrayRef<Type *>(), /*isVarArg=*/false);
|
||||
Type::getVoidTy(*Ctx), None, /*isVarArg=*/false);
|
||||
|
||||
if (GetArgTLSPtr) {
|
||||
Type *ArgTLSTy = ArrayType::get(ShadowTy, 64);
|
||||
|
@@ -737,11 +737,11 @@ GlobalVariable *GCOVProfiler::buildEdgeLookupTable(
|
||||
Edge += Successors;
|
||||
}
|
||||
|
||||
ArrayRef<Constant*> V(&EdgeTable[0], TableSize);
|
||||
GlobalVariable *EdgeTableGV =
|
||||
new GlobalVariable(
|
||||
*M, EdgeTableTy, true, GlobalValue::InternalLinkage,
|
||||
ConstantArray::get(EdgeTableTy, V),
|
||||
ConstantArray::get(EdgeTableTy,
|
||||
makeArrayRef(&EdgeTable[0],TableSize)),
|
||||
"__llvm_gcda_edge_table");
|
||||
EdgeTableGV->setUnnamedAddr(true);
|
||||
return EdgeTableGV;
|
||||
|
@@ -1870,7 +1870,7 @@ struct MemorySanitizerVisitor : public InstVisitor<MemorySanitizerVisitor> {
|
||||
Value *Op = I.getArgOperand(0);
|
||||
Type *OpType = Op->getType();
|
||||
Function *BswapFunc = Intrinsic::getDeclaration(
|
||||
F.getParent(), Intrinsic::bswap, ArrayRef<Type*>(&OpType, 1));
|
||||
F.getParent(), Intrinsic::bswap, makeArrayRef(&OpType, 1));
|
||||
setShadow(&I, IRB.CreateCall(BswapFunc, getShadow(Op)));
|
||||
setOrigin(&I, getOrigin(Op));
|
||||
}
|
||||
|
@@ -481,8 +481,7 @@ bool ThreadSanitizer::instrumentAtomic(Instruction *I) {
|
||||
Type *PtrTy = Ty->getPointerTo();
|
||||
Value *Args[] = {IRB.CreatePointerCast(Addr, PtrTy),
|
||||
createOrdering(&IRB, LI->getOrdering())};
|
||||
CallInst *C = CallInst::Create(TsanAtomicLoad[Idx],
|
||||
ArrayRef<Value*>(Args));
|
||||
CallInst *C = CallInst::Create(TsanAtomicLoad[Idx], Args);
|
||||
ReplaceInstWithInst(I, C);
|
||||
|
||||
} else if (StoreInst *SI = dyn_cast<StoreInst>(I)) {
|
||||
@@ -497,8 +496,7 @@ bool ThreadSanitizer::instrumentAtomic(Instruction *I) {
|
||||
Value *Args[] = {IRB.CreatePointerCast(Addr, PtrTy),
|
||||
IRB.CreateIntCast(SI->getValueOperand(), Ty, false),
|
||||
createOrdering(&IRB, SI->getOrdering())};
|
||||
CallInst *C = CallInst::Create(TsanAtomicStore[Idx],
|
||||
ArrayRef<Value*>(Args));
|
||||
CallInst *C = CallInst::Create(TsanAtomicStore[Idx], Args);
|
||||
ReplaceInstWithInst(I, C);
|
||||
} else if (AtomicRMWInst *RMWI = dyn_cast<AtomicRMWInst>(I)) {
|
||||
Value *Addr = RMWI->getPointerOperand();
|
||||
@@ -515,7 +513,7 @@ bool ThreadSanitizer::instrumentAtomic(Instruction *I) {
|
||||
Value *Args[] = {IRB.CreatePointerCast(Addr, PtrTy),
|
||||
IRB.CreateIntCast(RMWI->getValOperand(), Ty, false),
|
||||
createOrdering(&IRB, RMWI->getOrdering())};
|
||||
CallInst *C = CallInst::Create(F, ArrayRef<Value*>(Args));
|
||||
CallInst *C = CallInst::Create(F, Args);
|
||||
ReplaceInstWithInst(I, C);
|
||||
} else if (AtomicCmpXchgInst *CASI = dyn_cast<AtomicCmpXchgInst>(I)) {
|
||||
Value *Addr = CASI->getPointerOperand();
|
||||
@@ -543,7 +541,7 @@ bool ThreadSanitizer::instrumentAtomic(Instruction *I) {
|
||||
Value *Args[] = {createOrdering(&IRB, FI->getOrdering())};
|
||||
Function *F = FI->getSynchScope() == SingleThread ?
|
||||
TsanAtomicSignalFence : TsanAtomicThreadFence;
|
||||
CallInst *C = CallInst::Create(F, ArrayRef<Value*>(Args));
|
||||
CallInst *C = CallInst::Create(F, Args);
|
||||
ReplaceInstWithInst(I, C);
|
||||
}
|
||||
return true;
|
||||
|
Reference in New Issue
Block a user