[PATCH] D101261: [flang] Lift -Werror checks into local functions

Andrzej Warzynski via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed May 12 11:23:38 PDT 2021


awarzynski added a comment.

@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?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D101261/new/

https://reviews.llvm.org/D101261



More information about the llvm-commits mailing list