diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/passes/Metrics.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/passes/Metrics.cpp b/src/passes/Metrics.cpp index 9181da9bb..4dd8b1955 100644 --- a/src/passes/Metrics.cpp +++ b/src/passes/Metrics.cpp @@ -57,6 +57,23 @@ struct Metrics : public WalkerPass<PostWalker<Metrics, UnifiedExpressionVisitor< // add functions keys.push_back("[funcs]"); counts["[funcs]"] = module->functions.size(); + // add memory and table + if (module->memory.exists) { + Index size = 0; + for (auto& segment: module->memory.segments) { + size += segment.data.size(); + } + keys.push_back("[memory-data]"); + counts["[memory-data]"] = size; + } + if (module->table.exists) { + Index size = 0; + for (auto& segment: module->table.segments) { + size += segment.data.size(); + } + keys.push_back("[table-data]"); + counts["[table-data]"] = size; + } // sort sort(keys.begin(), keys.end(), [](const char* a, const char* b) -> bool { return strcmp(b, a) > 0; |