llvm-project/flang/lib
Andrzej Warzynski e5cdb6c56e [flang][driver] Add support for `-c` and `-emit-obj`
This patch adds a frontend action for emitting object files. While Flang
does not support code-generation, this action remains a placeholder.
This patch simply provides glue-code to connect the compiler driver
with the appropriate frontend action.

The new action is triggered with the `-c` compiler driver flag, i.e.
`flang-new -c`. This is then translated to `flang-new -fc1 -emit-obj`,
so `-emit-obj` has to be marked as supported as well.

As code-generation is not available yet, `flang-new -c` results in a
driver error:
```
error: code-generation is not available yet
```
Hopefully this will help communicating the level of available
functionality within Flang.

The definition of `emit-obj` is updated so that it can be shared between
Clang and Flang. As the original definition was enclosed within a
Clang-specific TableGen `let` statement, it is extracted into a new `let`
statement. That felt like the cleanest option.

I also commented out `-triple` in Flang::ConstructJob and updated some
comments there. This is similar to https://reviews.llvm.org/D93027. I
wanted to make sure that it's clear that we can't support `-triple`
until we have code-generation. However, once code-generation is
available we _will need_ `-triple`.

As this patch adds `-emit-obj`, the emit-obj.f90 becomes irrelevant and
is deleted. Instead, phases.f90 is added to demonstrate that users can
control compilation phases (indeed, `-c` is a phase control flag).

Reviewed By: SouraVX, clementval

Differential Revision: https://reviews.llvm.org/D93301
2021-01-07 10:52:38 +00:00
..
Common [flang] Use the Flang cmake-functions to add targets. 2020-04-16 15:51:30 +01:00
Decimal [flang] Readability improvement in binary->decimal conversion 2020-10-01 15:49:27 -07:00
Evaluate [flang] Fix crash in folding (#48437) 2020-12-16 07:55:44 -08:00
Frontend [flang][driver] Add support for `-c` and `-emit-obj` 2021-01-07 10:52:38 +00:00
FrontendTool [flang][driver] Add support for `-c` and `-emit-obj` 2021-01-07 10:52:38 +00:00
Lower [Flang][openmp][3/5] Make ProcBind clause part of OmpClause 2020-12-22 13:40:38 +05:30
Optimizer [mlir] Remove the MutableDictionaryAttr class 2020-12-17 17:18:42 -08:00
Parser [flang][openmp] Make Reduction clause part of OmpClause 2021-01-04 15:19:00 -05:00
Semantics [flang][openmp] Make Reduction clause part of OmpClause 2021-01-04 15:19:00 -05:00
CMakeLists.txt [flang][driver] Add the new flang compiler and frontend drivers 2020-09-11 10:55:54 +01:00