summaryrefslogtreecommitdiff
path: root/src/tools/wasm-opt.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/tools/wasm-opt.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/tools/wasm-opt.cpp')
-rw-r--r--src/tools/wasm-opt.cpp18
1 files changed, 12 insertions, 6 deletions
diff --git a/src/tools/wasm-opt.cpp b/src/tools/wasm-opt.cpp
index e9f369d22..f7e8b5918 100644
--- a/src/tools/wasm-opt.cpp
+++ b/src/tools/wasm-opt.cpp
@@ -203,8 +203,9 @@ int main(int argc, const char* argv[]) {
Module wasm;
- if (options.debug)
+ if (options.debug) {
std::cerr << "reading...\n";
+ }
if (!translateToFuzz) {
ModuleReader reader;
@@ -280,9 +281,10 @@ int main(int argc, const char* argv[]) {
std::string firstOutput;
if (extraFuzzCommand.size() > 0 && options.extra.count("output") > 0) {
- if (options.debug)
+ if (options.debug) {
std::cerr << "writing binary before opts, for extra fuzz command..."
<< std::endl;
+ }
ModuleWriter writer;
writer.setDebug(options.debug);
writer.setBinary(emitBinary);
@@ -316,8 +318,9 @@ int main(int argc, const char* argv[]) {
}
if (options.runningPasses()) {
- if (options.debug)
+ if (options.debug) {
std::cerr << "running passes...\n";
+ }
auto runPasses = [&]() {
options.runPasses(*curr);
if (options.passOptions.validate) {
@@ -340,13 +343,15 @@ int main(int argc, const char* argv[]) {
};
auto lastSize = getSize();
while (1) {
- if (options.debug)
+ if (options.debug) {
std::cerr << "running iteration for convergence (" << lastSize
<< ")...\n";
+ }
runPasses();
auto currSize = getSize();
- if (currSize >= lastSize)
+ if (currSize >= lastSize) {
break;
+ }
lastSize = currSize;
}
}
@@ -359,8 +364,9 @@ int main(int argc, const char* argv[]) {
if (options.extra.count("output") == 0) {
std::cerr << "(no output file specified, not emitting output)\n";
} else {
- if (options.debug)
+ if (options.debug) {
std::cerr << "writing..." << std::endl;
+ }
ModuleWriter writer;
writer.setDebug(options.debug);
writer.setBinary(emitBinary);