[PATCH] D45611: [analyzer] Fix filename in cross-file HTML report

Malcolm Parsons via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed May 2 07:29:53 PDT 2018


This revision was automatically updated to reflect the committed changes.
Closed by commit rC331361: [analyzer] Fix filename in cross-file HTML report (authored by malcolm.parsons, committed by ).

Changed prior to commit:
  https://reviews.llvm.org/D45611?vs=144742&id=144881#toc

Repository:
  rC Clang

https://reviews.llvm.org/D45611

Files:
  lib/StaticAnalyzer/Core/HTMLDiagnostics.cpp
  test/Coverage/html-multifile-diagnostics.c


Index: test/Coverage/html-multifile-diagnostics.c
===================================================================
--- test/Coverage/html-multifile-diagnostics.c
+++ test/Coverage/html-multifile-diagnostics.c
@@ -4,6 +4,8 @@
 
 // REQUIRES: staticanalyzer
 
+// CHECK: <!-- FILENAME html-multifile-diagnostics.h -->
+
 // CHECK: <h3>Annotated Source Code</h3>
 
 // Make sure it's generated as multi-file HTML output
Index: lib/StaticAnalyzer/Core/HTMLDiagnostics.cpp
===================================================================
--- lib/StaticAnalyzer/Core/HTMLDiagnostics.cpp
+++ lib/StaticAnalyzer/Core/HTMLDiagnostics.cpp
@@ -321,7 +321,9 @@
     return {};
 
   // Add CSS, header, and footer.
-  const FileEntry* Entry = SMgr.getFileEntryForID(FileIDs[0]);
+  FileID FID =
+      path.back()->getLocation().asLocation().getExpansionLoc().getFileID();
+  const FileEntry* Entry = SMgr.getFileEntryForID(FID);
   FinalizeHTML(D, R, SMgr, path, FileIDs[0], Entry, declName);
 
   std::string file;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D45611.144881.patch
Type: text/x-patch
Size: 1010 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20180502/16e8e3f0/attachment.bin>


More information about the cfe-commits mailing list