Lift checks for -Werror into local functions.
Details
Details
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Comment Actions
Notice that in PrescanAndSemaAction, the first check fails with a scanning error, and the second with a parsing error. This is not the case for PrescanAndParseAction, which makes me think the second check should fail with a parsing error, and the tests should be adjusted in the same way.
Comment Actions
@ashermancinelli , I had a quick look and I believe that this is what you had in mind (with a test):
diff --git a/flang/lib/Frontend/FrontendActions.cpp b/flang/lib/Frontend/FrontendActions.cpp index 1dcb6e0a16be..ba738170e1e0 100644 --- a/flang/lib/Frontend/FrontendActions.cpp +++ b/flang/lib/Frontend/FrontendActions.cpp @@ -106,7 +106,7 @@ bool PrescanAndParseAction::BeginSourceFileAction(CompilerInstance &c1) { // Parse. In case of failure, report and return. ci.parsing().Parse(llvm::outs()); - if (reportFatalScanningErrors(this)) + if (reportFatalParsingErrors(this)) return false; // Report the diagnostics from parsing diff --git a/flang/test/Driver/parse-error.f95 b/flang/test/Driver/parse-error.f95 index 00126047e6df..cdcde0ee47f6 100644 --- a/flang/test/Driver/parse-error.f95 +++ b/flang/test/Driver/parse-error.f95 @@ -1,5 +1,8 @@ -! Verify that parsing errors are correctly reported by the driver +! Verify that parsing errors are correctly reported by the driver. Currently this test focuses on actions inheriting from: +! * PrescanAndSemaAction (-fsyntax-only) +! * PrescanAndParseAction (-fdebug-unparse-no-sema) +! RUN: not %flang_fc1 -fdebug-unparse-no-sema %s 2>&1 | FileCheck %s --check-prefix=ERROR ! RUN: not %flang_fc1 -fsyntax-only %s 2>&1 | FileCheck %s --check-prefix=ERROR ! ERROR: Could not parse {{.*}}parse-error.f95
The updated test won't pass without the change in FrontendActions.cpp that you suggested earlier. Does this make sense?
Comment Actions
LGTM
Apologies for not getting back to this earlier and thanks again for working on this!