summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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