diff options
author | Sam Clegg <sbc@chromium.org> | 2019-03-19 13:14:14 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-03-19 13:14:14 -0700 |
commit | 9f1e78627f3c77053b6a8ccfffa48a975ef07d4c (patch) | |
tree | c4a3d2725fa7c429aeaf084d25501cead32432bb /src | |
parent | 9e2559b789424ea1920c5e9c73b63a976390226c (diff) | |
download | binaryen-9f1e78627f3c77053b6a8ccfffa48a975ef07d4c.tar.gz binaryen-9f1e78627f3c77053b6a8ccfffa48a975ef07d4c.tar.bz2 binaryen-9f1e78627f3c77053b6a8ccfffa48a975ef07d4c.zip |
Add export count to --metrics (#1954)
Also, always output high level metrics even when zero.
Diffstat (limited to 'src')
-rw-r--r-- | src/passes/Metrics.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/passes/Metrics.cpp b/src/passes/Metrics.cpp index b794ea32d..8717a86b7 100644 --- a/src/passes/Metrics.cpp +++ b/src/passes/Metrics.cpp @@ -66,6 +66,7 @@ struct Metrics : public WalkerPass<PostWalker<Metrics, UnifiedExpressionVisitor< counts["[imports]"] = imports.getNumImports(); // add functions counts["[funcs]"] = imports.getNumDefinedFunctions(); + counts["[exports]"] = module->exports.size(); // add memory and table if (module->memory.exists) { Index size = 0; @@ -172,7 +173,7 @@ struct Metrics : public WalkerPass<PostWalker<Metrics, UnifiedExpressionVisitor< o << title << "\n"; for (auto* key : keys) { auto value = counts[key]; - if (value == 0) continue; + if (value == 0 && key[0] != '[') continue; o << " " << left << setw(15) << key << ": " << setw(8) << value; if (lastCounts.count(key)) { |