]> granicus.if.org Git - clang/commitdiff
Better handling for directory names in HTML diagnostics. Work in progress.
authorTed Kremenek <kremenek@apple.com>
Thu, 24 Apr 2008 23:37:03 +0000 (23:37 +0000)
committerTed Kremenek <kremenek@apple.com>
Thu, 24 Apr 2008 23:37:03 +0000 (23:37 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50234 91177308-0d34-0410-b5e6-96231b3b80d8

Driver/HTMLDiagnostics.cpp

index c850c05a58f7fc52c947d8878fed28776f1190cb..3e3571c5129348c793e931be611186ccec574f20 100644 (file)
@@ -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());
   }