]> granicus.if.org Git - clang/commitdiff
Use logical line number for BUGLINE.
authorTed Kremenek <kremenek@apple.com>
Thu, 3 Apr 2008 17:55:57 +0000 (17:55 +0000)
committerTed Kremenek <kremenek@apple.com>
Thu, 3 Apr 2008 17:55:57 +0000 (17:55 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49178 91177308-0d34-0410-b5e6-96231b3b80d8

Driver/HTMLDiagnostics.cpp

index c29096d0f68232ac7f58895ec35abfe0d7c551b3..8c89e6270a83797ac052a3f616a045c5b94cf295 100644 (file)
@@ -74,18 +74,17 @@ void HTMLDiagnostics::HandlePathDiagnostic(const PathDiagnostic& D) {
   if (D.empty())
     return;
   
-  if (!D.back()->getLocation().isFileID())
-    return;
-  
   // Create the HTML directory if it is missing.
   
   if (!createdDir) {
     createdDir = true;
-    Directory.createDirectoryOnDisk(true, NULL);
+    std::string ErrorMsg;
+    Directory.createDirectoryOnDisk(true, &ErrorMsg);
   
     if (!Directory.isDirectory()) {
       llvm::cerr << "warning: could not create directory '"
-                  << FilePrefix.toString() << "'\n";
+                 << Directory.toString() << "'\n"
+                 << "reason: " << ErrorMsg << '\n'; 
       
       noDir = true;
       
@@ -154,8 +153,7 @@ void HTMLDiagnostics::HandlePathDiagnostic(const PathDiagnostic& D) {
   
   {
     std::ostringstream os;
-    FullSourceLoc L = D.back()->getLocation();
-    os << "\n<!-- BUGLINE " << L.getLineNumber()
+    os << "\n<!-- BUGLINE " << D.back()->getLocation().getLogicalLineNumber()
        << " -->\n";
     R.InsertStrBefore(SourceLocation::getFileLoc(FileID, 0), os.str());
   }