]> granicus.if.org Git - clang/commitdiff
Added <h3> tag in HTML file output that contains the name of the source file.
authorTed Kremenek <kremenek@apple.com>
Thu, 27 Mar 2008 07:35:49 +0000 (07:35 +0000)
committerTed Kremenek <kremenek@apple.com>
Thu, 27 Mar 2008 07:35:49 +0000 (07:35 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48869 91177308-0d34-0410-b5e6-96231b3b80d8

Driver/HTMLDiagnostics.cpp
lib/Rewrite/HTMLRewrite.cpp

index 5e4ba971ebefc366f3fd227655759964eaf8e816..6583064d1826f5ff510e5b75b92ed3eae67e3086 100644 (file)
@@ -13,6 +13,7 @@
 
 #include "HTMLDiagnostics.h"
 #include "clang/Basic/SourceManager.h"
+#include "clang/Basic/FileManager.h"
 #include "clang/AST/ASTContext.h"
 #include "clang/Analysis/PathDiagnostic.h"
 #include "clang/Rewrite/Rewriter.h"
@@ -105,11 +106,21 @@ void HTMLDiagnostics::HandlePathDiagnostic(const PathDiagnostic& D) {
   }
   
   // Add line numbers, header, footer, etc.
+  
   unsigned FileID = R.getSourceMgr().getMainFileID();
   html::EscapeText(R, FileID);
   html::AddLineNumbers(R, FileID);
   
-  // FIXME: Add the number of the file here.
+  // Add the name of the file.
+  
+  {
+    std::ostringstream os;
+    const FileEntry* Entry = SMgr.getFileEntryForID(FileID);
+    
+    os << "<h1>" << Entry->getName() << "</h1>\n";
+
+    R.InsertStrBefore(SourceLocation::getFileLoc(FileID, 0), os.str());
+  }  
 
   // Add CSS, header, and footer.
   
index 6538d9e072f49d1cef5b2f7a6c38ff96e5bdba34..b886bec38bac0e89761540e90018079e2fb70d92 100644 (file)
@@ -138,6 +138,7 @@ void html::AddHeaderFooterInternalBuiltinCSS(Rewriter& R, unsigned FileID) {
     os << "<html>\n<head>\n"
        << "<style type=\"text/css\">\n"
        << " body { color:#000000; background-color:#ffffff }\n"
+       << " body { font-family:Helvetica, sans-serif }\n"
        << " .code { border-spacing:0px; width:100%; }\n"
        << " .code { font-family: \"Andale Mono\", fixed; font-size:10pt }\n"
        << " .code { line-height: 1.2em }\n"