Files
David Spickett 238aecd870 flang: Enable llvm-ir viewer for flang-new (#6046)
flang supports the -emit-llvm option but the difference from clang is
that while clang allows `-Xclang -emit-llvm`, flang does not allow
`-Xflang -emit-llvm`. Instead we need to use `-emit-llvm` alone.

This is a deliberate choice by the flang driver to make sure the user
isn't asking the compiler to do 2 things at once. In this case assemble
and emit llvm IR.

The way compiler explorer calls clang, the IR ends up not in the `-o`
file path but in a file named after the input file but with the
extension `.ll`. For flang we will get the IR in the file specified by
`-o`.

To handle this I've copied code from ISPCCompiler which does the same
thing. We could dedupe this, but I'm not sure whether it's worth it
while we have only 2 compilers doing this.

(clang supports `clang ... -emit-llvm` as well, so perhaps the flang
style could become the majority mode eventually)

Final note, flang-to-external-fc could support this with changes but
users are better off just using flang-new, the result is the same (as
flang-to-external-fc doesn't advertise -emit-llvm, it won't be
selectable anyway).
2024-02-03 22:27:29 +02:00
..
2023-07-23 13:39:31 -05:00
2023-11-27 10:33:03 -05:00
2023-08-15 22:16:36 -05:00
2023-07-10 21:31:04 -05:00
2023-11-11 16:48:32 +01:00
2023-06-06 21:17:25 -05:00
2022-12-14 20:44:26 -06:00
2024-01-28 18:50:46 -06:00
2023-05-16 03:53:57 +02:00