aboutsummaryrefslogtreecommitdiff
path: root/Driver/HTMLDiagnostics.cpp
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2008-05-02 22:04:53 +0000
committerTed Kremenek <kremenek@apple.com>2008-05-02 22:04:53 +0000
commit7a4648df321be70bb009a8dc56e0162c3f13c18c (patch)
tree3a3f1637bbe79c2d3fe6760ebfca5baac4d22710 /Driver/HTMLDiagnostics.cpp
parent57c99347c56b786a67291146e9c1ff992386c9dc (diff)
Output better paths to display in bug reports and compute a common
prefix for all files. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50592 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'Driver/HTMLDiagnostics.cpp')
-rw-r--r--Driver/HTMLDiagnostics.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/Driver/HTMLDiagnostics.cpp b/Driver/HTMLDiagnostics.cpp
index cb333b978c..22e2538482 100644
--- a/Driver/HTMLDiagnostics.cpp
+++ b/Driver/HTMLDiagnostics.cpp
@@ -160,16 +160,17 @@ void HTMLDiagnostics::ReportDiag(const PathDiagnostic& D) {
// Get the full directory name of the analyzed file.
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 = "";
+ std::string DirName = "";
+
+ if (!llvm::sys::Path(Entry->getName()).isAbsolute()) {
+ llvm::sys::Path P = llvm::sys::Path::GetCurrentDirectory();
+ DirName = P.toString() + "/";
+ }
// Add the name of the file as an <h1> tag.