Skip to content

Commit 16baad8

Browse files
[llvm] Use pop_back_val (NFC)
1 parent 0544441 commit 16baad8

File tree

16 files changed

+18
-36
lines changed

16 files changed

+18
-36
lines changed

llvm/include/llvm/Analysis/RegionInfoImpl.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -886,8 +886,7 @@ typename Tr::RegionT *RegionInfoBase<Tr>::getCommonRegion(RegionT *A,
886886
template <class Tr>
887887
typename Tr::RegionT *
888888
RegionInfoBase<Tr>::getCommonRegion(SmallVectorImpl<RegionT *> &Regions) const {
889-
RegionT *ret = Regions.back();
890-
Regions.pop_back();
889+
RegionT *ret = Regions.pop_back_val();
891890

892891
for (RegionT *R : Regions)
893892
ret = getCommonRegion(ret, R);

llvm/include/llvm/Analysis/SparsePropagation.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -485,8 +485,7 @@ void SparseSolver<LatticeKey, LatticeVal, KeyInfo>::Solve() {
485485

486486
// Process the basic block work list.
487487
while (!BBWorkList.empty()) {
488-
BasicBlock *BB = BBWorkList.back();
489-
BBWorkList.pop_back();
488+
BasicBlock *BB = BBWorkList.pop_back_val();
490489

491490
LLVM_DEBUG(dbgs() << "\nPopped off BBWL: " << *BB);
492491

llvm/lib/Analysis/DivergenceAnalysis.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -209,8 +209,7 @@ void DivergenceAnalysis::analyzeLoopExitDivergence(const BasicBlock &DivExit,
209209
Visited.insert(&DivExit);
210210

211211
do {
212-
auto *UserBlock = TaintStack.back();
213-
TaintStack.pop_back();
212+
auto *UserBlock = TaintStack.pop_back_val();
214213

215214
// don't spread divergence beyond the region
216215
if (!inRegion(*UserBlock))

llvm/lib/Analysis/IVDescriptors.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -273,8 +273,7 @@ bool RecurrenceDescriptor::AddReductionVar(PHINode *Phi, RecurKind Kind,
273273
// * An instruction type other than PHI or the reduction operation.
274274
// * A PHI in the header other than the initial PHI.
275275
while (!Worklist.empty()) {
276-
Instruction *Cur = Worklist.back();
277-
Worklist.pop_back();
276+
Instruction *Cur = Worklist.pop_back_val();
278277

279278
// No Users.
280279
// If the instruction has no users then this is a broken chain and can't be

llvm/lib/Analysis/MemoryDependenceAnalysis.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -766,8 +766,7 @@ MemoryDependenceResults::getNonLocalCallDependency(CallBase *QueryCall) {
766766

767767
// Iterate while we still have blocks to update.
768768
while (!DirtyBlocks.empty()) {
769-
BasicBlock *DirtyBB = DirtyBlocks.back();
770-
DirtyBlocks.pop_back();
769+
BasicBlock *DirtyBB = DirtyBlocks.pop_back_val();
771770

772771
// Already processed this block?
773772
if (!Visited.insert(DirtyBB).second)

llvm/lib/Bitcode/Reader/BitcodeReader.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2933,8 +2933,7 @@ Error BitcodeReader::parseUseLists() {
29332933
if (RecordLength < 3)
29342934
// Records should have at least an ID and two indexes.
29352935
return error("Invalid record");
2936-
unsigned ID = Record.back();
2937-
Record.pop_back();
2936+
unsigned ID = Record.pop_back_val();
29382937

29392938
Value *V;
29402939
if (IsBB) {

llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17681,8 +17681,7 @@ SDValue DAGCombiner::visitLIFETIME_END(SDNode *N) {
1768117681
// We walk up the chains to find stores.
1768217682
SmallVector<SDValue, 8> Chains = {N->getOperand(0)};
1768317683
while (!Chains.empty()) {
17684-
SDValue Chain = Chains.back();
17685-
Chains.pop_back();
17684+
SDValue Chain = Chains.pop_back_val();
1768617685
if (!Chain.hasOneUse())
1768717686
continue;
1768817687
switch (Chain.getOpcode()) {

llvm/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -663,8 +663,7 @@ void DAGTypeLegalizer::ReplaceValueWith(SDValue From, SDValue To) {
663663

664664
// Process the list of nodes that need to be reanalyzed.
665665
while (!NodesToAnalyze.empty()) {
666-
SDNode *N = NodesToAnalyze.back();
667-
NodesToAnalyze.pop_back();
666+
SDNode *N = NodesToAnalyze.pop_back_val();
668667
if (N->getNodeId() != DAGTypeLegalizer::NewNode)
669668
// The node was analyzed while reanalyzing an earlier node - it is safe
670669
// to skip. Note that this is not a morphing node - otherwise it would

llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10793,8 +10793,7 @@ void SelectionDAGBuilder::visitSwitch(const SwitchInst &SI) {
1079310793
{PeeledSwitchMBB, First, Last, nullptr, nullptr, DefaultProb});
1079410794

1079510795
while (!WorkList.empty()) {
10796-
SwitchWorkListItem W = WorkList.back();
10797-
WorkList.pop_back();
10796+
SwitchWorkListItem W = WorkList.pop_back_val();
1079810797
unsigned NumClusters = W.LastCluster - W.FirstCluster + 1;
1079910798

1080010799
if (NumClusters > 3 && TM.getOptLevel() != CodeGenOpt::None &&

llvm/lib/DWARFLinker/DWARFLinker.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -732,8 +732,7 @@ void DWARFLinker::lookForDIEsToKeep(AddressesMap &AddressesMap,
732732
Worklist.emplace_back(Die, Cu, Flags);
733733

734734
while (!Worklist.empty()) {
735-
WorklistItem Current = Worklist.back();
736-
Worklist.pop_back();
735+
WorklistItem Current = Worklist.pop_back_val();
737736

738737
// Look at the worklist type to decide what kind of work to perform.
739738
switch (Current.Type) {

0 commit comments

Comments
 (0)