From db9124f1de0478dcac525009b6f1589b44a7edd8 Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Fri, 26 Apr 2019 16:59:41 -0700 Subject: 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 --- src/passes/LoopInvariantCodeMotion.cpp | 35 ++++++++++++++++++---------------- 1 file changed, 19 insertions(+), 16 deletions(-) (limited to 'src/passes/LoopInvariantCodeMotion.cpp') diff --git a/src/passes/LoopInvariantCodeMotion.cpp b/src/passes/LoopInvariantCodeMotion.cpp index aec2f7ce5..e9f376bd3 100644 --- a/src/passes/LoopInvariantCodeMotion.cpp +++ b/src/passes/LoopInvariantCodeMotion.cpp @@ -24,16 +24,17 @@ #include -#include "wasm.h" -#include "pass.h" -#include "wasm-builder.h" -#include "ir/local-graph.h" #include "ir/effects.h" #include "ir/find_all.h" +#include "ir/local-graph.h" +#include "pass.h" +#include "wasm-builder.h" +#include "wasm.h" namespace wasm { -struct LoopInvariantCodeMotion : public WalkerPass> { +struct LoopInvariantCodeMotion + : public WalkerPass> { bool isFunctionParallel() override { return true; } Pass* create() override { return new LoopInvariantCodeMotion; } @@ -128,11 +129,12 @@ struct LoopInvariantCodeMotion : public WalkerPass currSets(curr); for (auto* set : currSets.list) { assert(numSetsForIndex[set->index] > 0); @@ -187,8 +189,8 @@ struct LoopInvariantCodeMotion : public WalkerPasstype != none || curr->is() || curr->is() - || curr->is()) { + if (curr->type != none || curr->is() || curr->is() || + curr->is()) { return false; } // Don't move copies (set of a get, or set of a tee of a get, etc.), @@ -206,7 +208,8 @@ struct LoopInvariantCodeMotion : public WalkerPassdynCast()) { while (1) { auto* next = set->value->dynCast(); - if (!next) break; + if (!next) + break; set = next; } if (set->value->is() || set->value->is()) { @@ -223,7 +226,8 @@ struct LoopInvariantCodeMotion : public WalkerPass