diff options
author | Alon Zakai <azakai@google.com> | 2019-05-01 14:48:41 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-05-01 14:48:41 -0700 |
commit | 2bd3758a22131cfd6925b3fd995657b211095c90 (patch) | |
tree | 2a38a48ab68c00ed1b55e885f86014bbdda92ff2 /src/passes/CodePushing.cpp | |
parent | 73709b4da08d285c2237c8c23a54ba53274c0c7f (diff) | |
download | binaryen-2bd3758a22131cfd6925b3fd995657b211095c90.tar.gz binaryen-2bd3758a22131cfd6925b3fd995657b211095c90.tar.bz2 binaryen-2bd3758a22131cfd6925b3fd995657b211095c90.zip |
clang-tidy braces changes (#2075)
Applies the changes in #2065, and temprarily disables the hook since it's too slow to run on a change this large. We should re-enable it in a later commit.
Diffstat (limited to 'src/passes/CodePushing.cpp')
-rw-r--r-- | src/passes/CodePushing.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/passes/CodePushing.cpp b/src/passes/CodePushing.cpp index 342cb5182..88e363541 100644 --- a/src/passes/CodePushing.cpp +++ b/src/passes/CodePushing.cpp @@ -50,8 +50,9 @@ struct LocalAnalyzer : public PostWalker<LocalAnalyzer> { std::fill(sfa.begin() + func->getNumParams(), sfa.end(), true); walk(func->body); for (Index i = 0; i < num; i++) { - if (numSets[i] == 0) + if (numSets[i] == 0) { sfa[i] = false; + } } } @@ -117,8 +118,9 @@ public: private: SetLocal* isPushable(Expression* curr) { auto* set = curr->dynCast<SetLocal>(); - if (!set) + if (!set) { return nullptr; + } auto index = set->index; // to be pushable, this must be SFA and the right # of gets, // but also have no side effects, as it may not execute if pushed. @@ -137,8 +139,9 @@ private: if (auto* drop = curr->dynCast<Drop>()) { curr = drop->value; } - if (curr->is<If>()) + if (curr->is<If>()) { return true; + } if (auto* br = curr->dynCast<Break>()) { return !!br->condition; } @@ -249,8 +252,9 @@ struct CodePushing : public WalkerPass<PostWalker<CodePushing>> { // Pushing code only makes sense if we are size 3 or above: we need // one element to push, an element to push it past, and an element to use // what we pushed. - if (curr->list.size() < 3) + if (curr->list.size() < 3) { return; + } // At this point in the postorder traversal we have gone through all our // children. Therefore any variable whose gets seen so far is equal to the // total gets must have no further users after this block. And therefore |