aboutsummaryrefslogtreecommitdiffstats
path: root/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
diff options
context:
space:
mode:
authorBenjamin Kramer <benny.kra@googlemail.com>2010-01-07 17:27:56 +0000
committerBenjamin Kramer <benny.kra@googlemail.com>2010-01-07 17:27:56 +0000
commit947f3a6e79834ed0e7a5310c43eb0ca64fd24b8c (patch)
tree79a52d71556f2debac2334a96677ad21c5ec6964 /lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
parent2e64059cb3f404df32fffcfe0f30c937e372c3bb (diff)
downloadexternal_llvm-947f3a6e79834ed0e7a5310c43eb0ca64fd24b8c.tar.gz
external_llvm-947f3a6e79834ed0e7a5310c43eb0ca64fd24b8c.tar.bz2
external_llvm-947f3a6e79834ed0e7a5310c43eb0ca64fd24b8c.zip
Use pop_back_val instead of back()+pop_back.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92918 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp')
-rw-r--r--lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp11
1 files changed, 4 insertions, 7 deletions
diff --git a/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp b/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
index 352b0efe06..10dcc09c8e 100644
--- a/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
+++ b/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
@@ -456,8 +456,7 @@ void SelectionDAGISel::ShrinkDemandedOps() {
TargetLowering::TargetLoweringOpt TLO(*CurDAG, true);
while (!Worklist.empty()) {
- SDNode *N = Worklist.back();
- Worklist.pop_back();
+ SDNode *N = Worklist.pop_back_val();
if (N->use_empty() && N != CurDAG->getRoot().getNode()) {
CurDAG->DeleteNode(N);
@@ -467,7 +466,6 @@ void SelectionDAGISel::ShrinkDemandedOps() {
// Run ShrinkDemandedOp on scalar binary operations.
if (N->getNumValues() == 1 &&
N->getValueType(0).isSimple() && N->getValueType(0).isInteger()) {
- DebugLoc dl = N->getDebugLoc();
unsigned BitWidth = N->getValueType(0).getScalarType().getSizeInBits();
APInt Demanded = APInt::getAllOnesValue(BitWidth);
APInt KnownZero, KnownOne;
@@ -520,9 +518,8 @@ void SelectionDAGISel::ComputeLiveOutVRegInfo() {
APInt KnownZero;
APInt KnownOne;
- while (!Worklist.empty()) {
- SDNode *N = Worklist.back();
- Worklist.pop_back();
+ do {
+ SDNode *N = Worklist.pop_back_val();
// If we've already seen this node, ignore it.
if (!VisitedNodes.insert(N))
@@ -562,7 +559,7 @@ void SelectionDAGISel::ComputeLiveOutVRegInfo() {
LOI.KnownOne = KnownOne;
LOI.KnownZero = KnownZero;
}
- }
+ } while (!Worklist.empty());
}
void SelectionDAGISel::CodeGenAndEmitDAG() {