RFC: new Flang driver - next steps

Hello all,

We have been busy prototyping the new Flang driver [1] and investigating how to best re-use the goodness already available in Clang [2]. Earlier today we've sent a refined design of the Flang driver to cfe-dev [3]. That RFC focuses on what changes are required in Clang in order for us to be able to share that infrastructure without Flang depending on Clang. In this email we would like to discuss the next steps for the new Flang driver from the perspective of Flang.

If the Clang community finds our design feasible and is happy with the refactoring that we proposed, we will start working on that immediately. We are also keen to get early feedback from the Flang community and would like to start upstreaming our prototype driver [1] into Flang at the same time. This would inform the refactoring of Clang and guarantee that the integration goes smoothly. We also feel that this would allow us to parallelize the implementation a bit better.

The main drawback of this approach is that we need to introduce a dependency on Clang in the interim. We propose the following _temporary_ workaround for this:
* the new Flang driver will be guarded with a CMake flag (i.e. it will only be build conditionally)
* the same CMake flag will guard any Clang dependencies (i.e. by default Flang will not depend on Clang)
* we will set-up a dedicated build-bot for the new Flang driver to avoid and to catch early any breakage

Once the refactoring in Clang is complete, this workaround can be removed. The former boils down to making libclangDriver independent of Clang and moving it out of Clang (please see [3] for more details) and looks much less involved than we originally thought.

Your feedback is much appreciated.

Last, but not least, we'll need some help reviewing the patches as they come back to master. If anyone is interested in helping here please shout out!

Andrzej Warzynski
On behalf of the Arm Fortran Team

[1] https://github.com/banach-space/llvm-project
[2] http://lists.llvm.org/pipermail/llvm-dev/2020-June/141994.html
[3] http://lists.llvm.org/pipermail/cfe-dev/2020-July/066393.html