[cfe-commits] r78021 - /cfe/trunk/lib/Frontend/HTMLDiagnostics.cpp

Ted Kremenek kremenek at apple.com
Mon Aug 3 16:44:57 PDT 2009


Author: kremenek
Date: Mon Aug  3 18:44:55 2009
New Revision: 78021

URL: http://llvm.org/viewvc/llvm-project?rev=78021&view=rev
Log:
Emit a special 'BUGMETAEND' comment to aid in the postprocessing of HTML bug reports.

Modified:
    cfe/trunk/lib/Frontend/HTMLDiagnostics.cpp

Modified: cfe/trunk/lib/Frontend/HTMLDiagnostics.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/HTMLDiagnostics.cpp?rev=78021&r1=78020&r2=78021&view=diff

==============================================================================
--- cfe/trunk/lib/Frontend/HTMLDiagnostics.cpp (original)
+++ cfe/trunk/lib/Frontend/HTMLDiagnostics.cpp Mon Aug  3 18:44:55 2009
@@ -274,56 +274,37 @@
   }
   
   // Embed meta-data tags.
-  
-  const std::string& BugDesc = D.getDescription();
-  
-  if (!BugDesc.empty()) {
-    std::string s;
-    llvm::raw_string_ostream os(s);
-    os << "\n<!-- BUGDESC " << BugDesc << " -->\n";
-    R.InsertStrBefore(SMgr.getLocForStartOfFile(FID), os.str());
-  }
-  
-  const std::string& BugType = D.getBugType();
-  if (!BugType.empty()) {
-    std::string s;
-    llvm::raw_string_ostream os(s);
-    os << "\n<!-- BUGTYPE " << BugType << " -->\n";
-    R.InsertStrBefore(SMgr.getLocForStartOfFile(FID), os.str());
-  }
-  
-  const std::string& BugCategory = D.getCategory();
-  
-  if (!BugCategory.empty()) {
-    std::string s;
-    llvm::raw_string_ostream os(s);
-    os << "\n<!-- BUGCATEGORY " << BugCategory << " -->\n";
-    R.InsertStrBefore(SMgr.getLocForStartOfFile(FID), os.str());
-  }
-  
   {
     std::string s;
     llvm::raw_string_ostream os(s);
-    os << "\n<!-- BUGFILE " << DirName << Entry->getName() << " -->\n";
-    R.InsertStrBefore(SMgr.getLocForStartOfFile(FID), os.str());
-  }
   
-  {
-    std::string s;
-    llvm::raw_string_ostream os(s);
+    const std::string& BugDesc = D.getDescription();  
+    if (!BugDesc.empty())
+      os << "\n<!-- BUGDESC " << BugDesc << " -->\n";
+    
+    const std::string& BugType = D.getBugType();
+    if (!BugType.empty())
+      os << "\n<!-- BUGTYPE " << BugType << " -->\n";
+  
+    const std::string& BugCategory = D.getCategory();  
+    if (!BugCategory.empty())
+      os << "\n<!-- BUGCATEGORY " << BugCategory << " -->\n";
+
+    os << "\n<!-- BUGFILE " << DirName << Entry->getName() << " -->\n";
+
     os << "\n<!-- BUGLINE "
        << D.back()->getLocation().asLocation().getInstantiationLineNumber()
        << " -->\n";
-    R.InsertStrBefore(SMgr.getLocForStartOfFile(FID), os.str());
-  }
-  
-  {
-    std::string s;
-    llvm::raw_string_ostream os(s);
+
     os << "\n<!-- BUGPATHLENGTH " << D.size() << " -->\n";
+    
+    // Mark the end of the tags.
+    os << "\n<!-- BUGMETAEND -->\n";
+    
+    // Insert the text.
     R.InsertStrBefore(SMgr.getLocForStartOfFile(FID), os.str());
   }
-
+  
   // Add CSS, header, and footer.
   
   html::AddHeaderFooterInternalBuiltinCSS(R, FID, Entry->getName());





More information about the cfe-commits mailing list