From 2bd3758a22131cfd6925b3fd995657b211095c90 Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Wed, 1 May 2019 14:48:41 -0700 Subject: 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. --- src/passes/DataFlowOpts.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/passes/DataFlowOpts.cpp') diff --git a/src/passes/DataFlowOpts.cpp b/src/passes/DataFlowOpts.cpp index 3391359ef..62d2e5f24 100644 --- a/src/passes/DataFlowOpts.cpp +++ b/src/passes/DataFlowOpts.cpp @@ -81,11 +81,13 @@ struct DataFlowOpts : public WalkerPass> { } void workOn(DataFlow::Node* node) { - if (node->isConst()) + if (node->isConst()) { return; + } // If there are no uses, there is no point to work. - if (nodeUsers.getNumUses(node) == 0) + if (nodeUsers.getNumUses(node) == 0) { return; + } // Optimize: Look for nodes that we can easily convert into // something simpler. // TODO: we can expressionify and run full normal opts on that, @@ -144,8 +146,9 @@ struct DataFlowOpts : public WalkerPass> { // Get the optimized thing auto* result = func->body; // It may not be a constant, e.g. 0 / 0 does not optimize to 0 - if (!result->is()) + if (!result->is()) { return; + } // All good, copy it. node->expr = Builder(*getModule()).makeConst(result->cast()->value); assert(node->isConst()); -- cgit v1.2.3