Julia is based on LLVM like other toolchains supported by Compiler
Explorer, and it can emit LLVM IR, but at the moment we only expose it
via the flag `--format=llvm` to the compiler wrapper.
With this PR we add a proper LLVM IR viewer, like the other LLVM-based
toolchains. We add a new option for the wrapper to emit the entire LLVM
module, which has the benefit of being parsable by Compiler Explorer, so
that we can automatically filter out debug information and metadata
annotations.
Preview (from
https://github.com/compiler-explorer/compiler-explorer/issues/4597#issuecomment-2018956112):

We removed the custom `<[source code line] [number of output lines]
[function name] [method types]>` line in the output of the `code_*`
functions, together with the custom ASM parsing, because they invalidate
the output (it isn't valid ASM nor LLVM), and create more problems than
they solve.
This PR was prepared in collaboration with @vchuravy.
This should eventually address #4597, once inlined LLVM functions are
handled by the IR parser in Compiler Explorer, I think @vchuravy can
comment more on that issue.
---------
Co-authored-by: Valentin Churavy <v.churavy@gmail.com>
… parametric methods
If the code contains a method, specializing a function that is defined
in a different module (e.g. Base), then the method would be ignored.
The `names` function offers the `imported` parameter, which leads to
inclusion of imported functions. However, this also leads to inclusion
of many methods that are not defined in the given code. To only consider
the methods from the input code, the input module `m` is passed to the
method searching call `methods(fun, m)`.
While debugging, another bug surfaced: methods with parametric types
would lead to an error, because the type for these methods is
represented differently. In this cases, `specTypes` is of type
`UnionAll`, which does not have a member `parameters`, but the members
`var` and `body` to represent the parametric structure of the type. Also
see https://docs.julialang.org/en/v1/devdocs/types/#UnionAll-types By
checking the `specType` member for the type `UnionAll`, this can be
fixed.
Fixes#5752
Co-authored-by: Alex Wiens <alex.wiens@uni-paderborn.de>