This is an archive of the discontinued LLVM Phabricator instance.

[flang][driver] Report prescanning diags during syntax-only parsing
ClosedPublic

Authored by FarisRehman on Jan 22 2021, 4:26 AM.

Details

Summary

Ensure diagnostics from the prescanner are reported when running flang-new -fsyntax-only (i.e. only syntax parsing).
This keeps the diagnostics output of flang-new consistent with f18 -fparse-only when running the syntax parsing action, ParseSyntaxOnlyAction.

Summary of changes:

  • Modify ParseSyntaxOnlyAction::ExecuteAction to report diagnostics

Diff Detail

Event Timeline

FarisRehman created this revision.Jan 22 2021, 4:26 AM
FarisRehman requested review of this revision.Jan 22 2021, 4:26 AM
Herald added a project: Restricted Project. · View Herald TranscriptJan 22 2021, 4:26 AM
FarisRehman added a project: Restricted Project.
awarzynski added inline comments.Jan 22 2021, 7:35 AM
flang/test/Frontend/prescanner-diag.f90
3

In this test we want to make sure that f18 and flang-new behave similarly in the context of generating diagnostics. As per our spreadsheet:

  • flang-new -fsyntax-only and
  • f18 -fparse-only

should behave similarly. Could you add RUN line with f18 -parse-only?

FarisRehman edited the summary of this revision. (Show Details)Jan 25 2021, 4:52 AM

Add f18 RUN line

Address review comment by @awarzynski

Summary of changes:

  • Add a RUN line for f18 -fparse-only to the regression test
FarisRehman marked an inline comment as done.Jan 25 2021, 6:17 AM
awarzynski accepted this revision.Jan 26 2021, 5:42 AM

Thank you for working on this @FarisRehman ! LGTM

flang/test/Frontend/prescanner-diag.f90
3

[nit] Currently there's only one "preprocessor" action, but there are likely to be more in the future. So this might become ambiguous.

I suggest either PrintPreprocessedAction or Test with -E (i.e. PrintPreprocessedAction, stops after prescanning) and Test with -fsyntax-only (i.e. ParseSyntaxOnlyAction, stops after semantic checks)

This revision is now accepted and ready to land.Jan 26 2021, 5:42 AM
This revision was landed with ongoing or failed builds.Jan 27 2021, 2:27 AM
This revision was automatically updated to reflect the committed changes.