[flang-commits] [flang] 548549e - [flang][f18] Make -fdebug-dump-{symbols|parse-tree} imply -fsyntax-only
Andrzej Warzynski via flang-commits
flang-commits at lists.llvm.org
Tue Feb 16 01:23:15 PST 2021
Author: Andrzej Warzynski
Date: 2021-02-16T09:22:32Z
New Revision: 548549e88ac4a1908206b888be24592e1dbcc38f
URL: https://github.com/llvm/llvm-project/commit/548549e88ac4a1908206b888be24592e1dbcc38f
DIFF: https://github.com/llvm/llvm-project/commit/548549e88ac4a1908206b888be24592e1dbcc38f.diff
LOG: [flang][f18] Make -fdebug-dump-{symbols|parse-tree} imply -fsyntax-only
The following _action_ options are always used with `-fsyntax-only`
(also an _action_ option):
* -fdebug-dump-symbols
* -fdebug-dump-parse-tree
This patch makes the above options imply `-fsyntax-only`.
>From the perspective of `f18` this change saves typing and is otherwise
a non-functional change. But it will simplify things in the new driver,
`flang-new`, in which only the last action option is taken into account
and executed. In other words, the following would only run
`-fsyntax-only`:
```
flang-new -fdebug-dump-symbols -fsyntax-only <input>
```
whereas this would only run `-fdebug-dump-symbols`:
```
flang-new -fsyntax-only -fdebug-dump-symbols <input>
```
Differential Revision: https://reviews.llvm.org/D96528
Added:
Modified:
flang/test/Evaluate/test_folding.sh
flang/test/Semantics/data05.f90
flang/test/Semantics/data08.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/resolve100.f90
flang/test/Semantics/rewrite01.f90
flang/test/Semantics/typeinfo01.f90
flang/tools/f18/f18.cpp
Removed:
################################################################################
diff --git a/flang/test/Evaluate/test_folding.sh b/flang/test/Evaluate/test_folding.sh
index 951ef36ecd2c..74ca9c820ffe 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 -fsyntax-only"
+CMD="$* -fdebug-dump-symbols"
# Check if tests should assume folding is using libpgmath
if [[ $LIBPGMATH ]]; then
diff --git a/flang/test/Semantics/data05.f90 b/flang/test/Semantics/data05.f90
index f3c7aa9be6e3..31d68b33a060 100644
--- a/flang/test/Semantics/data05.f90
+++ b/flang/test/Semantics/data05.f90
@@ -1,4 +1,4 @@
-!RUN: %f18 -fdebug-dump-symbols -fsyntax-only %s | FileCheck %s
+!RUN: %f18 -fdebug-dump-symbols %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 4040ac8e148d..e9f53c147ae9 100644
--- a/flang/test/Semantics/data08.f90
+++ b/flang/test/Semantics/data08.f90
@@ -1,4 +1,4 @@
-! RUN: %f18 -fdebug-dump-symbols -fsyntax-only %s 2>&1 | FileCheck %s
+! RUN: %f18 -fdebug-dump-symbols %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/offsets01.f90 b/flang/test/Semantics/offsets01.f90
index 78183d5cc0fc..394f6a7461f7 100644
--- a/flang/test/Semantics/offsets01.f90
+++ b/flang/test/Semantics/offsets01.f90
@@ -1,4 +1,4 @@
-!RUN: %f18 -fdebug-dump-symbols -fsyntax-only %s | FileCheck %s
+!RUN: %f18 -fdebug-dump-symbols %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 b76572e1761d..99a156e3c288 100644
--- a/flang/test/Semantics/offsets02.f90
+++ b/flang/test/Semantics/offsets02.f90
@@ -1,4 +1,4 @@
-!RUN: %f18 -fdebug-dump-symbols -fsyntax-only %s | FileCheck %s
+!RUN: %f18 -fdebug-dump-symbols %s | FileCheck %s
! Size and alignment of derived types
diff --git a/flang/test/Semantics/offsets03.f90 b/flang/test/Semantics/offsets03.f90
index c1c2de464a01..f578cb7e19c3 100644
--- a/flang/test/Semantics/offsets03.f90
+++ b/flang/test/Semantics/offsets03.f90
@@ -1,4 +1,4 @@
-!RUN: %f18 -fdebug-dump-symbols -fsyntax-only %s | FileCheck %s
+!RUN: %f18 -fdebug-dump-symbols %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 b78869ff4d90..b02ded3efc77 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 -fsyntax-only %s 2>&1 | FileCheck %s
+! RUN: %f18 -falternative-parameter-statement -fdebug-dump-symbols %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 fd58988ba0b0..aff489272986 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 -fsyntax-only %s 2>&1 | FileCheck %s
+! RUN: not %f18 -falternative-parameter-statement -fdebug-dump-symbols %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/resolve100.f90 b/flang/test/Semantics/resolve100.f90
index 52fca54b94f7..98d67d99e73f 100644
--- a/flang/test/Semantics/resolve100.f90
+++ b/flang/test/Semantics/resolve100.f90
@@ -1,4 +1,4 @@
-!RUN: %f18 -fdebug-dump-symbols -fsyntax-only %s | FileCheck %s
+!RUN: %f18 -fdebug-dump-symbols %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 cd5453eee6be..a189d4417f5d 100644
--- a/flang/test/Semantics/rewrite01.f90
+++ b/flang/test/Semantics/rewrite01.f90
@@ -1,4 +1,4 @@
-! RUN: %f18 -fsyntax-only -fdebug-dump-parse-tree %s 2>&1 | FileCheck %s
+! RUN: %f18 -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/typeinfo01.f90 b/flang/test/Semantics/typeinfo01.f90
index 2274896fcd68..3575aca6e7a1 100644
--- a/flang/test/Semantics/typeinfo01.f90
+++ b/flang/test/Semantics/typeinfo01.f90
@@ -1,4 +1,4 @@
-!RUN: %f18 -fdebug-dump-symbols -fsyntax-only %s | FileCheck %s
+!RUN: %f18 -fdebug-dump-symbols %s | FileCheck %s
! Tests for derived type runtime descriptions
module m01
diff --git a/flang/tools/f18/f18.cpp b/flang/tools/f18/f18.cpp
index f9bf3e39e751..7960403726d5 100644
--- a/flang/tools/f18/f18.cpp
+++ b/flang/tools/f18/f18.cpp
@@ -526,10 +526,12 @@ int main(int argc, char *const argv[]) {
options.needProvenanceRangeToCharBlockMappings = true;
} else if (arg == "-fdebug-dump-parse-tree") {
driver.dumpParseTree = true;
+ driver.syntaxOnly = true;
} else if (arg == "-fdebug-pre-fir-tree") {
driver.dumpPreFirTree = true;
} else if (arg == "-fdebug-dump-symbols") {
driver.dumpSymbols = true;
+ driver.syntaxOnly = true;
} else if (arg == "-fdebug-module-writer") {
driver.debugModuleWriter = true;
} else if (arg == "-fdebug-measure-parse-tree") {
More information about the flang-commits
mailing list