summaryrefslogtreecommitdiff
path: root/src/passes/Vacuum.cpp
diff options
context:
space:
mode:
authorAlon Zakai <azakai@google.com>2019-05-01 14:48:41 -0700
committerGitHub <noreply@github.com>2019-05-01 14:48:41 -0700
commit2bd3758a22131cfd6925b3fd995657b211095c90 (patch)
tree2a38a48ab68c00ed1b55e885f86014bbdda92ff2 /src/passes/Vacuum.cpp
parent73709b4da08d285c2237c8c23a54ba53274c0c7f (diff)
downloadbinaryen-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/Vacuum.cpp')
-rw-r--r--src/passes/Vacuum.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/passes/Vacuum.cpp b/src/passes/Vacuum.cpp
index 8874ffed2..43a5f8a09 100644
--- a/src/passes/Vacuum.cpp
+++ b/src/passes/Vacuum.cpp
@@ -56,8 +56,9 @@ struct Vacuum : public WalkerPass<ExpressionStackWalker<Vacuum>> {
Expression* optimize(Expression* curr, bool resultUsed, bool typeMatters) {
auto type = curr->type;
// An unreachable node must not be changed.
- if (type == unreachable)
+ if (type == unreachable) {
return curr;
+ }
// We iterate on possible replacements. If a replacement changes the type,
// stop and go back.
auto* prev = curr;
@@ -104,8 +105,9 @@ struct Vacuum : public WalkerPass<ExpressionStackWalker<Vacuum>> {
case Expression::Id::ConstId:
case Expression::Id::GetLocalId:
case Expression::Id::GetGlobalId: {
- if (!resultUsed)
+ if (!resultUsed) {
return nullptr;
+ }
return curr;
}
@@ -326,8 +328,9 @@ struct Vacuum : public WalkerPass<ExpressionStackWalker<Vacuum>> {
}
void visitLoop(Loop* curr) {
- if (curr->body->is<Nop>())
+ if (curr->body->is<Nop>()) {
ExpressionManipulator::nop(curr);
+ }
}
void visitDrop(Drop* curr) {