summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2008-04-24 23:37:03 +0000
committerTed Kremenek <kremenek@apple.com>2008-04-24 23:37:03 +0000
commit64fa3beccc28c4a269426de7557d9d069a8b3d20 (patch)
treeabe512a8d111e84a8f5255aa4e35c05031b09832
parentae8014cb7eb951e25962d5134c8f8cc740859af8 (diff)
downloadbcm5719-llvm-64fa3beccc28c4a269426de7557d9d069a8b3d20.tar.gz
bcm5719-llvm-64fa3beccc28c4a269426de7557d9d069a8b3d20.zip
Better handling for directory names in HTML diagnostics. Work in progress.
llvm-svn: 50234
-rw-r--r--clang/Driver/HTMLDiagnostics.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/clang/Driver/HTMLDiagnostics.cpp b/clang/Driver/HTMLDiagnostics.cpp
index c850c05a58f..3e3571c5129 100644
--- a/clang/Driver/HTMLDiagnostics.cpp
+++ b/clang/Driver/HTMLDiagnostics.cpp
@@ -162,8 +162,14 @@ void HTMLDiagnostics::ReportDiag(const PathDiagnostic& D) {
const FileEntry* Entry = SMgr.getFileEntryForID(FileID);
std::string DirName(Entry->getDir()->getName());
+ // This is a cludge; basically we want to append either the full
+ // working directory if we have no directory information. This is
+ // a work in progress.
+
if (DirName == ".")
DirName = llvm::sys::Path::GetCurrentDirectory().toString();
+ else if (llvm::sys::Path(Entry->getName()).isAbsolute())
+ DirName = "";
// Add the name of the file as an <h1> tag.
@@ -200,7 +206,7 @@ void HTMLDiagnostics::ReportDiag(const PathDiagnostic& D) {
{
std::ostringstream os;
- os << "\n<!-- BUGFILE " << DirName << "/" << Entry->getName() << " -->\n";
+ os << "\n<!-- BUGFILE " << DirName << Entry->getName() << " -->\n";
R.InsertStrBefore(SourceLocation::getFileLoc(FileID, 0), os.str());
}
OpenPOWER on IntegriCloud