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 | e8e019ede11579bce271bee0b2b0b543bd9833a5 (patch) | |
tree | 47eb40f689f6e7ce6a1dbd88daf640f29804464f /Driver/HTMLPrint.cpp | |
parent | 1ab09f52be88641b7b780d0bcc29aae889313098 (diff) |
Misc. cleanups to HTML printing: make code rendered using tables; add
better div positioning for messages.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48555 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'Driver/HTMLPrint.cpp')
-rw-r--r-- | Driver/HTMLPrint.cpp | 22 |
1 files changed, 8 insertions, 14 deletions
diff --git a/Driver/HTMLPrint.cpp b/Driver/HTMLPrint.cpp index 1108bc3bda..a6b90fafdf 100644 --- a/Driver/HTMLPrint.cpp +++ b/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()); } |