Don't expand tabs in EscapeText, but rather expand them when writing out
the HTML file. This should reduce the amount of memory pressure on the
rewriter for files that have a lot of tabs.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49406 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/Driver/HTMLDiagnostics.cpp b/Driver/HTMLDiagnostics.cpp
index 8706289..6910af7 100644
--- a/Driver/HTMLDiagnostics.cpp
+++ b/Driver/HTMLDiagnostics.cpp
@@ -199,8 +199,13 @@
// Emit the HTML to disk.
- for (RewriteBuffer::iterator I = Buf->begin(), E = Buf->end(); I!=E; ++I)
- os << *I;
+ for (RewriteBuffer::iterator I = Buf->begin(), E = Buf->end(); I!=E; ++I) {
+ // Expand tabs.
+ if (*I == '\t')
+ os << " ";
+ else
+ os << *I;
+ }
}
void HTMLDiagnostics::HandlePiece(Rewriter& R,