[flang-commits] [flang] 34eb0ad - [flang] Add -fsyntax-only to f18; retain -fparse-only synonym

peter klausler via flang-commits flang-commits at lists.llvm.org
Wed Feb 3 09:01:56 PST 2021


Author: peter klausler
Date: 2021-02-03T09:01:39-08:00
New Revision: 34eb0adaa9cd76f5bb0549f5a32d6ef452fe977e

URL: https://github.com/llvm/llvm-project/commit/34eb0adaa9cd76f5bb0549f5a32d6ef452fe977e
DIFF: https://github.com/llvm/llvm-project/commit/34eb0adaa9cd76f5bb0549f5a32d6ef452fe977e.diff

LOG: [flang] Add -fsyntax-only to f18; retain -fparse-only synonym

Now that semantics is working, the standard -fsyntax-only option of
GNU and Clang should be used as the name of the option that causes
f18 to just run the front-end.  Support both options in f18, silently
accepting the old option as a synonym for the new one (as
preferred by the code owner), and replace all instances of the
old -fparse-only option with -fsyntax-only throughout the source base.

Differential Revision: https://reviews.llvm.org/D95887

Added: 
    

Modified: 
    flang/docs/ImplementingASemanticCheck.md
    flang/docs/Overview.md
    flang/test/Evaluate/test_folding.sh
    flang/test/Flang-Driver/parse-error.f95
    flang/test/Flang-Driver/syntax-only.f90
    flang/test/Frontend/prescanner-diag.f90
    flang/test/Lower/pre-fir-tree01.f90
    flang/test/Lower/pre-fir-tree02.f90
    flang/test/Lower/pre-fir-tree03.f90
    flang/test/Lower/pre-fir-tree04.f90
    flang/test/Lower/pre-fir-tree05.f90
    flang/test/Semantics/call17.f90
    flang/test/Semantics/data05.f90
    flang/test/Semantics/data08.f90
    flang/test/Semantics/data09.f90
    flang/test/Semantics/empty.f90
    flang/test/Semantics/final02.f90
    flang/test/Semantics/getdefinition01.f90
    flang/test/Semantics/getdefinition02.f
    flang/test/Semantics/getdefinition03-a.f90
    flang/test/Semantics/getdefinition04.f90
    flang/test/Semantics/getdefinition05.f90
    flang/test/Semantics/getsymbols01.f90
    flang/test/Semantics/getsymbols02.f90
    flang/test/Semantics/getsymbols03-a.f90
    flang/test/Semantics/getsymbols04.f90
    flang/test/Semantics/getsymbols05.f90
    flang/test/Semantics/missing_newline.f90
    flang/test/Semantics/mod-file-rewriter.f90
    flang/test/Semantics/modifiable01.f90
    flang/test/Semantics/offsets01.f90
    flang/test/Semantics/offsets02.f90
    flang/test/Semantics/offsets03.f90
    flang/test/Semantics/oldparam01.f90
    flang/test/Semantics/oldparam02.f90
    flang/test/Semantics/oldparam03.f90
    flang/test/Semantics/resolve100.f90
    flang/test/Semantics/rewrite01.f90
    flang/test/Semantics/test_errors.sh
    flang/test/Semantics/test_modfile.sh
    flang/test/Semantics/typeinfo01.f90
    flang/tools/f18-parse-demo/f18-parse-demo.cpp
    flang/tools/f18/CMakeLists.txt
    flang/tools/f18/f18.cpp

Removed: 
    


################################################################################
diff  --git a/flang/docs/ImplementingASemanticCheck.md b/flang/docs/ImplementingASemanticCheck.md
index 35b107e4988e..4a6fe133f21f 100644
--- a/flang/docs/ImplementingASemanticCheck.md
+++ b/flang/docs/ImplementingASemanticCheck.md
@@ -67,7 +67,7 @@ of the call to `intentOutFunc()`:
 
 I also used this program to produce a parse tree for the program using the command:
 ```bash
-  f18 -fdebug-dump-parse-tree -fparse-only testfun.f90
+  f18 -fdebug-dump-parse-tree -fsyntax-only testfun.f90
 ```
 
 Here's the relevant fragment of the parse tree produced by the compiler:

diff  --git a/flang/docs/Overview.md b/flang/docs/Overview.md
index 987858943845..4ef04f865083 100644
--- a/flang/docs/Overview.md
+++ b/flang/docs/Overview.md
@@ -46,7 +46,7 @@ See: [Preprocessing.md](Preprocessing.md).
 **Entry point:** `parser::Parsing::Parse`
 
 **Command:**
-  - `f18 -fdebug-dump-parse-tree -fparse-only src.f90` dumps the parse tree
+  - `f18 -fdebug-dump-parse-tree -fsyntax-only src.f90` dumps the parse tree
   - `f18 -funparse src.f90` converts the parse tree to normalized Fortran
 
 ## Validate Labels and Canonicalize Do Statements
@@ -74,7 +74,7 @@ See: [Preprocessing.md](Preprocessing.md).
 
 **Entry points:** `semantics::ResolveNames`, `semantics::RewriteParseTree`
 
-**Command:** `f18 -fdebug-dump-symbols -fparse-only src.f90` dumps the
+**Command:** `f18 -fdebug-dump-symbols -fsyntax-only src.f90` dumps the
   tree of scopes and symbols in each scope
 
 ## Check DO CONCURRENT Constraints

diff  --git a/flang/test/Evaluate/test_folding.sh b/flang/test/Evaluate/test_folding.sh
index 81ecbea55274..951ef36ecd2c 100755
--- a/flang/test/Evaluate/test_folding.sh
+++ b/flang/test/Evaluate/test_folding.sh
@@ -32,7 +32,7 @@ temp=$1
 mkdir -p $temp
 shift
 
-CMD="$* -fdebug-dump-symbols -fparse-only"
+CMD="$* -fdebug-dump-symbols -fsyntax-only"
 
 # Check if tests should assume folding is using libpgmath
 if [[ $LIBPGMATH ]]; then

diff  --git a/flang/test/Flang-Driver/parse-error.f95 b/flang/test/Flang-Driver/parse-error.f95
index 84a63665659d..8266d042df02 100644
--- a/flang/test/Flang-Driver/parse-error.f95
+++ b/flang/test/Flang-Driver/parse-error.f95
@@ -1,5 +1,5 @@
 ! RUN: not %flang-new -fc1 -fsyntax-only %s 2>&1 | FileCheck %s --check-prefix=ERROR
-! RUN: not %f18 -parse-only %s 2>&1 | FileCheck %s --check-prefix=ERROR
+! RUN: not %f18 -syntax-only %s 2>&1 | FileCheck %s --check-prefix=ERROR
 
 ! REQUIRES: new-flang-driver
 

diff  --git a/flang/test/Flang-Driver/syntax-only.f90 b/flang/test/Flang-Driver/syntax-only.f90
index f04dd713aeab..0eed3cca2fe9 100644
--- a/flang/test/Flang-Driver/syntax-only.f90
+++ b/flang/test/Flang-Driver/syntax-only.f90
@@ -1,5 +1,5 @@
 ! RUN: not %flang-new -fc1 -fsyntax-only %s 2>&1 | FileCheck %s
-! RUN: not %f18 -fparse-only %s 2>&1 | FileCheck %s
+! RUN: not %f18 -fsyntax-only %s 2>&1 | FileCheck %s
 
 ! REQUIRES: new-flang-driver
 

diff  --git a/flang/test/Frontend/prescanner-diag.f90 b/flang/test/Frontend/prescanner-diag.f90
index 4c7e6e369beb..26536092b41b 100644
--- a/flang/test/Frontend/prescanner-diag.f90
+++ b/flang/test/Frontend/prescanner-diag.f90
@@ -6,7 +6,7 @@
 ! RUN: %flang-new -fc1 -E -I %S/Inputs/ %s 2>&1 | FileCheck %s
 
 ! Test with -fsyntax-only (i.e. ParseSyntaxOnlyAction, stops after semantic checks)
-! RUN: %f18 -fparse-only -I %S/Inputs/ %s 2>&1 | FileCheck %s
+! RUN: %f18 -fsyntax-only -I %S/Inputs/ %s 2>&1 | FileCheck %s
 ! RUN: %flang-new -fsyntax-only -I %S/Inputs/ %s 2>&1 | FileCheck %s
 ! RUN: %flang-new -fc1 -fsyntax-only -I %S/Inputs/ %s 2>&1 | FileCheck %s
 

diff  --git a/flang/test/Lower/pre-fir-tree01.f90 b/flang/test/Lower/pre-fir-tree01.f90
index 6b27add4659f..5e59ff784f97 100644
--- a/flang/test/Lower/pre-fir-tree01.f90
+++ b/flang/test/Lower/pre-fir-tree01.f90
@@ -1,4 +1,4 @@
-! RUN: %f18 -fdebug-pre-fir-tree -fparse-only %s | FileCheck %s
+! RUN: %f18 -fdebug-pre-fir-tree -fsyntax-only %s | FileCheck %s
 
 ! Test structure of the Pre-FIR tree
 

diff  --git a/flang/test/Lower/pre-fir-tree02.f90 b/flang/test/Lower/pre-fir-tree02.f90
index 2d50a9394985..1db49605d98d 100644
--- a/flang/test/Lower/pre-fir-tree02.f90
+++ b/flang/test/Lower/pre-fir-tree02.f90
@@ -1,4 +1,4 @@
-! RUN: %f18 -fdebug-pre-fir-tree -fparse-only %s | FileCheck %s
+! RUN: %f18 -fdebug-pre-fir-tree -fsyntax-only %s | FileCheck %s
 
 ! Test Pre-FIR Tree captures all the intended nodes from the parse-tree
 ! Coarray and OpenMP related nodes are tested in other files.

diff  --git a/flang/test/Lower/pre-fir-tree03.f90 b/flang/test/Lower/pre-fir-tree03.f90
index 1c8651b64f83..efc923a3fe84 100644
--- a/flang/test/Lower/pre-fir-tree03.f90
+++ b/flang/test/Lower/pre-fir-tree03.f90
@@ -1,4 +1,4 @@
-! RUN: %f18 -fdebug-pre-fir-tree -fparse-only -fopenmp %s | FileCheck %s
+! RUN: %f18 -fdebug-pre-fir-tree -fsyntax-only -fopenmp %s | FileCheck %s
 
 ! Test Pre-FIR Tree captures OpenMP related constructs
 

diff  --git a/flang/test/Lower/pre-fir-tree04.f90 b/flang/test/Lower/pre-fir-tree04.f90
index 34212fbb1ff0..3f2beaf5fb47 100644
--- a/flang/test/Lower/pre-fir-tree04.f90
+++ b/flang/test/Lower/pre-fir-tree04.f90
@@ -1,4 +1,4 @@
-! RUN: %f18 -fdebug-pre-fir-tree -fparse-only %s | FileCheck %s
+! RUN: %f18 -fdebug-pre-fir-tree -fsyntax-only %s | FileCheck %s
 
 ! Test Pre-FIR Tree captures all the coarray related statements
 

diff  --git a/flang/test/Lower/pre-fir-tree05.f90 b/flang/test/Lower/pre-fir-tree05.f90
index 98af5c2de944..3acc38b20d35 100644
--- a/flang/test/Lower/pre-fir-tree05.f90
+++ b/flang/test/Lower/pre-fir-tree05.f90
@@ -1,4 +1,4 @@
-! RUN: %f18 -fdebug-pre-fir-tree -fparse-only -fopenacc %s | FileCheck %s
+! RUN: %f18 -fdebug-pre-fir-tree -fsyntax-only -fopenacc %s | FileCheck %s
 
 ! Test structure of the Pre-FIR tree with OpenACC construct
 

diff  --git a/flang/test/Semantics/call17.f90 b/flang/test/Semantics/call17.f90
index 1f4d2c4d9186..ace626037dd8 100644
--- a/flang/test/Semantics/call17.f90
+++ b/flang/test/Semantics/call17.f90
@@ -1,4 +1,4 @@
-! RUN: %f18 -fparse-only $s 2>&1 | FileCheck %s
+! RUN: %f18 -fsyntax-only $s 2>&1 | FileCheck %s
 
 ! Regression test: don't emit a bogus error about an invalid specification expression
 ! in the declaration of a binding

diff  --git a/flang/test/Semantics/data05.f90 b/flang/test/Semantics/data05.f90
index a138b067942e..f3c7aa9be6e3 100644
--- a/flang/test/Semantics/data05.f90
+++ b/flang/test/Semantics/data05.f90
@@ -1,4 +1,4 @@
-!RUN: %f18 -fdebug-dump-symbols -fparse-only %s | FileCheck %s
+!RUN: %f18 -fdebug-dump-symbols -fsyntax-only %s | FileCheck %s
 module m
   interface
     integer function ifunc(n)

diff  --git a/flang/test/Semantics/data08.f90 b/flang/test/Semantics/data08.f90
index 86a87f90163f..4040ac8e148d 100644
--- a/flang/test/Semantics/data08.f90
+++ b/flang/test/Semantics/data08.f90
@@ -1,4 +1,4 @@
-! RUN: %f18 -fdebug-dump-symbols -fparse-only %s 2>&1 | FileCheck %s
+! RUN: %f18 -fdebug-dump-symbols -fsyntax-only %s 2>&1 | FileCheck %s
 ! CHECK: DATA statement value initializes 'jx' of type 'INTEGER(4)' with CHARACTER
 ! CHECK: DATA statement value initializes 'jy' of type 'INTEGER(4)' with CHARACTER
 ! CHECK: DATA statement value initializes 'jz' of type 'INTEGER(4)' with CHARACTER

diff  --git a/flang/test/Semantics/data09.f90 b/flang/test/Semantics/data09.f90
index 1550787b0d4c..4510b830ef7f 100644
--- a/flang/test/Semantics/data09.f90
+++ b/flang/test/Semantics/data09.f90
@@ -1,4 +1,4 @@
-! RUN: %f18 -fparse-only -fdebug-dump-symbols %s 2>&1 | FileCheck %s
+! RUN: %f18 -fsyntax-only -fdebug-dump-symbols %s 2>&1 | FileCheck %s
 ! CHECK: init:[INTEGER(4)::1065353216_4,1073741824_4,1077936128_4,1082130432_4]
 ! Verify that the closure of EQUIVALENCE'd symbols with any DATA
 ! initialization produces a combined initializer.

diff  --git a/flang/test/Semantics/empty.f90 b/flang/test/Semantics/empty.f90
index e47c2e65342c..ff8f64258741 100644
--- a/flang/test/Semantics/empty.f90
+++ b/flang/test/Semantics/empty.f90
@@ -1,4 +1,4 @@
-! RUN: %f18 -fparse-only %s
+! RUN: %f18 -fsyntax-only %s
 ! RUN: rm -rf %t && mkdir %t
 ! RUN: touch %t/empty.f90
-! RUN: %f18 -fparse-only %t/empty.f90
+! RUN: %f18 -fsyntax-only %t/empty.f90

diff  --git a/flang/test/Semantics/final02.f90 b/flang/test/Semantics/final02.f90
index b58f91f3a228..f613a4228481 100644
--- a/flang/test/Semantics/final02.f90
+++ b/flang/test/Semantics/final02.f90
@@ -1,4 +1,4 @@
-!RUN: %f18 -fparse-only %s 2>&1 | FileCheck %s
+!RUN: %f18 -fsyntax-only %s 2>&1 | FileCheck %s
 module m
   type :: t1
     integer :: n

diff  --git a/flang/test/Semantics/getdefinition01.f90 b/flang/test/Semantics/getdefinition01.f90
index 57141b671754..06f2cc0f8dda 100644
--- a/flang/test/Semantics/getdefinition01.f90
+++ b/flang/test/Semantics/getdefinition01.f90
@@ -16,12 +16,12 @@ recursive pure function f() result(x)
 end module
 
 ! RUN and CHECK lines at the bottom as this test is sensitive to line numbers
-! RUN: %f18 -fget-definition 6 17 18 -fparse-only %s | FileCheck --check-prefix=CHECK1 %s
-! RUN: %f18 -fget-definition 7 20 23 -fparse-only %s | FileCheck --check-prefix=CHECK2 %s
-! RUN: %f18 -fget-definition 14 3 4 -fparse-only %s | FileCheck --check-prefix=CHECK3 %s
+! RUN: %f18 -fget-definition 6 17 18 -fsyntax-only %s | FileCheck --check-prefix=CHECK1 %s
+! RUN: %f18 -fget-definition 7 20 23 -fsyntax-only %s | FileCheck --check-prefix=CHECK2 %s
+! RUN: %f18 -fget-definition 14 3 4 -fsyntax-only %s | FileCheck --check-prefix=CHECK3 %s
 ! CHECK1: x:{{.*}}getdefinition01.f90, 5, 21-22
 ! CHECK2: yyy:{{.*}}getdefinition01.f90, 5, 24-27
 ! CHECK3: x:{{.*}}getdefinition01.f90, 13, 24-25
 
-! RUN: not %f18 -fget-definition -fparse-only %s 2>&1 | FileCheck --check-prefix=CHECK-ERROR %s
+! RUN: not %f18 -fget-definition -fsyntax-only %s 2>&1 | FileCheck --check-prefix=CHECK-ERROR %s
 ! CHECK-ERROR: Invalid argument to -fget-definitions

diff  --git a/flang/test/Semantics/getdefinition02.f b/flang/test/Semantics/getdefinition02.f
index ee7a96750da5..b32536968dc0 100644
--- a/flang/test/Semantics/getdefinition02.f
+++ b/flang/test/Semantics/getdefinition02.f
@@ -17,9 +17,9 @@ recursive pure function f() result(x)
       end module
 
 ! RUN and CHECK lines here as test is sensitive to line numbers
-! RUN: %f18 -fget-definition 7 9 10 -fparse-only %s 2>&1 | FileCheck --check-prefix=CHECK1 %s
-! RUN: %f18 -fget-definition 8 26 29 -fparse-only %s 2>&1 | FileCheck --check-prefix=CHECK2 %s
-! RUN: %f18 -fget-definition 15 9 10 -fparse-only %s 2>&1 | FileCheck --check-prefix=CHECK3 %s
+! RUN: %f18 -fget-definition 7 9 10 -fsyntax-only %s 2>&1 | FileCheck --check-prefix=CHECK1 %s
+! RUN: %f18 -fget-definition 8 26 29 -fsyntax-only %s 2>&1 | FileCheck --check-prefix=CHECK2 %s
+! RUN: %f18 -fget-definition 15 9 10 -fsyntax-only %s 2>&1 | FileCheck --check-prefix=CHECK3 %s
 ! CHECK1: x:{{.*}}getdefinition02.f, 5, 27-28
 ! CHECK2: yyy:{{.*}}getdefinition02.f, 5, 30-33
 ! CHECK3: x:{{.*}}getdefinition02.f, 14, 30-31

diff  --git a/flang/test/Semantics/getdefinition03-a.f90 b/flang/test/Semantics/getdefinition03-a.f90
index ecf8c9b48389..6e61637b3546 100644
--- a/flang/test/Semantics/getdefinition03-a.f90
+++ b/flang/test/Semantics/getdefinition03-a.f90
@@ -7,7 +7,7 @@ program main
  x = f
 end program
 
-! RUN: %f18 -fget-definition 7 6 7 -fparse-only %s | FileCheck --check-prefix=CHECK1 %s
-! RUN: %f18 -fget-definition 7 2 3 -fparse-only %s | FileCheck --check-prefix=CHECK2 %s
+! RUN: %f18 -fget-definition 7 6 7 -fsyntax-only %s | FileCheck --check-prefix=CHECK1 %s
+! RUN: %f18 -fget-definition 7 2 3 -fsyntax-only %s | FileCheck --check-prefix=CHECK2 %s
 ! CHECK1: f:{{.*}}getdefinition03-b.f90, 2, 12-13
 ! CHECK2: x:{{.*}}getdefinition03-a.f90, 6, 13-14

diff  --git a/flang/test/Semantics/getdefinition04.f90 b/flang/test/Semantics/getdefinition04.f90
index 72429599595b..bc01f7979b42 100644
--- a/flang/test/Semantics/getdefinition04.f90
+++ b/flang/test/Semantics/getdefinition04.f90
@@ -6,5 +6,5 @@ program main
   x = y
 end program
 
-! RUN: %f18 -fget-definition 6 3 4 -fparse-only %s | FileCheck %s
+! RUN: %f18 -fget-definition 6 3 4 -fsyntax-only %s | FileCheck %s
 ! CHECK: x:{{.*}}getdefinition04.f90, 3, 14-15

diff  --git a/flang/test/Semantics/getdefinition05.f90 b/flang/test/Semantics/getdefinition05.f90
index 315e9570d352..91952bb7fcc3 100644
--- a/flang/test/Semantics/getdefinition05.f90
+++ b/flang/test/Semantics/getdefinition05.f90
@@ -12,8 +12,8 @@ program main
 end program
 
 !! Inner x
-! RUN: %f18 -fget-definition 9 5 6 -fparse-only %s | FileCheck --check-prefix=CHECK1 %s
+! RUN: %f18 -fget-definition 9 5 6 -fsyntax-only %s | FileCheck --check-prefix=CHECK1 %s
 ! CHECK1: x:{{.*}}getdefinition05.f90, 7, 16-17
 !! Outer y
-! RUN: %f18 -fget-definition 11 7 8 -fparse-only %s | FileCheck --check-prefix=CHECK2 %s
+! RUN: %f18 -fget-definition 11 7 8 -fsyntax-only %s | FileCheck --check-prefix=CHECK2 %s
 ! CHECK2: y:{{.*}}getdefinition05.f90, 5, 14-15

diff  --git a/flang/test/Semantics/getsymbols01.f90 b/flang/test/Semantics/getsymbols01.f90
index bdb7bf053823..d26aa774ace4 100644
--- a/flang/test/Semantics/getsymbols01.f90
+++ b/flang/test/Semantics/getsymbols01.f90
@@ -15,7 +15,7 @@ recursive pure function f() result(x)
  end function
 end module
 
-! RUN: %f18 -fget-symbols-sources -fparse-only %s 2>&1 | FileCheck %s
+! RUN: %f18 -fget-symbols-sources -fsyntax-only %s 2>&1 | FileCheck %s
 ! CHECK-COUNT-1:f:{{.*}}getsymbols01.f90, 12, 26-27
 ! CHECK-COUNT-1:mm1:{{.*}}getsymbols01.f90, 2, 8-11
 ! CHECK-COUNT-1:s:{{.*}}getsymbols01.f90, 5, 18-19

diff  --git a/flang/test/Semantics/getsymbols02.f90 b/flang/test/Semantics/getsymbols02.f90
index 0119ab16daa8..1667548f81c3 100644
--- a/flang/test/Semantics/getsymbols02.f90
+++ b/flang/test/Semantics/getsymbols02.f90
@@ -7,8 +7,8 @@ PROGRAM helloworld
     i = callget5()
 ENDPROGRAM
 
-! RUN: %f18 -fparse-only %S/Inputs/getsymbols02-a.f90
-! RUN: %f18 -fparse-only %S/Inputs/getsymbols02-b.f90
-! RUN: %f18 -fget-symbols-sources -fparse-only %s 2>&1 | FileCheck %s
+! RUN: %f18 -fsyntax-only %S/Inputs/getsymbols02-a.f90
+! RUN: %f18 -fsyntax-only %S/Inputs/getsymbols02-b.f90
+! RUN: %f18 -fget-symbols-sources -fsyntax-only %s 2>&1 | FileCheck %s
 ! CHECK: callget5: .{{[/\\]}}mm2b.mod,
 ! CHECK: get5: .{{[/\\]}}mm2a.mod,

diff  --git a/flang/test/Semantics/getsymbols03-a.f90 b/flang/test/Semantics/getsymbols03-a.f90
index 3cbba425d875..fddf513bcc51 100644
--- a/flang/test/Semantics/getsymbols03-a.f90
+++ b/flang/test/Semantics/getsymbols03-a.f90
@@ -7,7 +7,7 @@ program main
  x = f
 end program
 
-! RUN: %f18 -fget-symbols-sources -fparse-only %s 2>&1 | FileCheck %s
+! RUN: %f18 -fget-symbols-sources -fsyntax-only %s 2>&1 | FileCheck %s
 ! CHECK:f:{{.*}}getsymbols03-b.f90, 2, 12-13
 ! CHECK:main:{{.*}}getsymbols03-a.f90, 4, 9-13
 ! CHECK:mm3:{{.*}}getsymbols03-a.f90, 5, 6-9

diff  --git a/flang/test/Semantics/getsymbols04.f90 b/flang/test/Semantics/getsymbols04.f90
index fc9b177abd90..ac8f2d0a7e44 100644
--- a/flang/test/Semantics/getsymbols04.f90
+++ b/flang/test/Semantics/getsymbols04.f90
@@ -6,7 +6,7 @@ program main
   x = y
 end program
 
-! RUN: %f18 -fget-symbols-sources -fparse-only %s 2>&1 | FileCheck %s
+! RUN: %f18 -fget-symbols-sources -fsyntax-only %s 2>&1 | FileCheck %s
 ! CHECK:x:{{.*}}getsymbols04.f90, 3, 14-15
 ! CHECK:x:{{.*}}getsymbols04.f90, 5, 11-12
 ! CHECK:y:{{.*}}getsymbols04.f90, 4, 14-15

diff  --git a/flang/test/Semantics/getsymbols05.f90 b/flang/test/Semantics/getsymbols05.f90
index 624f37a74b76..6b07678e42d0 100644
--- a/flang/test/Semantics/getsymbols05.f90
+++ b/flang/test/Semantics/getsymbols05.f90
@@ -9,7 +9,7 @@ program main
   x = y
 end program
 
-! RUN: %f18 -fget-symbols-sources -fparse-only %s 2>&1 | FileCheck %s
+! RUN: %f18 -fget-symbols-sources -fsyntax-only %s 2>&1 | FileCheck %s
 ! CHECK:x:{{.*}}getsymbols05.f90, 3, 14-15
 ! CHECK:x:{{.*}}getsymbols05.f90, 6, 16-17
 ! CHECK:y:{{.*}}getsymbols05.f90, 4, 14-15

diff  --git a/flang/test/Semantics/missing_newline.f90 b/flang/test/Semantics/missing_newline.f90
index 6dfafba7db86..82f9c9ceb612 100644
--- a/flang/test/Semantics/missing_newline.f90
+++ b/flang/test/Semantics/missing_newline.f90
@@ -1,4 +1,4 @@
 ! RUN: echo -n "end program" > %t.f90
-! RUN: %f18 -fparse-only %t.f90
+! RUN: %f18 -fsyntax-only %t.f90
 ! RUN: echo -ne "\rend program" > %t.f90
-! RUN: %f18 -fparse-only %t.f90
+! RUN: %f18 -fsyntax-only %t.f90

diff  --git a/flang/test/Semantics/mod-file-rewriter.f90 b/flang/test/Semantics/mod-file-rewriter.f90
index 81252910e690..2856dd6dbdf3 100644
--- a/flang/test/Semantics/mod-file-rewriter.f90
+++ b/flang/test/Semantics/mod-file-rewriter.f90
@@ -1,8 +1,8 @@
 ! RUN: rm -fr %t && mkdir %t && cd %t
-! RUN: %f18 -fparse-only -fdebug-module-writer %s 2>&1 | FileCheck %s --check-prefix CHECK_CHANGED
-! RUN: %f18 -fparse-only -fdebug-module-writer %s 2>&1 | FileCheck %s --check-prefix CHECK_UNCHANGED
-! RUN: %f18 -fparse-only -fdebug-module-writer %p/Inputs/mod-file-unchanged.f90 2>&1 | FileCheck %s --check-prefix CHECK_UNCHANGED
-! RUN: %f18 -fparse-only -fdebug-module-writer %p/Inputs/mod-file-changed.f90 2>&1 | FileCheck %s --check-prefix CHECK_CHANGED
+! RUN: %f18 -fsyntax-only -fdebug-module-writer %s 2>&1 | FileCheck %s --check-prefix CHECK_CHANGED
+! RUN: %f18 -fsyntax-only -fdebug-module-writer %s 2>&1 | FileCheck %s --check-prefix CHECK_UNCHANGED
+! RUN: %f18 -fsyntax-only -fdebug-module-writer %p/Inputs/mod-file-unchanged.f90 2>&1 | FileCheck %s --check-prefix CHECK_UNCHANGED
+! RUN: %f18 -fsyntax-only -fdebug-module-writer %p/Inputs/mod-file-changed.f90 2>&1 | FileCheck %s --check-prefix CHECK_CHANGED
 
 module m
   real :: x(10)

diff  --git a/flang/test/Semantics/modifiable01.f90 b/flang/test/Semantics/modifiable01.f90
index 391a643e3368..dfa9396565e0 100644
--- a/flang/test/Semantics/modifiable01.f90
+++ b/flang/test/Semantics/modifiable01.f90
@@ -1,4 +1,4 @@
-! RUN: not %f18 -fparse-only %s 2>&1 | FileCheck %s
+! RUN: not %f18 -fsyntax-only %s 2>&1 | FileCheck %s
 ! Test WhyNotModifiable() explanations
 
 module prot

diff  --git a/flang/test/Semantics/offsets01.f90 b/flang/test/Semantics/offsets01.f90
index f5491f7b9438..78183d5cc0fc 100644
--- a/flang/test/Semantics/offsets01.f90
+++ b/flang/test/Semantics/offsets01.f90
@@ -1,4 +1,4 @@
-!RUN: %f18 -fdebug-dump-symbols -fparse-only %s | FileCheck %s
+!RUN: %f18 -fdebug-dump-symbols -fsyntax-only %s | FileCheck %s
 
 ! Size and alignment of intrinsic types
 subroutine s1

diff  --git a/flang/test/Semantics/offsets02.f90 b/flang/test/Semantics/offsets02.f90
index f2ed1d1dbe71..b76572e1761d 100644
--- a/flang/test/Semantics/offsets02.f90
+++ b/flang/test/Semantics/offsets02.f90
@@ -1,4 +1,4 @@
-!RUN: %f18 -fdebug-dump-symbols -fparse-only %s | FileCheck %s
+!RUN: %f18 -fdebug-dump-symbols -fsyntax-only %s | FileCheck %s
 
 ! Size and alignment of derived types
 

diff  --git a/flang/test/Semantics/offsets03.f90 b/flang/test/Semantics/offsets03.f90
index d28b3694bddd..c1c2de464a01 100644
--- a/flang/test/Semantics/offsets03.f90
+++ b/flang/test/Semantics/offsets03.f90
@@ -1,4 +1,4 @@
-!RUN: %f18 -fdebug-dump-symbols -fparse-only %s | FileCheck %s
+!RUN: %f18 -fdebug-dump-symbols -fsyntax-only %s | FileCheck %s
 
 ! Size and alignment with EQUIVALENCE and COMMON
 

diff  --git a/flang/test/Semantics/oldparam01.f90 b/flang/test/Semantics/oldparam01.f90
index 43f33a52f364..b78869ff4d90 100644
--- a/flang/test/Semantics/oldparam01.f90
+++ b/flang/test/Semantics/oldparam01.f90
@@ -1,4 +1,4 @@
-! RUN: %f18 -falternative-parameter-statement -fdebug-dump-symbols -fparse-only %s 2>&1 | FileCheck %s
+! RUN: %f18 -falternative-parameter-statement -fdebug-dump-symbols -fsyntax-only %s 2>&1 | FileCheck %s
 
 ! Non-error tests for "old style" PARAMETER statements
 

diff  --git a/flang/test/Semantics/oldparam02.f90 b/flang/test/Semantics/oldparam02.f90
index 72ea5c410c7a..fd58988ba0b0 100644
--- a/flang/test/Semantics/oldparam02.f90
+++ b/flang/test/Semantics/oldparam02.f90
@@ -1,4 +1,4 @@
-! RUN: not %f18 -falternative-parameter-statement -fdebug-dump-symbols -fparse-only %s 2>&1 | FileCheck %s
+! RUN: not %f18 -falternative-parameter-statement -fdebug-dump-symbols -fsyntax-only %s 2>&1 | FileCheck %s
 
 ! Error tests for "old style" PARAMETER statements
 subroutine subr(x1,x2,x3,x4,x5)

diff  --git a/flang/test/Semantics/oldparam03.f90 b/flang/test/Semantics/oldparam03.f90
index cbdb07057226..bc80f00a1966 100644
--- a/flang/test/Semantics/oldparam03.f90
+++ b/flang/test/Semantics/oldparam03.f90
@@ -1,4 +1,4 @@
-! RUN: not %f18 -fparse-only %s 2>&1 | FileCheck %s
+! RUN: not %f18 -fsyntax-only %s 2>&1 | FileCheck %s
 
 ! Ensure that old-style PARAMETER statements are disabled by default.
 

diff  --git a/flang/test/Semantics/resolve100.f90 b/flang/test/Semantics/resolve100.f90
index 1e84be24c5f2..52fca54b94f7 100644
--- a/flang/test/Semantics/resolve100.f90
+++ b/flang/test/Semantics/resolve100.f90
@@ -1,4 +1,4 @@
-!RUN: %f18 -fdebug-dump-symbols -fparse-only %s | FileCheck %s
+!RUN: %f18 -fdebug-dump-symbols -fsyntax-only %s | FileCheck %s
 
 program p
   ! CHECK: a size=4 offset=0: ObjectEntity type: LOGICAL(4)

diff  --git a/flang/test/Semantics/rewrite01.f90 b/flang/test/Semantics/rewrite01.f90
index 221994593422..cd5453eee6be 100644
--- a/flang/test/Semantics/rewrite01.f90
+++ b/flang/test/Semantics/rewrite01.f90
@@ -1,4 +1,4 @@
-! RUN: %f18 -fparse-only -fdebug-dump-parse-tree %s 2>&1 | FileCheck %s
+! RUN: %f18 -fsyntax-only -fdebug-dump-parse-tree %s 2>&1 | FileCheck %s
 ! Ensure that READ(CVAR) [, item-list] is corrected when CVAR is a
 ! character variable so as to be a formatted read from the default
 ! unit, not an unformatted read from an internal unit (which is not

diff  --git a/flang/test/Semantics/test_errors.sh b/flang/test/Semantics/test_errors.sh
index 5411482e4d3b..10feccb2f9f1 100755
--- a/flang/test/Semantics/test_errors.sh
+++ b/flang/test/Semantics/test_errors.sh
@@ -2,7 +2,7 @@
 # Compile a source file and check errors against those listed in the file.
 # Change the compiler by setting the F18 environment variable.
 
-F18_OPTIONS="-fparse-only"
+F18_OPTIONS="-fsyntax-only"
 srcdir=$(dirname $0)
 source $srcdir/common.sh
 [[ ! -f $src ]] && die "File not found: $src"

diff  --git a/flang/test/Semantics/test_modfile.sh b/flang/test/Semantics/test_modfile.sh
index 9205451c176d..a2aef65a101b 100755
--- a/flang/test/Semantics/test_modfile.sh
+++ b/flang/test/Semantics/test_modfile.sh
@@ -2,7 +2,7 @@
 # Compile a source file and compare generated .mod files against expected.
 
 set -e
-F18_OPTIONS="-fdebug-resolve-names -fparse-only"
+F18_OPTIONS="-fdebug-resolve-names -fsyntax-only"
 srcdir=$(dirname $0)
 source $srcdir/common.sh
 

diff  --git a/flang/test/Semantics/typeinfo01.f90 b/flang/test/Semantics/typeinfo01.f90
index 834120ccb430..2274896fcd68 100644
--- a/flang/test/Semantics/typeinfo01.f90
+++ b/flang/test/Semantics/typeinfo01.f90
@@ -1,4 +1,4 @@
-!RUN: %f18 -fdebug-dump-symbols -fparse-only %s | FileCheck %s
+!RUN: %f18 -fdebug-dump-symbols -fsyntax-only %s | FileCheck %s
 ! Tests for derived type runtime descriptions
 
 module m01

diff  --git a/flang/tools/f18-parse-demo/f18-parse-demo.cpp b/flang/tools/f18-parse-demo/f18-parse-demo.cpp
index 4ccc65e0631d..2033ef6c3bc2 100644
--- a/flang/tools/f18-parse-demo/f18-parse-demo.cpp
+++ b/flang/tools/f18-parse-demo/f18-parse-demo.cpp
@@ -87,7 +87,7 @@ struct DriverOptions {
   bool warnOnNonstandardUsage{false}; // -Mstandard
   bool warningsAreErrors{false}; // -Werror
   Fortran::parser::Encoding encoding{Fortran::parser::Encoding::LATIN_1};
-  bool parseOnly{false};
+  bool syntaxOnly{false};
   bool dumpProvenance{false};
   bool dumpCookedChars{false};
   bool dumpUnparse{false};
@@ -217,7 +217,7 @@ std::string CompileFortran(
             Fortran::common::LanguageFeature::BackslashEscapes));
     return {};
   }
-  if (driver.parseOnly) {
+  if (driver.syntaxOnly) {
     return {};
   }
 
@@ -369,8 +369,8 @@ int main(int argc, char *const argv[]) {
       driver.dumpUnparse = true;
     } else if (arg == "-ftime-parse") {
       driver.timeParse = true;
-    } else if (arg == "-fparse-only") {
-      driver.parseOnly = true;
+    } else if (arg == "-fparse-only" || arg == "-fsyntax-only") {
+      driver.syntaxOnly = true;
     } else if (arg == "-c") {
       driver.compileOnly = true;
     } else if (arg == "-o") {
@@ -405,7 +405,7 @@ int main(int argc, char *const argv[]) {
           << "  -ed                  enable fixed form D lines\n"
           << "  -E                   prescan & preprocess only\n"
           << "  -ftime-parse         measure parsing time\n"
-          << "  -fparse-only         parse only, no output except messages\n"
+          << "  -fsyntax-only        parse only, no output except messages\n"
           << "  -funparse            parse & reformat only, no code "
              "generation\n"
           << "  -fdump-provenance    dump the provenance table (no code)\n"

diff  --git a/flang/tools/f18/CMakeLists.txt b/flang/tools/f18/CMakeLists.txt
index 2e5350aecdc6..41237fe06003 100644
--- a/flang/tools/f18/CMakeLists.txt
+++ b/flang/tools/f18/CMakeLists.txt
@@ -46,7 +46,7 @@ foreach(filename ${MODULES})
     set(depends ${include}/__fortran_builtins.mod)
   endif()
   add_custom_command(OUTPUT ${include}/${filename}.mod
-    COMMAND f18 -fparse-only -I${include}
+    COMMAND f18 -fsyntax-only -I${include}
       ${FLANG_SOURCE_DIR}/module/${filename}.f90
     WORKING_DIRECTORY ${include}
     DEPENDS f18 ${FLANG_SOURCE_DIR}/module/${filename}.f90 ${depends}

diff  --git a/flang/tools/f18/f18.cpp b/flang/tools/f18/f18.cpp
index fecd37d49936..4546353fe010 100644
--- a/flang/tools/f18/f18.cpp
+++ b/flang/tools/f18/f18.cpp
@@ -92,7 +92,7 @@ struct DriverOptions {
   bool warningsAreErrors{false}; // -Werror
   bool byteswapio{false}; // -byteswapio
   Fortran::parser::Encoding encoding{Fortran::parser::Encoding::UTF_8};
-  bool parseOnly{false};
+  bool syntaxOnly{false};
   bool dumpProvenance{false};
   bool dumpCookedChars{false};
   bool dumpUnparse{false};
@@ -327,7 +327,7 @@ std::string CompileFortran(std::string path, Fortran::parser::Options options,
       exitStatus = EXIT_FAILURE;
     }
   }
-  if (driver.parseOnly) {
+  if (driver.syntaxOnly) {
     return {};
   }
 
@@ -544,8 +544,8 @@ int main(int argc, char *const argv[]) {
       driver.dumpUnparseWithSymbols = true;
     } else if (arg == "-funparse-typed-exprs-to-f18-fc") {
       driver.unparseTypedExprsToF18_FC = true;
-    } else if (arg == "-fparse-only") {
-      driver.parseOnly = true;
+    } else if (arg == "-fparse-only" || arg == "-fsyntax-only") {
+      driver.syntaxOnly = true;
     } else if (arg == "-c") {
       driver.compileOnly = true;
     } else if (arg == "-o") {
@@ -649,7 +649,7 @@ int main(int argc, char *const argv[]) {
           << "  -module dir          module output directory (default .)\n"
           << "  -flatin              interpret source as Latin-1 (ISO 8859-1) "
              "rather than UTF-8\n"
-          << "  -fparse-only         parse only, no output except messages\n"
+          << "  -fsyntax-only        parsing and semantics only, no output except messages\n"
           << "  -funparse            parse & reformat only, no code "
              "generation\n"
           << "  -funparse-with-symbols  parse, resolve symbols, and unparse\n"


        


More information about the flang-commits mailing list