summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/WebAssembly/WebAssemblyArgumentMove.cpp
diff options
context:
space:
mode:
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>2016-07-08 19:36:40 +0000
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>2016-07-08 19:36:40 +0000
commit500d0469895e5d7c03cab5a4f316c2b2764fc3fc (patch)
treec26a64697e830b5bba6a01e01f33756d1bbdeb84 /llvm/lib/Target/WebAssembly/WebAssemblyArgumentMove.cpp
parent5bff51138da9ffbbbdcfc950b6e4c242b4d9af0f (diff)
downloadbcm5719-llvm-500d0469895e5d7c03cab5a4f316c2b2764fc3fc.tar.gz
bcm5719-llvm-500d0469895e5d7c03cab5a4f316c2b2764fc3fc.zip
WebAssembly: Avoid implicit iterator conversions, NFC
Avoid implicit conversions from MachineInstrBundleIterator to MachineInstr* in the WebAssembly backend by preferring MachineInstr& over MachineInstr*. llvm-svn: 274912
Diffstat (limited to 'llvm/lib/Target/WebAssembly/WebAssemblyArgumentMove.cpp')
-rw-r--r--llvm/lib/Target/WebAssembly/WebAssemblyArgumentMove.cpp14
1 files changed, 6 insertions, 8 deletions
diff --git a/llvm/lib/Target/WebAssembly/WebAssemblyArgumentMove.cpp b/llvm/lib/Target/WebAssembly/WebAssemblyArgumentMove.cpp
index 3893c408cf6..5887f45371f 100644
--- a/llvm/lib/Target/WebAssembly/WebAssemblyArgumentMove.cpp
+++ b/llvm/lib/Target/WebAssembly/WebAssemblyArgumentMove.cpp
@@ -65,8 +65,8 @@ FunctionPass *llvm::createWebAssemblyArgumentMove() {
}
/// Test whether the given instruction is an ARGUMENT.
-static bool IsArgument(const MachineInstr *MI) {
- switch (MI->getOpcode()) {
+static bool IsArgument(const MachineInstr &MI) {
+ switch (MI.getOpcode()) {
case WebAssembly::ARGUMENT_I32:
case WebAssembly::ARGUMENT_I64:
case WebAssembly::ARGUMENT_F32:
@@ -88,20 +88,18 @@ bool WebAssemblyArgumentMove::runOnMachineFunction(MachineFunction &MF) {
MachineBasicBlock::iterator InsertPt = EntryMBB.end();
// Look for the first NonArg instruction.
- for (auto MII = EntryMBB.begin(), MIE = EntryMBB.end(); MII != MIE; ++MII) {
- MachineInstr *MI = MII;
+ for (MachineInstr &MI : EntryMBB) {
if (!IsArgument(MI)) {
- InsertPt = MII;
+ InsertPt = MI;
break;
}
}
// Now move any argument instructions later in the block
// to before our first NonArg instruction.
- for (auto I = InsertPt, E = EntryMBB.end(); I != E; ++I) {
- MachineInstr *MI = I;
+ for (MachineInstr &MI : llvm::make_range(InsertPt, EntryMBB.end())) {
if (IsArgument(MI)) {
- EntryMBB.insert(InsertPt, MI->removeFromParent());
+ EntryMBB.insert(InsertPt, MI.removeFromParent());
Changed = true;
}
}
OpenPOWER on IntegriCloud