diff options
author | Ted Kremenek <kremenek@apple.com> | 2008-03-19 21:59:05 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2008-03-19 21:59:05 +0000 |
commit | 1651b7cd2db2719c39b4e2871b9e1a1ae28c8ef2 (patch) | |
tree | 8f4b171b20dc37788e08212856ad0da791e5ae5a /clang/Driver/HTMLPrint.cpp | |
parent | 718da668ab066d742bd2d4670714c64e98ee39fb (diff) | |
download | bcm5719-llvm-1651b7cd2db2719c39b4e2871b9e1a1ae28c8ef2.tar.gz bcm5719-llvm-1651b7cd2db2719c39b4e2871b9e1a1ae28c8ef2.zip |
Misc. cleanups to HTML printing: make code rendered using tables; add
better div positioning for messages.
llvm-svn: 48555
Diffstat (limited to 'clang/Driver/HTMLPrint.cpp')
-rw-r--r-- | clang/Driver/HTMLPrint.cpp | 22 |
1 files changed, 8 insertions, 14 deletions
diff --git a/clang/Driver/HTMLPrint.cpp b/clang/Driver/HTMLPrint.cpp index 1108bc3bdaa..a6b90fafdff 100644 --- a/clang/Driver/HTMLPrint.cpp +++ b/clang/Driver/HTMLPrint.cpp @@ -179,19 +179,15 @@ void HTMLDiagnostic::HandleDiagnostic(Diagnostic &Diags, (StrNo < NumStrs ? Strs[StrNo] : "<<<INTERNAL ERROR>>>") + std::string(Msg.begin() + i + 2, Msg.end()); } - } - - // Start making the div tag. + } + + // Create the html for the message. std::ostringstream os; - os << "\n<div class=\"codeline\"><div class=\"nums\"> </div>" - << "<div class=\"lines\">"; - - for (unsigned i = 0; i < ColNo+1; ++i) - os << ' '; - - os << "</div><span class=\"msg\">"; + os << "\n<tr><td class=\"num\"></td><td class=\"line\">" + << "<div class=\"msg\" style=\"margin-left:" + << ColNo << "ex\">"; switch (DiagLevel) { default: assert(0 && "Unknown diagnostic type!"); @@ -202,15 +198,13 @@ void HTMLDiagnostic::HandleDiagnostic(Diagnostic &Diags, break; } - os << Msg; // FIXME: HTML escape "Msg" - os << "</span></div"; + os << Msg << "</div></td></tr>"; - // Insert a div tag with the warning. + // Insert the new html. const llvm::MemoryBuffer *Buf = R.getSourceMgr().getBuffer(FileID); const char* FileStart = Buf->getBufferStart(); - R.InsertStrBefore(SourceLocation::getFileLoc(FileID, LineStart - FileStart), os.str()); } |