[cfe-commits] r49001 - in /cfe/trunk: Driver/ASTConsumers.cpp Driver/HTMLDiagnostics.cpp lib/Rewrite/HTMLRewrite.cpp

Ted Kremenek kremenek at apple.com
Mon Mar 31 16:14:05 PDT 2008


Author: kremenek
Date: Mon Mar 31 18:14:05 2008
New Revision: 49001

URL: http://llvm.org/viewvc/llvm-project?rev=49001&view=rev
Log:
Better handling for tabs with message bubbles.

Modified:
    cfe/trunk/Driver/ASTConsumers.cpp
    cfe/trunk/Driver/HTMLDiagnostics.cpp
    cfe/trunk/lib/Rewrite/HTMLRewrite.cpp

Modified: cfe/trunk/Driver/ASTConsumers.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/Driver/ASTConsumers.cpp?rev=49001&r1=49000&r2=49001&view=diff

==============================================================================
--- cfe/trunk/Driver/ASTConsumers.cpp (original)
+++ cfe/trunk/Driver/ASTConsumers.cpp Mon Mar 31 18:14:05 2008
@@ -671,15 +671,17 @@
   if (!Visualize) {
     
     if (FunctionDecl *FD = dyn_cast<FunctionDecl>(&CD)) {
-      llvm::cerr << "ANALYZE: " << FD->getIdentifier()->getName() << ' '
+      llvm::cerr << "ANALYZE: "
                  << Ctx->getSourceManager().getSourceName(FD->getLocation())
-                 << ' ';
+                 << ' '
+                 << FD->getIdentifier()->getName()
+                 << '\n';
     }
     else if (ObjCMethodDecl *MD = dyn_cast<ObjCMethodDecl>(&CD)) {
-      llvm::cerr << "ANALYZE (ObjC Method): '"
-        << MD->getSelector().getName() << "' "
+      llvm::cerr << "ANALYZE (ObjC Method): "
         << Ctx->getSourceManager().getSourceName(MD->getLocation())
-        << ' ';
+        << " '"
+        << MD->getSelector().getName() << "'\n";
     }
 
 #if 0

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

==============================================================================
--- cfe/trunk/Driver/HTMLDiagnostics.cpp (original)
+++ cfe/trunk/Driver/HTMLDiagnostics.cpp Mon Mar 31 18:14:05 2008
@@ -205,7 +205,7 @@
   unsigned PosNo = 0;
   
   for (const char* c = LineStart; c != TokLogicalPtr; ++c)
-    PosNo += *c == '\t' ? 8 : 1;
+    PosNo += *c == '\t' ? 4 : 1;
   
   // Create the html for the message.
   

Modified: cfe/trunk/lib/Rewrite/HTMLRewrite.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Rewrite/HTMLRewrite.cpp?rev=49001&r1=49000&r2=49001&view=diff

==============================================================================
--- cfe/trunk/lib/Rewrite/HTMLRewrite.cpp (original)
+++ cfe/trunk/lib/Rewrite/HTMLRewrite.cpp Mon Mar 31 18:14:05 2008
@@ -36,9 +36,10 @@
       default: break;
         
       case ' ':
-        if (EscapeSpaces) R.ReplaceText(Loc, 1, " ", 5);
+        if (EscapeSpaces) R.ReplaceText(Loc, 1, " ", 6);
         break;
 
+      case '\t': R.ReplaceText(Loc, 1, "    ", 6*4); break;
       case '<': R.ReplaceText(Loc, 1, "<", 4); break;
       case '>': R.ReplaceText(Loc, 1, ">", 4); break;
       case '&': R.ReplaceText(Loc, 1, "&", 5); break;
@@ -60,10 +61,11 @@
         os << c; break;
         
       case ' ':
-        if (EscapeSpaces) os << " ";
+        if (EscapeSpaces) os << " ";
         else os << ' ';
         break;
         
+        case '\t': for (unsigned i = 0; i < 4; ++i) os << " "; break;
         case '<': os << "<"; break;
         case '>': os << ">"; break;
         case '&': os << "&"; break;





More information about the cfe-commits mailing list