[cfe-commits] r50234 - /cfe/trunk/Driver/HTMLDiagnostics.cpp

Ted Kremenek kremenek at apple.com
Thu Apr 24 16:37:03 PDT 2008


Author: kremenek
Date: Thu Apr 24 18:37:03 2008
New Revision: 50234

URL: http://llvm.org/viewvc/llvm-project?rev=50234&view=rev
Log:
Better handling for directory names in HTML diagnostics.  Work in progress.

Modified:
    cfe/trunk/Driver/HTMLDiagnostics.cpp

Modified: cfe/trunk/Driver/HTMLDiagnostics.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/Driver/HTMLDiagnostics.cpp?rev=50234&r1=50233&r2=50234&view=diff

==============================================================================
--- cfe/trunk/Driver/HTMLDiagnostics.cpp (original)
+++ cfe/trunk/Driver/HTMLDiagnostics.cpp Thu Apr 24 18:37:03 2008
@@ -162,8 +162,14 @@
   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 @@
   
   {
     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());
   }
   





More information about the cfe-commits mailing list