Skip to content
This repository was archived by the owner on Sep 2, 2018. It is now read-only.

Commit 7e3e982

Browse files
committed
[WebAssembly] Unbreak the build.
Not sure why ADL isn't working here. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@280656 91177308-0d34-0410-b5e6-96231b3b80d8
1 parent b01d8d2 commit 7e3e982

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

lib/Target/WebAssembly/WebAssemblyCFGStackify.cpp

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -332,15 +332,15 @@ static void PlaceBlockMarker(MachineBasicBlock &MBB, MachineFunction &MF,
332332
return;
333333

334334
assert(&MBB != &MF.front() && "Header blocks shouldn't have predecessors");
335-
MachineBasicBlock *LayoutPred = &*prev(MachineFunction::iterator(&MBB));
335+
MachineBasicBlock *LayoutPred = &*std::prev(MachineFunction::iterator(&MBB));
336336

337337
// If the nearest common dominator is inside a more deeply nested context,
338338
// walk out to the nearest scope which isn't more deeply nested.
339339
for (MachineFunction::iterator I(LayoutPred), E(Header); I != E; --I) {
340340
if (MachineBasicBlock *ScopeTop = ScopeTops[I->getNumber()]) {
341341
if (ScopeTop->getNumber() > Header->getNumber()) {
342342
// Skip over an intervening scope.
343-
I = next(MachineFunction::iterator(ScopeTop));
343+
I = std::next(MachineFunction::iterator(ScopeTop));
344344
} else {
345345
// We found a scope level at an appropriate depth.
346346
Header = ScopeTop;
@@ -369,10 +369,11 @@ static void PlaceBlockMarker(MachineBasicBlock &MBB, MachineFunction &MF,
369369
// Otherwise, insert the BLOCK as late in Header as we can, but before the
370370
// beginning of the local expression tree and any nested BLOCKs.
371371
InsertPos = Header->getFirstTerminator();
372-
while (InsertPos != Header->begin() && IsChild(*prev(InsertPos), MFI) &&
373-
prev(InsertPos)->getOpcode() != WebAssembly::LOOP &&
374-
prev(InsertPos)->getOpcode() != WebAssembly::END_BLOCK &&
375-
prev(InsertPos)->getOpcode() != WebAssembly::END_LOOP)
372+
while (InsertPos != Header->begin() &&
373+
IsChild(*std::prev(InsertPos), MFI) &&
374+
std::prev(InsertPos)->getOpcode() != WebAssembly::LOOP &&
375+
std::prev(InsertPos)->getOpcode() != WebAssembly::END_BLOCK &&
376+
std::prev(InsertPos)->getOpcode() != WebAssembly::END_LOOP)
376377
--InsertPos;
377378
}
378379

@@ -406,13 +407,13 @@ static void PlaceLoopMarker(
406407
// The operand of a LOOP is the first block after the loop. If the loop is the
407408
// bottom of the function, insert a dummy block at the end.
408409
MachineBasicBlock *Bottom = LoopBottom(Loop);
409-
auto Iter = next(MachineFunction::iterator(Bottom));
410+
auto Iter = std::next(MachineFunction::iterator(Bottom));
410411
if (Iter == MF.end()) {
411412
MachineBasicBlock *Label = MF.CreateMachineBasicBlock();
412413
// Give it a fake predecessor so that AsmPrinter prints its label.
413414
Label->addSuccessor(Label);
414415
MF.push_back(Label);
415-
Iter = next(MachineFunction::iterator(Bottom));
416+
Iter = std::next(MachineFunction::iterator(Bottom));
416417
}
417418
MachineBasicBlock *AfterLoop = &*Iter;
418419

0 commit comments

Comments
 (0)