r316015 - Replace use of SmallVector::back + pop_back with pop_back_val
Erich Keane via cfe-commits
cfe-commits at lists.llvm.org
Tue Oct 17 10:45:21 PDT 2017
Author: erichkeane
Date: Tue Oct 17 10:45:21 2017
New Revision: 316015
URL: http://llvm.org/viewvc/llvm-project?rev=316015&view=rev
Log:
Replace use of SmallVector::back + pop_back with pop_back_val
I ran across an instance where the value was being loaded
out via back, then immediately popped. Since pop_back_val
is more efficient at this (it moves out), replace this
instance.
Modified:
cfe/trunk/lib/Sema/AnalysisBasedWarnings.cpp
Modified: cfe/trunk/lib/Sema/AnalysisBasedWarnings.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/AnalysisBasedWarnings.cpp?rev=316015&r1=316014&r2=316015&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/AnalysisBasedWarnings.cpp (original)
+++ cfe/trunk/lib/Sema/AnalysisBasedWarnings.cpp Tue Oct 17 10:45:21 2017
@@ -361,8 +361,7 @@ static bool hasThrowOutNonThrowingFunc(S
SmallVector<CFGBlock *, 16> Stack;
Stack.push_back(&BodyCFG->getEntry());
while (!Stack.empty()) {
- CFGBlock *CurBlock = Stack.back();
- Stack.pop_back();
+ CFGBlock *CurBlock = Stack.pop_back_val();
unsigned ID = CurBlock->getBlockID();
ThrowState CurState = States[ID];
More information about the cfe-commits
mailing list