summaryrefslogtreecommitdiff
path: root/src/passes/DeadCodeElimination.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/DeadCodeElimination.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/DeadCodeElimination.cpp')
-rw-r--r--src/passes/DeadCodeElimination.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/passes/DeadCodeElimination.cpp b/src/passes/DeadCodeElimination.cpp
index d23713060..c77edf357 100644
--- a/src/passes/DeadCodeElimination.cpp
+++ b/src/passes/DeadCodeElimination.cpp
@@ -49,8 +49,9 @@ struct DeadCodeElimination
Expression* replaceCurrent(Expression* expression) {
auto* old = getCurrent();
- if (old == expression)
+ if (old == expression) {
return expression;
+ }
super::replaceCurrent(expression);
// also update the type updater
typeUpdater.noteReplacement(old, expression);
@@ -333,8 +334,9 @@ struct DeadCodeElimination
// we don't need to drop unreachable nodes
Expression* drop(Expression* toDrop) {
- if (toDrop->type == unreachable)
+ if (toDrop->type == unreachable) {
return toDrop;
+ }
return Builder(*getModule()).makeDrop(toDrop);
}
@@ -362,8 +364,9 @@ struct DeadCodeElimination
void visitCall(Call* curr) { handleCall(curr); }
void visitCallIndirect(CallIndirect* curr) {
- if (handleCall(curr) != curr)
+ if (handleCall(curr) != curr) {
return;
+ }
if (isUnreachable(curr->target)) {
auto* block = getModule()->allocator.alloc<Block>();
for (auto* operand : curr->operands) {