[flang][driver] Make flang ignore -Mfree/-Mfixed

`-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.

Differential Revision: https://reviews.llvm.org/D106428
This commit is contained in:
Andrzej Warzynski 2021-07-21 09:53:01 +01:00
parent ec1fb95333
commit cad2affb78

View file

@ -210,6 +210,12 @@ categorise_opts()
[[ $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
:
elif [[ $opt =~ -I.* ]] || [[ $opt =~ -J.* ]]; then
# Options that are needed for both Flang and the external driver.
flang_opts+=($opt)