[PATCH] D106428: [flang][driver] Make `flang` ignore `-Mfree/-Mfixed`

Andrzej Warzynski via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 21 02:09:23 PDT 2021


awarzynski created this revision.
Herald added a reviewer: sscalpone.
awarzynski requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

`-Mfixed` is not supported by the new driver and hence
`flang`, the bash wrapper script, forwards it to the host compiler.
The forwarded options are used by the host compiler when compiling the
unparsed files. As the unparsed source files are always in the free
form, forwarding `-Mfixed` is problematic.

With this patch, `-Mfixed` (and `-Mfree` for consistency) will be
ignored altogether. The user will only see a warning. This is not a
particularly sound approach, but `flang` is only a temporary solution
for us and this workaround is a fair compromise.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D106428

Files:
  flang/tools/f18/flang.in


Index: flang/tools/f18/flang.in
===================================================================
--- flang/tools/f18/flang.in
+++ flang/tools/f18/flang.in
@@ -210,6 +210,12 @@
       [[ $opt =~ ^-U.* ]] ||
       [[ $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.
+      [[ $opt == "-Mfixed" ]] || [[ $opt == "-Mfree" ]]; then
+      echo "WARNING: $opt is not supported and will be ignored"
     elif [[ $opt =~ -I.* ]] || [[ $opt =~ -J.* ]]; then
       # Options that are needed for both Flang and the external driver.
       flang_opts+=($opt)


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D106428.360394.patch
Type: text/x-patch
Size: 770 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210721/f7ed494d/attachment.bin>


More information about the llvm-commits mailing list