]> granicus.if.org Git - clang/commitdiff
Emit a special 'BUGMETAEND' comment to aid in the postprocessing of HTML bug reports.
authorTed Kremenek <kremenek@apple.com>
Mon, 3 Aug 2009 23:44:55 +0000 (23:44 +0000)
committerTed Kremenek <kremenek@apple.com>
Mon, 3 Aug 2009 23:44:55 +0000 (23:44 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78021 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Frontend/HTMLDiagnostics.cpp

index 160da7c09734756027cbfa919b3d0c6d0118a3f7..9b86755538ff7004bba36f9962dcd6684a80245e 100644 (file)
@@ -274,56 +274,37 @@ void HTMLDiagnostics::ReportDiag(const PathDiagnostic& D) {
   }
   
   // 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());
-  }
+    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";
   
-  {
-    std::string s;
-    llvm::raw_string_ostream os(s);
+    const std::string& BugCategory = D.getCategory();  
+    if (!BugCategory.empty())
+      os << "\n<!-- BUGCATEGORY " << BugCategory << " -->\n";
+
     os << "\n<!-- BUGFILE " << DirName << Entry->getName() << " -->\n";
-    R.InsertStrBefore(SMgr.getLocForStartOfFile(FID), os.str());
-  }
-  
-  {
-    std::string s;
-    llvm::raw_string_ostream os(s);
+
     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());