@@ -299,7 +299,8 @@ std::string timeTraceName(const BugReportEquivClass &EQ) {
299299 return (" Flushing EQC " + BT.getDescription ()).str ();
300300}
301301
302- llvm::TimeTraceMetadata timeTraceMetadata (const BugReportEquivClass &EQ) {
302+ llvm::TimeTraceMetadata timeTraceMetadata (const BugReportEquivClass &EQ,
303+ const SourceManager &SM) {
303304 // Must be called only when constructing non-bogus TimeTraceScope
304305 assert (llvm::timeTraceProfilerEnabled ());
305306
@@ -309,9 +310,7 @@ llvm::TimeTraceMetadata timeTraceMetadata(const BugReportEquivClass &EQ) {
309310 const BugReport *R = BugReports.front ().get ();
310311 const auto &BT = R->getBugType ();
311312 auto Loc = R->getLocation ().asLocation ();
312- std::string File = " " ;
313- if (const auto *Entry = Loc.getFileEntry ())
314- File = Entry->tryGetRealPathName ().str ();
313+ std::string File = SM.getFilename (Loc).str ();
315314 return {BT.getCheckerName ().str (), std::move (File),
316315 static_cast <int >(Loc.getLineNumber ())};
317316}
@@ -3150,8 +3149,9 @@ BugReport *PathSensitiveBugReporter::findReportInEquivalenceClass(
31503149}
31513150
31523151void BugReporter::FlushReport (BugReportEquivClass &EQ) {
3153- llvm::TimeTraceScope TCS{timeTraceName (EQ),
3154- [&EQ]() { return timeTraceMetadata (EQ); }};
3152+ llvm::TimeTraceScope TCS{timeTraceName (EQ), [&]() {
3153+ return timeTraceMetadata (EQ, getSourceManager ());
3154+ }};
31553155 SmallVector<BugReport*, 10 > bugReports;
31563156 BugReport *report = findReportInEquivalenceClass (EQ, bugReports);
31573157 if (!report)
0 commit comments