[cfe-commits] r49982 - in /cfe/trunk: Driver/HTMLDiagnostics.cpp include/clang/Rewrite/HTMLRewrite.h

Ted Kremenek kremenek at apple.com
Sat Apr 19 18:02:33 PDT 2008


Author: kremenek
Date: Sat Apr 19 20:02:33 2008
New Revision: 49982

URL: http://llvm.org/viewvc/llvm-project?rev=49982&view=rev
Log:
html::EscapeText (using the Rewriter) now replaces tabs by default.

Modified:
    cfe/trunk/Driver/HTMLDiagnostics.cpp
    cfe/trunk/include/clang/Rewrite/HTMLRewrite.h

Modified: cfe/trunk/Driver/HTMLDiagnostics.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/Driver/HTMLDiagnostics.cpp?rev=49982&r1=49981&r2=49982&view=diff

==============================================================================
--- cfe/trunk/Driver/HTMLDiagnostics.cpp (original)
+++ cfe/trunk/Driver/HTMLDiagnostics.cpp Sat Apr 19 20:02:33 2008
@@ -224,13 +224,8 @@
   
   // Emit the HTML to disk.
 
-  for (RewriteBuffer::iterator I = Buf->begin(), E = Buf->end(); I!=E; ++I) {
-    // Expand tabs.
-    if (*I == '\t')
-      os << "   ";
-    else  
+  for (RewriteBuffer::iterator I = Buf->begin(), E = Buf->end(); I!=E; ++I)
       os << *I;
-  }
 }
 
 void HTMLDiagnostics::HandlePiece(Rewriter& R,

Modified: cfe/trunk/include/clang/Rewrite/HTMLRewrite.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Rewrite/HTMLRewrite.h?rev=49982&r1=49981&r2=49982&view=diff

==============================================================================
--- cfe/trunk/include/clang/Rewrite/HTMLRewrite.h (original)
+++ cfe/trunk/include/clang/Rewrite/HTMLRewrite.h Sat Apr 19 20:02:33 2008
@@ -49,12 +49,9 @@
                       const char *StartTag, const char *EndTag);
   
   /// EscapeText - HTMLize a specified file so that special characters are
-  /// are translated so that they are not interpreted as HTML tags.  In this
-  /// version tabs are not replaced with spaces by default, as this can
-  /// introduce a serious performance overhead as the amount of replaced
-  /// text can be very large.
+  /// are translated so that they are not interpreted as HTML tags.
   void EscapeText(Rewriter& R, unsigned FileID,
-                  bool EscapeSpaces = false, bool ReplacesTabs = false);
+                  bool EscapeSpaces = false, bool ReplacesTabs = true);
 
   /// EscapeText - HTMLized the provided string so that special characters
   ///  in 's' are not interpreted as HTML tags.  Unlike the version of





More information about the cfe-commits mailing list