diff options
| author | Dimitry Andric <dim@FreeBSD.org> | 2022-03-20 11:40:34 +0000 | 
|---|---|---|
| committer | Dimitry Andric <dim@FreeBSD.org> | 2022-06-04 11:58:51 +0000 | 
| commit | 4b6eb0e63c698094db5506763df44cc83c19f643 (patch) | |
| tree | f1d30b8c10bc6db323b91538745ae8ab8b593910 /contrib/llvm-project/llvm/lib/Target/WebAssembly/WebAssemblyCFGStackify.cpp | |
| parent | 76886853f03395abb680824bcc74e98f83bd477a (diff) | |
Diffstat (limited to 'contrib/llvm-project/llvm/lib/Target/WebAssembly/WebAssemblyCFGStackify.cpp')
| -rw-r--r-- | contrib/llvm-project/llvm/lib/Target/WebAssembly/WebAssemblyCFGStackify.cpp | 14 | 
1 files changed, 6 insertions, 8 deletions
diff --git a/contrib/llvm-project/llvm/lib/Target/WebAssembly/WebAssemblyCFGStackify.cpp b/contrib/llvm-project/llvm/lib/Target/WebAssembly/WebAssemblyCFGStackify.cpp index 59d69e48b775..7832f199a2cc 100644 --- a/contrib/llvm-project/llvm/lib/Target/WebAssembly/WebAssemblyCFGStackify.cpp +++ b/contrib/llvm-project/llvm/lib/Target/WebAssembly/WebAssemblyCFGStackify.cpp @@ -173,7 +173,7 @@ static bool explicitlyBranchesTo(MachineBasicBlock *Pred,  // satisfying the restrictions given by BeforeSet and AfterSet. BeforeSet  // contains instructions that should go before the marker, and AfterSet contains  // ones that should go after the marker. In this function, AfterSet is only -// used for sanity checking. +// used for validation checking.  template <typename Container>  static MachineBasicBlock::iterator  getEarliestInsertPos(MachineBasicBlock *MBB, const Container &BeforeSet, @@ -182,7 +182,7 @@ getEarliestInsertPos(MachineBasicBlock *MBB, const Container &BeforeSet,    while (InsertPos != MBB->begin()) {      if (BeforeSet.count(&*std::prev(InsertPos))) {  #ifndef NDEBUG -      // Sanity check +      // Validation check        for (auto Pos = InsertPos, E = MBB->begin(); Pos != E; --Pos)          assert(!AfterSet.count(&*std::prev(Pos)));  #endif @@ -197,7 +197,7 @@ getEarliestInsertPos(MachineBasicBlock *MBB, const Container &BeforeSet,  // satisfying the restrictions given by BeforeSet and AfterSet. BeforeSet  // contains instructions that should go before the marker, and AfterSet contains  // ones that should go after the marker. In this function, BeforeSet is only -// used for sanity checking. +// used for validation checking.  template <typename Container>  static MachineBasicBlock::iterator  getLatestInsertPos(MachineBasicBlock *MBB, const Container &BeforeSet, @@ -206,7 +206,7 @@ getLatestInsertPos(MachineBasicBlock *MBB, const Container &BeforeSet,    while (InsertPos != MBB->end()) {      if (AfterSet.count(&*InsertPos)) {  #ifndef NDEBUG -      // Sanity check +      // Validation check        for (auto Pos = InsertPos, E = MBB->end(); Pos != E; ++Pos)          assert(!BeforeSet.count(&*Pos));  #endif @@ -842,8 +842,7 @@ static void unstackifyVRegsUsedInSplitBB(MachineBasicBlock &MBB,    //    INST ..., TeeReg, ...    //    INST ..., Reg, ...    //    INST ..., Reg, ... -  for (auto I = MBB.begin(), E = MBB.end(); I != E;) { -    MachineInstr &MI = *I++; +  for (MachineInstr &MI : llvm::make_early_inc_range(MBB)) {      if (!WebAssembly::isTee(MI.getOpcode()))        continue;      Register TeeReg = MI.getOperand(0).getReg(); @@ -1671,8 +1670,7 @@ void WebAssemblyCFGStackify::rewriteDepthImmediates(MachineFunction &MF) {    SmallVector<EndMarkerInfo, 8> Stack;    SmallVector<const MachineBasicBlock *, 8> EHPadStack;    for (auto &MBB : reverse(MF)) { -    for (auto I = MBB.rbegin(), E = MBB.rend(); I != E; ++I) { -      MachineInstr &MI = *I; +    for (MachineInstr &MI : llvm::reverse(MBB)) {        switch (MI.getOpcode()) {        case WebAssembly::BLOCK:        case WebAssembly::TRY:  | 
