diff options
author | Max Graey <maxgraey@gmail.com> | 2021-11-23 07:03:25 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-11-22 21:03:25 -0800 |
commit | 7f24fce21a92f2aed4a11745d27d5181798ba6cd (patch) | |
tree | 80655dc933e3c2ae3ae53b7960cd71a6a022c3da /src/passes/ReReloop.cpp | |
parent | 37999167bb333dd0b12d744af8e633897e65cff8 (diff) | |
download | binaryen-7f24fce21a92f2aed4a11745d27d5181798ba6cd.tar.gz binaryen-7f24fce21a92f2aed4a11745d27d5181798ba6cd.tar.bz2 binaryen-7f24fce21a92f2aed4a11745d27d5181798ba6cd.zip |
Modernize code to C++17 (#3104)
Diffstat (limited to 'src/passes/ReReloop.cpp')
-rw-r--r-- | src/passes/ReReloop.cpp | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/passes/ReReloop.cpp b/src/passes/ReReloop.cpp index 0559343d4..4499bb07b 100644 --- a/src/passes/ReReloop.cpp +++ b/src/passes/ReReloop.cpp @@ -228,9 +228,8 @@ struct ReReloop final : public Pass { for (Index i = 0; i < num; i++) { targetValues[targets[i]].insert(i); } - for (auto& iter : targetValues) { - parent.addSwitchBranch( - before, parent.getBreakTarget(iter.first), iter.second); + for (auto& [name, indices] : targetValues) { + parent.addSwitchBranch(before, parent.getBreakTarget(name), indices); } // the default may be among the targets, in which case, we can't add it // simply as it would be a duplicate, so create a temp block @@ -328,9 +327,7 @@ struct ReReloop final : public Pass { std::cout << "rerelooping " << function->name << '\n'; for (auto* block : relooper->Blocks) { std::cout << block << " block:\n" << block->Code << '\n'; - for (auto& pair : block->BranchesOut) { - auto* target = pair.first; - auto* branch = pair.second; + for (auto& [target, branch] : block->BranchesOut) { std::cout << "branch to " << target << "\n"; if (branch->Condition) { std::cout << " with condition\n" << branch->Condition << '\n'; |