summaryrefslogtreecommitdiff
path: root/src/passes/Print.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/passes/Print.cpp')
-rw-r--r--src/passes/Print.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/passes/Print.cpp b/src/passes/Print.cpp
index 7f06f8c17..3ae7b6899 100644
--- a/src/passes/Print.cpp
+++ b/src/passes/Print.cpp
@@ -170,6 +170,8 @@ struct PrintSExpression : public UnifiedExpressionVisitor<PrintSExpression> {
std::vector<HeapType> heapTypes;
+ unsigned lastPrintIndent = 0;
+
// Print type names by saved name or index if we have a module, or otherwise
// by generating minimalist names. TODO: Handle conflicts between
// user-provided names and the fallback indexed names.
@@ -2375,10 +2377,11 @@ std::ostream& PrintSExpression::printPrefixedTypes(const char* prefix,
void PrintSExpression::printDebugLocation(
const Function::DebugLocation& location) {
- if (lastPrintedLocation == location) {
+ if (lastPrintedLocation == location && indent > lastPrintIndent) {
return;
}
lastPrintedLocation = location;
+ lastPrintIndent = indent;
auto fileName = currModule->debugInfoFileNames[location.fileIndex];
o << ";;@ " << fileName << ":" << location.lineNumber << ":"
<< location.columnNumber << '\n';