diff options
author | Ted Kremenek <kremenek@apple.com> | 2009-08-03 23:44:55 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2009-08-03 23:44:55 +0000 |
commit | 3724cdef3f737ab4aa65da1d16fc7f26cae38068 (patch) | |
tree | 464e5319dde2bbdbb90a657b41cebd0bf8022a7a /clang/lib/Frontend/HTMLDiagnostics.cpp | |
parent | 3ddfff98a0e95b6cc33fa7659e3e8ad9bc9b7bb8 (diff) | |
download | bcm5719-llvm-3724cdef3f737ab4aa65da1d16fc7f26cae38068.tar.gz bcm5719-llvm-3724cdef3f737ab4aa65da1d16fc7f26cae38068.zip |
Emit a special 'BUGMETAEND' comment to aid in the postprocessing of HTML bug reports.
llvm-svn: 78021
Diffstat (limited to 'clang/lib/Frontend/HTMLDiagnostics.cpp')
-rw-r--r-- | clang/lib/Frontend/HTMLDiagnostics.cpp | 59 |
1 files changed, 20 insertions, 39 deletions
diff --git a/clang/lib/Frontend/HTMLDiagnostics.cpp b/clang/lib/Frontend/HTMLDiagnostics.cpp index 160da7c0973..9b86755538f 100644 --- a/clang/lib/Frontend/HTMLDiagnostics.cpp +++ b/clang/lib/Frontend/HTMLDiagnostics.cpp @@ -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()); |