Skip to content

Commit 0da15ea

Browse files
[llvm] Use append_range (NFC)
1 parent f890fd5 commit 0da15ea

File tree

9 files changed

+9
-19
lines changed

9 files changed

+9
-19
lines changed

llvm/lib/CodeGen/InterleavedAccessPass.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -385,8 +385,7 @@ bool InterleavedAccess::lowerInterleavedLoad(
385385
return !Extracts.empty() || BinOpShuffleChanged;
386386
}
387387

388-
for (auto SVI : Shuffles)
389-
DeadInsts.push_back(SVI);
388+
append_range(DeadInsts, Shuffles);
390389

391390
DeadInsts.push_back(LI);
392391
return true;

llvm/lib/CodeGen/LiveDebugValues/VarLocBasedImpl.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -932,8 +932,7 @@ void VarLocBasedLDV::collectIDsForRegs(VarLocSet &Collected,
932932
const VarLocSet &CollectFrom) const {
933933
assert(!Regs.empty() && "Nothing to collect");
934934
SmallVector<uint32_t, 32> SortedRegs;
935-
for (Register Reg : Regs)
936-
SortedRegs.push_back(Reg);
935+
append_range(SortedRegs, Regs);
937936
array_pod_sort(SortedRegs.begin(), SortedRegs.end());
938937
auto It = CollectFrom.find(LocIndex::rawIndexForReg(SortedRegs.front()));
939938
auto End = CollectFrom.end();

llvm/lib/CodeGen/MachineSSAUpdater.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -284,9 +284,7 @@ class SSAUpdaterTraits<MachineSSAUpdater> {
284284
/// vector.
285285
static void FindPredecessorBlocks(MachineBasicBlock *BB,
286286
SmallVectorImpl<MachineBasicBlock*> *Preds){
287-
for (MachineBasicBlock::pred_iterator PI = BB->pred_begin(),
288-
E = BB->pred_end(); PI != E; ++PI)
289-
Preds->push_back(*PI);
287+
append_range(*Preds, BB->predecessors());
290288
}
291289

292290
/// GetUndefVal - Create an IMPLICIT_DEF instruction with a new register.

llvm/lib/DebugInfo/DWARF/DWARFContext.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1022,8 +1022,7 @@ DWARFContext::DIEsForAddress DWARFContext::getDIEsForAddress(uint64_t Address) {
10221022
break;
10231023
}
10241024

1025-
for (auto Child : DIE)
1026-
Worklist.push_back(Child);
1025+
append_range(Worklist, DIE);
10271026
}
10281027

10291028
return Result;

llvm/lib/IR/IRBuilder.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -892,8 +892,7 @@ CallInst *IRBuilderBase::CreateConstrainedFPCall(
892892
Optional<fp::ExceptionBehavior> Except) {
893893
llvm::SmallVector<Value *, 6> UseArgs;
894894

895-
for (auto *OneArg : Args)
896-
UseArgs.push_back(OneArg);
895+
append_range(UseArgs, Args);
897896
bool HasRoundingMD = false;
898897
switch (Callee->getIntrinsicID()) {
899898
default:

llvm/lib/IR/SafepointIRVerifier.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -350,8 +350,7 @@ static enum BaseType getBaseType(const Value *Val) {
350350
// Push all the incoming values of phi node into the worklist for
351351
// processing.
352352
if (const auto *PN = dyn_cast<PHINode>(V)) {
353-
for (Value *InV: PN->incoming_values())
354-
Worklist.push_back(InV);
353+
append_range(Worklist, PN->incoming_values());
355354
continue;
356355
}
357356
if (const auto *SI = dyn_cast<SelectInst>(V)) {

llvm/lib/Remarks/BitstreamRemarkSerializer.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,7 @@ BitstreamRemarkSerializerHelper::BitstreamRemarkSerializerHelper(
2121
: Encoded(), R(), Bitstream(Encoded), ContainerType(ContainerType) {}
2222

2323
static void push(SmallVectorImpl<uint64_t> &R, StringRef Str) {
24-
for (const char C : Str)
25-
R.push_back(C);
24+
append_range(R, Str);
2625
}
2726

2827
static void setRecordName(unsigned RecordID, BitstreamWriter &Bitstream,

llvm/lib/Target/Hexagon/HexagonSplitDouble.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -296,8 +296,7 @@ void HexagonSplitDoubleRegs::partitionRegisters(UUSetMap &P2Rs) {
296296
Visited.insert(T);
297297
// Add all registers associated with T.
298298
USet &Asc = AssocMap[T];
299-
for (USet::iterator J = Asc.begin(), F = Asc.end(); J != F; ++J)
300-
WorkQ.push_back(*J);
299+
append_range(WorkQ, Asc);
301300
}
302301
}
303302

llvm/lib/Transforms/Instrumentation/DataFlowSanitizer.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2051,8 +2051,7 @@ void DFSanVisitor::visitCallBase(CallBase &CB) {
20512051
Args.push_back(DFSF.LabelReturnAlloca);
20522052
}
20532053

2054-
for (i = CB.arg_begin() + FT->getNumParams(); i != CB.arg_end(); ++i)
2055-
Args.push_back(*i);
2054+
append_range(Args, drop_begin(CB.args(), FT->getNumParams()));
20562055

20572056
CallInst *CustomCI = IRB.CreateCall(CustomF, Args);
20582057
CustomCI->setCallingConv(CI->getCallingConv());

0 commit comments

Comments
 (0)