diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/passes/Print.cpp | 19 |
1 files changed, 3 insertions, 16 deletions
diff --git a/src/passes/Print.cpp b/src/passes/Print.cpp index fa61a3d1c..1392ccb6f 100644 --- a/src/passes/Print.cpp +++ b/src/passes/Print.cpp @@ -2634,23 +2634,8 @@ struct PrintSExpression : public UnifiedExpressionVisitor<PrintSExpression> { printTableHeader(curr); o << maybeNewLine; } - - ModuleUtils::iterTableSegments( - *currModule, curr->name, [&](ElementSegment* segment) { - printElementSegment(segment); - }); } void visitElementSegment(ElementSegment* curr) { - if (curr->table.is()) { - return; - } - printElementSegment(curr); - } - void printElementSegment(ElementSegment* curr) { - // Don't print empty segments - if (curr->data.empty()) { - return; - } bool allElementsRefFunc = std::all_of(curr->data.begin(), curr->data.end(), [](Expression* entry) { return entry->is<RefFunc>(); @@ -2666,7 +2651,9 @@ struct PrintSExpression : public UnifiedExpressionVisitor<PrintSExpression> { doIndent(o, indent); o << '('; printMedium(o, "elem"); - if (curr->hasExplicitName) { + // If there is no explicit name, and there are multiple segments, use our + // internal names to differentiate them. + if (curr->hasExplicitName || currModule->elementSegments.size() > 1) { o << ' '; printName(curr->name, o); } |