summaryrefslogtreecommitdiffstats
path: root/clang/lib/StaticAnalyzer/Core/HTMLDiagnostics.cpp
diff options
context:
space:
mode:
authorMalcolm Parsons <malcolm.parsons@gmail.com>2018-05-02 14:26:12 +0000
committerMalcolm Parsons <malcolm.parsons@gmail.com>2018-05-02 14:26:12 +0000
commit099e4b2a9228e83725454cbebf7b3cf80c5613f6 (patch)
tree8bf945edc913e119f36895bfbcfe3bc9b9cb7d1e /clang/lib/StaticAnalyzer/Core/HTMLDiagnostics.cpp
parent86d9f23dedf0dca149ea6d15e706f7b0de8b72ed (diff)
downloadbcm5719-llvm-099e4b2a9228e83725454cbebf7b3cf80c5613f6.tar.gz
bcm5719-llvm-099e4b2a9228e83725454cbebf7b3cf80c5613f6.zip
[analyzer] Fix filename in cross-file HTML report
Summary: The filename is currently taken from the start of the path, while the line and column are taken from the end of the path. This didn't matter until cross-file path reporting was added. Reviewers: george.karpenkov, dcoughlin, vlad.tsyrklevich Reviewed By: george.karpenkov, vlad.tsyrklevich Subscribers: xazax.hun, szepet, a.sidorin, cfe-commits Differential Revision: https://reviews.llvm.org/D45611 llvm-svn: 331361
Diffstat (limited to 'clang/lib/StaticAnalyzer/Core/HTMLDiagnostics.cpp')
-rw-r--r--clang/lib/StaticAnalyzer/Core/HTMLDiagnostics.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/clang/lib/StaticAnalyzer/Core/HTMLDiagnostics.cpp b/clang/lib/StaticAnalyzer/Core/HTMLDiagnostics.cpp
index b4e73c81e56..1cb122a536d 100644
--- a/clang/lib/StaticAnalyzer/Core/HTMLDiagnostics.cpp
+++ b/clang/lib/StaticAnalyzer/Core/HTMLDiagnostics.cpp
@@ -321,7 +321,9 @@ std::string HTMLDiagnostics::GenerateHTML(const PathDiagnostic& D, Rewriter &R,
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;
OpenPOWER on IntegriCloud