[cfe-commits] r48869 - in /cfe/trunk: Driver/HTMLDiagnostics.cpp lib/Rewrite/HTMLRewrite.cpp
Ted Kremenek
kremenek at apple.com
Thu Mar 27 00:35:49 PDT 2008
Author: kremenek
Date: Thu Mar 27 02:35:49 2008
New Revision: 48869
URL: http://llvm.org/viewvc/llvm-project?rev=48869&view=rev
Log:
Added <h3> tag in HTML file output that contains the name of the source file.
Modified:
cfe/trunk/Driver/HTMLDiagnostics.cpp
cfe/trunk/lib/Rewrite/HTMLRewrite.cpp
Modified: cfe/trunk/Driver/HTMLDiagnostics.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/Driver/HTMLDiagnostics.cpp?rev=48869&r1=48868&r2=48869&view=diff
==============================================================================
--- cfe/trunk/Driver/HTMLDiagnostics.cpp (original)
+++ cfe/trunk/Driver/HTMLDiagnostics.cpp Thu Mar 27 02:35:49 2008
@@ -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 @@
}
// 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.
Modified: cfe/trunk/lib/Rewrite/HTMLRewrite.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Rewrite/HTMLRewrite.cpp?rev=48869&r1=48868&r2=48869&view=diff
==============================================================================
--- cfe/trunk/lib/Rewrite/HTMLRewrite.cpp (original)
+++ cfe/trunk/lib/Rewrite/HTMLRewrite.cpp Thu Mar 27 02:35:49 2008
@@ -138,6 +138,7 @@
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"
More information about the cfe-commits
mailing list