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

Ted Kremenek kremenek at apple.com
Thu Apr 3 00:13:10 PDT 2008


Author: kremenek
Date: Thu Apr  3 02:13:10 2008
New Revision: 49151

URL: http://llvm.org/viewvc/llvm-project?rev=49151&view=rev
Log:
Added guard for printing out PathDiagnostics whose last element ends with
a piece with a SourceLocation that does not have a FileID.

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=49151&r1=49150&r2=49151&view=diff

==============================================================================
--- cfe/trunk/Driver/HTMLDiagnostics.cpp (original)
+++ cfe/trunk/Driver/HTMLDiagnostics.cpp Thu Apr  3 02:13:10 2008
@@ -74,6 +74,9 @@
   if (D.empty())
     return;
   
+  if (!D.back()->getLocation().isFileID())
+    return;
+  
   // Create the HTML directory if it is missing.
   
   if (!createdDir) {
@@ -151,7 +154,8 @@
   
   {
     std::ostringstream os;
-    os << "\n<!-- BUGLINE " << D.back()->getLocation().getLineNumber()
+    FullSourceLoc L = D.back()->getLocation();
+    os << "\n<!-- BUGLINE " << L.getLineNumber()
        << " -->\n";
     R.InsertStrBefore(SourceLocation::getFileLoc(FileID, 0), os.str());
   }





More information about the cfe-commits mailing list