All Fortran options should be set in CompilerInvocation before any of
FrontendActions is entered - that's the job of the driver. However, this
is a bit tricky with fixed and....free from detection introduced in
https://reviews.llvm.org/D94228.
Basically, fixed-free form detection needs to happen:
- separately for every input file (we might be compiling multiple Fortran files, some in free form, some in fixed form)
- before any frontend action (we need to specify isFixedForm in Fortran::parser::Options first)
In other words, we need this to happen early (before any
FrontendAction), but not too early (we need to know what the current
input file is). Ideally we would be able to set all Fortran options in
one place, but currently that's not possible.
All changes in this patch are NFCs (hence no new tests). Below is a
- move fixed/free form detection from FrontendAction::ExecuteAction to CompilerInstance::ExecuteAction
- add a bool flag in FrontendInputFile to mark a file as fixed/free form
- updated a few comments