As per the RFC in http://lists.llvm.org/pipermail/cfe-dev/2019-June/062669.html.
This patch adds a new Flang mode. When in Flang mode, the driver will
invoke flang for fortran inputs instead of falling back to the GCC
toolchain as it would otherwise do.
The behaviour of other driver modes are left unmodified to preserve
It is intended that a soon to be implemented binary in the flang project
will import libclangDriver and run the clang driver in the new flang
Please note that since the binary invoked by the driver is under
development, there will no doubt be further tweaks necessary in future
- Initial support is added for basic driver phases
- -E, -fsyntax-only, -emit-llvm -S, -emit-llvm, -S, (none specified)
- -### tests are added for all of the above
- This is more than is supported by f18 so far, which will emit errors for those options which are unimplemented.
- A test is added that ensures that clang gives a reasonable error message if flang is not available in the path (without -###).
- Test that the driver accepts multiple inputs in --driver-mode=flang.
- Test that a combination of C and Fortran inputs run both clang and flang in --driver-mode=flang.
- clang/test/Driver/fortran.f95 is fixed to use the correct fortran comment character.