diff options
author | Alon Zakai <azakai@google.com> | 2019-04-26 16:59:41 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-04-26 16:59:41 -0700 |
commit | db9124f1de0478dcac525009b6f1589b44a7edd8 (patch) | |
tree | fa26395a0f6cca53cf5cb6e10189f989c5bfa847 /src/passes/LocalCSE.cpp | |
parent | 87636dccd404a340d75acb1d96301581343f29ca (diff) | |
download | binaryen-db9124f1de0478dcac525009b6f1589b44a7edd8.tar.gz binaryen-db9124f1de0478dcac525009b6f1589b44a7edd8.tar.bz2 binaryen-db9124f1de0478dcac525009b6f1589b44a7edd8.zip |
Apply format changes from #2048 (#2059)
Mass change to apply clang-format to everything. We are applying this in a PR by me so the (git) blame is all mine ;) but @aheejin did all the work to get clang-format set up and all the manual work to tidy up some things to make the output nicer in #2048
Diffstat (limited to 'src/passes/LocalCSE.cpp')
-rw-r--r-- | src/passes/LocalCSE.cpp | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/src/passes/LocalCSE.cpp b/src/passes/LocalCSE.cpp index 1338c6571..d582c8275 100644 --- a/src/passes/LocalCSE.cpp +++ b/src/passes/LocalCSE.cpp @@ -37,15 +37,15 @@ #include <algorithm> #include <memory> -#include <wasm.h> -#include <wasm-builder.h> -#include <wasm-traversal.h> -#include <pass.h> +#include "ir/flat.h" #include <ir/cost.h> #include <ir/effects.h> #include <ir/equivalent_sets.h> -#include "ir/flat.h" #include <ir/hashed.h> +#include <pass.h> +#include <wasm-builder.h> +#include <wasm-traversal.h> +#include <wasm.h> namespace wasm { @@ -60,7 +60,8 @@ struct LocalCSE : public WalkerPass<LinearExecutionWalker<LocalCSE>> { Index index; // the local we are assigned to, local.get that to reuse us EffectAnalyzer effects; - UsableInfo(Expression* value, Index index, PassOptions& passOptions) : value(value), index(index), effects(passOptions, value) {} + UsableInfo(Expression* value, Index index, PassOptions& passOptions) + : value(value), index(index), effects(passOptions, value) {} }; // a list of usables in a linear execution trace @@ -183,11 +184,13 @@ struct LocalCSE : public WalkerPass<LinearExecutionWalker<LocalCSE>> { if (iter != usables.end()) { // already exists in the table, this is good to reuse auto& info = iter->second; - set->value = Builder(*getModule()).makeGetLocal(info.index, value->type); + set->value = + Builder(*getModule()).makeGetLocal(info.index, value->type); anotherPass = true; } else { // not in table, add this, maybe we can help others later - usables.emplace(std::make_pair(hashed, UsableInfo(value, set->index, getPassOptions()))); + usables.emplace(std::make_pair( + hashed, UsableInfo(value, set->index, getPassOptions()))); } } } else if (auto* get = curr->dynCast<GetLocal>()) { @@ -227,8 +230,6 @@ struct LocalCSE : public WalkerPass<LinearExecutionWalker<LocalCSE>> { } }; -Pass *createLocalCSEPass() { - return new LocalCSE(); -} +Pass* createLocalCSEPass() { return new LocalCSE(); } } // namespace wasm |