Files
compiler-explorer/lib/compilers
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
..
2024-01-21 10:43:20 -06:00
2023-11-30 00:38:42 +01:00
2023-06-23 12:21:28 +02:00
2023-11-04 20:01:43 +01:00
2023-12-10 14:19:43 -06:00
2023-11-01 00:06:47 +01:00
2023-03-17 19:01:39 +01:00
2023-05-16 03:53:57 +02:00
2023-11-20 22:04:57 -06:00
2023-07-19 13:53:30 -04:00
2024-01-28 18:50:46 -06:00
2024-01-28 18:50:46 -06:00
2023-12-03 11:34:25 -05:00
2023-11-27 22:17:26 -06:00
2023-06-19 20:26:15 -05:00
2023-05-16 03:53:57 +02:00
2023-11-30 00:36:54 +01:00
2023-06-23 12:21:28 +02:00
2023-06-11 17:00:53 -04:00
2023-06-26 20:28:09 -04:00
2023-05-16 03:53:57 +02:00
2023-07-07 00:24:48 +02:00
2023-08-09 13:06:06 +02:00
2023-03-11 14:18:04 -06:00
2023-01-29 13:22:30 -05:00
2023-06-11 17:00:53 -04:00
2023-06-11 17:00:53 -04:00
2023-06-11 17:00:53 -04:00
2023-05-16 03:53:57 +02:00
2023-06-18 15:21:50 -04:00
2023-11-04 20:01:43 +01:00
2023-06-11 17:00:53 -04:00
2023-08-17 16:08:28 -05:00
2024-01-28 18:50:46 -06:00
2024-01-21 10:43:20 -06:00
2023-05-16 03:53:57 +02:00