This is an archive of the discontinued LLVM Phabricator instance.

[Flang][Driver] Add location and remark option printing to R_Group Diagnostics
ClosedPublic

Authored by victorkingi on Aug 31 2023, 1:52 AM.

Details

Summary

For each R_Group diagnostic produced, this patch gives more
information about it by printing the absolute file path,
the line and column number the pass was applied to and finally
the remark option that was used.

Clang does the same with the exception of printing the relative
path rather than absolute path.

Depends on D159260. That patch adds support for backend passes
while this patch adds remark options to the backend test cases.

Diff Detail

Event Timeline

victorkingi created this revision.Aug 31 2023, 1:52 AM
Herald added projects: Restricted Project, Restricted Project. · View Herald Transcript
victorkingi requested review of this revision.Aug 31 2023, 1:52 AM

Makes, made a few suggestions, thanks!

flang/lib/Frontend/FrontendActions.cpp
962

[nit] sourceMgr is a concept from Clang. Could you please clarify a bit for folks who only work with Flang. Something as simple as "Clang has X, Flang does not. Use this instead" would be OK.

flang/lib/Frontend/TextDiagnosticPrinter.cpp
111–140

Any chance for this to be a seperate function?

victorkingi updated this revision to Diff 554966.EditedAug 31 2023, 3:51 AM
victorkingi marked an inline comment as done.

Moved absolute path printing to a function in TextDiagnosticPrinter.cpp
Replaced std::string with llvm::StringRef
Clarified comment in emitOptimizationMessage concerning SourceManager

Added warning option to invalid remark tests

added remark option to optimization-remark-backend.f90 test cases

no changes, rebasing

victorkingi marked an inline comment as done.Aug 31 2023, 7:32 AM
awarzynski accepted this revision.Aug 31 2023, 7:38 AM

LGTM, thanks!

flang/lib/Frontend/FrontendActions.cpp
962–967
This revision is now accepted and ready to land.Aug 31 2023, 7:38 AM
victorkingi marked an inline comment as done.

minor comment edit