This patch adds support for -save-temps in flang-new, Flang's
compiler driver. The semantics of this option are inherited from Clang.
The file extension for temporary Fortran preprocessed files is set to
i. This is identical to what Clang uses for C (or C++) preprocessed
files. I have tried researching what other compilers do here, but I
couldn't find any definitive answers. One GFortran thread [1] suggests
that indeed it is not clear what the right approach should be.
Normally, various phases in Clang/Flang are combined. The -save-temps
option works by forcing the compiler to run every phase separately. As
there is no integrated assembler driver in Flang, user will have to use
-save-temps together with -fno-integrated-as. Otherwise, an
invocation to the integrated assembler would be generated generated,
which is going to fail (i.e. something equivalent to clang -cc1as from
Clang).
There are no specific plans for implementing an integrated assembler for
Flang for now. One possible solution would be to share it entirely with
Clang.
nit: I noticed that this is getting rid of spaces after commas on a few lines. Is there any sense of a prior style being used in that regard?