aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Target/WebAssembly/WebAssemblyRegStackify.cpp
diff options
context:
space:
mode:
authorKazu Hirata <kazu@google.com>2021-01-16 09:40:54 -0800
committerKazu Hirata <kazu@google.com>2021-01-16 09:40:55 -0800
commit2082b10d100e8dbaffc2ba8f497db5d2ab61beb2 (patch)
treebd4009ec1be75af68d9afb9fdcf525e0d56ca73e /llvm/lib/Target/WebAssembly/WebAssemblyRegStackify.cpp
parent19aacdb715aea1de56a47b807a555335610a11c2 (diff)
downloadllvm-2082b10d100e8dbaffc2ba8f497db5d2ab61beb2.zip
llvm-2082b10d100e8dbaffc2ba8f497db5d2ab61beb2.tar.gz
llvm-2082b10d100e8dbaffc2ba8f497db5d2ab61beb2.tar.bz2
[llvm] Use *::empty (NFC)
Diffstat (limited to 'llvm/lib/Target/WebAssembly/WebAssemblyRegStackify.cpp')
-rw-r--r--llvm/lib/Target/WebAssembly/WebAssemblyRegStackify.cpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/llvm/lib/Target/WebAssembly/WebAssemblyRegStackify.cpp b/llvm/lib/Target/WebAssembly/WebAssemblyRegStackify.cpp
index 13fcc19..b106b82 100644
--- a/llvm/lib/Target/WebAssembly/WebAssemblyRegStackify.cpp
+++ b/llvm/lib/Target/WebAssembly/WebAssemblyRegStackify.cpp
@@ -692,7 +692,7 @@ class TreeWalkerState {
public:
explicit TreeWalkerState(MachineInstr *Insert) {
const iterator_range<mop_iterator> &Range = Insert->explicit_uses();
- if (Range.begin() != Range.end())
+ if (!Range.empty())
Worklist.push_back(reverse(Range));
}
@@ -702,10 +702,9 @@ public:
RangeTy &Range = Worklist.back();
MachineOperand &Op = *Range.begin();
Range = drop_begin(Range, 1);
- if (Range.begin() == Range.end())
+ if (Range.empty())
Worklist.pop_back();
- assert((Worklist.empty() ||
- Worklist.back().begin() != Worklist.back().end()) &&
+ assert((Worklist.empty() || !Worklist.back().empty()) &&
"Empty ranges shouldn't remain in the worklist");
return Op;
}
@@ -713,7 +712,7 @@ public:
/// Push Instr's operands onto the stack to be visited.
void pushOperands(MachineInstr *Instr) {
const iterator_range<mop_iterator> &Range(Instr->explicit_uses());
- if (Range.begin() != Range.end())
+ if (!Range.empty())
Worklist.push_back(reverse(Range));
}
@@ -732,7 +731,7 @@ public:
if (Worklist.empty())
return false;
const RangeTy &Range = Worklist.back();
- return Range.begin() != Range.end() && Range.begin()->getParent() == Instr;
+ return !Range.empty() && Range.begin()->getParent() == Instr;
}
/// Test whether the given register is present on the stack, indicating an