Skip to content

Commit 280c4bd

Browse files
[llvm] Construct SmallVector with ArrayRef (NFC)
1 parent 2185318 commit 280c4bd

File tree

3 files changed

+6
-13
lines changed

3 files changed

+6
-13
lines changed

llvm/lib/IR/IRBuilder.cpp

+4-9
Original file line numberDiff line numberDiff line change
@@ -748,18 +748,15 @@ getStatepointBundles(std::optional<ArrayRef<T1>> TransitionArgs,
748748
ArrayRef<T3> GCArgs) {
749749
std::vector<OperandBundleDef> Rval;
750750
if (DeoptArgs) {
751-
SmallVector<Value*, 16> DeoptValues;
752-
llvm::append_range(DeoptValues, *DeoptArgs);
751+
SmallVector<Value *, 16> DeoptValues(*DeoptArgs);
753752
Rval.emplace_back("deopt", DeoptValues);
754753
}
755754
if (TransitionArgs) {
756-
SmallVector<Value*, 16> TransitionValues;
757-
llvm::append_range(TransitionValues, *TransitionArgs);
755+
SmallVector<Value *, 16> TransitionValues(*TransitionArgs);
758756
Rval.emplace_back("gc-transition", TransitionValues);
759757
}
760758
if (GCArgs.size()) {
761-
SmallVector<Value*, 16> LiveValues;
762-
llvm::append_range(LiveValues, GCArgs);
759+
SmallVector<Value *, 16> LiveValues(GCArgs);
763760
Rval.emplace_back("gc-live", LiveValues);
764761
}
765762
return Rval;
@@ -1091,9 +1088,7 @@ CallInst *IRBuilderBase::CreateConstrainedFPCall(
10911088
Function *Callee, ArrayRef<Value *> Args, const Twine &Name,
10921089
std::optional<RoundingMode> Rounding,
10931090
std::optional<fp::ExceptionBehavior> Except) {
1094-
llvm::SmallVector<Value *, 6> UseArgs;
1095-
1096-
append_range(UseArgs, Args);
1091+
llvm::SmallVector<Value *, 6> UseArgs(Args);
10971092

10981093
if (Intrinsic::hasConstrainedFPRoundingModeOperand(Callee->getIntrinsicID()))
10991094
UseArgs.push_back(getConstrainedFPRounding(Rounding));

llvm/tools/llvm-reduce/deltas/ReduceOperandsToArgs.cpp

+1-2
Original file line numberDiff line numberDiff line change
@@ -129,8 +129,7 @@ static void substituteOperandWithArgument(Function *OldF,
129129
UniqueValues.insert(Op->get());
130130

131131
// Determine the new function's signature.
132-
SmallVector<Type *> NewArgTypes;
133-
llvm::append_range(NewArgTypes, OldF->getFunctionType()->params());
132+
SmallVector<Type *> NewArgTypes(OldF->getFunctionType()->params());
134133
size_t ArgOffset = NewArgTypes.size();
135134
for (Value *V : UniqueValues)
136135
NewArgTypes.push_back(V->getType());

llvm/tools/lto/lto.cpp

+1-2
Original file line numberDiff line numberDiff line change
@@ -496,8 +496,7 @@ void lto_codegen_debug_options_array(lto_code_gen_t cg,
496496
const char *const *options, int number) {
497497
assert(optionParsingState != OptParsingState::Early &&
498498
"early option processing already happened");
499-
SmallVector<StringRef, 4> Options;
500-
llvm::append_range(Options, ArrayRef(options, number));
499+
SmallVector<StringRef, 4> Options(ArrayRef(options, number));
501500
unwrap(cg)->setCodeGenDebugOptions(ArrayRef(Options));
502501
}
503502

0 commit comments

Comments
 (0)