mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-11-23 00:20:25 +00:00
Use v.data() instead of &v[0] when SmallVector v might be empty.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72210 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -260,7 +260,7 @@ static Constant *FoldBitCast(Constant *C, const Type *DestTy,
|
||||
}
|
||||
}
|
||||
|
||||
return ConstantVector::get(&Result[0], Result.size());
|
||||
return ConstantVector::get(Result.data(), Result.size());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -306,10 +306,10 @@ Constant *llvm::ConstantFoldInstruction(Instruction *I, const TargetData *TD) {
|
||||
|
||||
if (const CmpInst *CI = dyn_cast<CmpInst>(I))
|
||||
return ConstantFoldCompareInstOperands(CI->getPredicate(),
|
||||
&Ops[0], Ops.size(), TD);
|
||||
Ops.data(), Ops.size(), TD);
|
||||
else
|
||||
return ConstantFoldInstOperands(I->getOpcode(), I->getType(),
|
||||
&Ops[0], Ops.size(), TD);
|
||||
Ops.data(), Ops.size(), TD);
|
||||
}
|
||||
|
||||
/// ConstantFoldConstantExpression - Attempt to fold the constant expression
|
||||
@@ -325,10 +325,10 @@ Constant *llvm::ConstantFoldConstantExpression(ConstantExpr *CE,
|
||||
|
||||
if (CE->isCompare())
|
||||
return ConstantFoldCompareInstOperands(CE->getPredicate(),
|
||||
&Ops[0], Ops.size(), TD);
|
||||
Ops.data(), Ops.size(), TD);
|
||||
else
|
||||
return ConstantFoldInstOperands(CE->getOpcode(), CE->getType(),
|
||||
&Ops[0], Ops.size(), TD);
|
||||
Ops.data(), Ops.size(), TD);
|
||||
}
|
||||
|
||||
/// ConstantFoldInstOperands - Attempt to constant fold an instruction with the
|
||||
|
||||
Reference in New Issue
Block a user