This is an archive of the discontinued LLVM Phabricator instance.

[Flang][Driver] Add warning support for invalid R_Group options
ClosedPublic

Authored by victorkingi on Aug 23 2023, 4:05 AM.

Details

Summary

With the R_Group options, invalid values e.g. '-Rpa' will not emit
a warning like clang. This patch enables warning reporting, as
well as suggestions on what option the user intended to select.

Depends on D158174 and D158436. The former, adds backend
support to R_Group options while the latter, implements
regex support with some tests refactoring that cause a merge
conflict.

Diff Detail

Event Timeline

victorkingi created this revision.Aug 23 2023, 4:05 AM
Herald added projects: Restricted Project, Restricted Project. · View Herald Transcript
victorkingi requested review of this revision.Aug 23 2023, 4:05 AM

Makes, just some minor suggestions.

flang/lib/FrontendTool/ExecuteCompilerInvocation.cpp
137–144
flang/test/Driver/optimization-remark.f90
14–18 ↗(On Diff #552654)

I would move all the tests that check for invalid usage into a dedicated test file, e.g. optimization-remark-invalid.f90.

victorkingi marked an inline comment as done.

Moved warning test cases from optimization-remark.f90 to
optimization-remark-invalid.f90
Added suggested comment to ExecuteCompilerInvocation.cpp

victorkingi marked an inline comment as done.Aug 29 2023, 7:34 AM
awarzynski accepted this revision.Aug 29 2023, 12:39 PM

LGTM, thanks!

This revision is now accepted and ready to land.Aug 29 2023, 12:39 PM
victorkingi edited the summary of this revision. (Show Details)Aug 30 2023, 3:48 AM
victorkingi edited the summary of this revision. (Show Details)

no changes, rebasing

no changes, rebasing

This revision was landed with ongoing or failed builds.Aug 31 2023, 5:09 AM
This revision was automatically updated to reflect the committed changes.