[flang-commits] [flang] 41f4d47 - [flang] Make `flang` translate `-M{fixed|free}` into `-f{fixed|free}-form`

Andrzej Warzynski via flang-commits flang-commits at lists.llvm.org
Mon Aug 9 10:06:47 PDT 2021


Author: Andrzej Warzynski
Date: 2021-08-09T18:06:09+01:00
New Revision: 41f4d47484db69848d3cd65fc7f81237b17bdfd4

URL: https://github.com/llvm/llvm-project/commit/41f4d47484db69848d3cd65fc7f81237b17bdfd4
DIFF: https://github.com/llvm/llvm-project/commit/41f4d47484db69848d3cd65fc7f81237b17bdfd4.diff

LOG: [flang] Make `flang` translate `-M{fixed|free}` into `-f{fixed|free}-form`

We are only adding this in `flang` - the bash wrapper script for the
driver. We don't have any specific plans to support `-M{fixed|free}` in
`flang-new` (i.e. the actual driver).

That feature was requested by one of our users.

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

Added: 
    

Modified: 
    flang/tools/f18/flang

Removed: 
    


################################################################################
diff  --git a/flang/tools/f18/flang b/flang/tools/f18/flang
index bdd00f58e3945..7e1832265a2ce 100755
--- a/flang/tools/f18/flang
+++ b/flang/tools/f18/flang
@@ -209,11 +209,22 @@ categorise_opts()
       [[ $opt == "-Werror" ]]; then
       flang_opts+=($opt)
     elif
-      # These options are not supported by `flang-new`. There is also no point
-      # in forwarding them to the host compiler as the output from
-      # `-fdebug-unparse` will always be in free form.
+      # We translate the following into equivalents understood by `flang-new`
       [[ $opt == "-Mfixed" ]] || [[ $opt == "-Mfree" ]]; then
-      :
+        case $opt in
+          -Mfixed)
+            flang_opts+=("-ffixed-form")
+          ;;
+
+          -Mfree)
+            flang_opts+=("-ffree-form")
+          ;;
+
+        *)
+          echo "ERROR: $opt has no equivalent in 'flang-new'"
+          exit 1
+          ;;
+      esac
     elif
       # Options that are needed for both Flang and the external driver.
       [[ $opt =~ -I.* ]] ||


        


More information about the flang-commits mailing list