Commit Graph
815 Commits
Author SHA1 Message Date
Patrick Quist d2c7a5222e Local/Remote Execution environment (#6413) 2024-05-26 22:09:01 +02:00
Ofek 42533d8dbb Stop duplicating hasXXoutput + XXoutput (#6476)
When you need to check if `XXoutput` exists, check it directly.
+some TSification in CompilationResult
2024-05-14 20:11:09 +03:00
Ofek bcb397f56b Add noUnusedLocals to tsconfig + fix the new alerts (#6396)
<!-- THIS COMMENT IS INVISIBLE IN THE FINAL PR, BUT FEEL FREE TO REMOVE
IT
Thanks for taking the time to improve CE. We really appreciate it.
Before opening the PR, please make sure that the tests & linter pass
their checks,
  by running `make check`.
In the best case scenario, you are also adding tests to back up your
changes,
  but don't sweat it if you don't. We can discuss them at a later date.
Feel free to append your name to the CONTRIBUTORS.md file
Thanks again, we really appreciate this!
-->
2024-05-14 18:46:22 +03:00
Ofek 402c5ec890 Mark the go compiler gc as not supporting cfg (#6470)
Following #6439: mark the go compiler `gc` as not supporting cfg.
Also, don't pass argument to `isCfgCompiler` - the base-compiler
implementation uses `this.compiler.instructionSet` anyway.
2024-05-12 02:16:51 +03:00
harishch4 15bcb0ab3d Add Flang frontend driver to Fortran Compilers (#6419) 2024-05-10 20:47:29 +02:00
Ofek 0703fef51b Suggestion to update llvm-cxxfilt logic (#6451)
(1) Restore explicit specification of
`group.*.demangler=/opt/compiler-explorer/clang-trunk/bin/llvm-cxxfilt`
for all clang compiler groups, except bpf and windows.
(2) Make the ClangCompiler` constructor adjust the path of
`llvm-cxxfilt`, so that a compiler-local version is preferred, if one
exists.
(3) Pass-by update: bump the version of llvmDisassembler from clang-14
to clang-18.1.

Hopefully this addresses all demangling issues known so far.
2024-05-08 22:49:21 +03:00
kevinjeon-g 9a20419a29 Update customCwd for profman in dex2oat (#6454) 2024-05-08 21:48:45 +02:00
Jeremy abe4abd3bf Fix test break introduced inadvertently in #6422 2024-05-02 23:01:33 -05:00
ramang-unity 4fbc2d496e Fix #6301 (#6422) 2024-05-03 00:12:48 +02:00
Patrick Quist 20d29ae10b Update dex2oat.ts 2024-05-01 03:11:59 +02:00
Patrick Quist 1639d0a29a fix dex2oat profile issue 2024-05-01 03:09:43 +02:00
kevinjeon-g b94781ab48 Add profile support for dex2oat. (#6382)
dex2oat supports profile-guided compilation. In addition to taking dex
code as an input, it can take a profile as another input, to guide the
compilation. The profile determines which methods need to be compiled,
how calls can be inlined, and so on.

Because Compiler Explorer doesn't support multiple input files, the
profile is added as a comment block in the Java/Kotlin source code. A
post-processor extracts the profile from the comment block into a
separate file, in order to input it to dex2oat.
2024-04-29 20:17:24 -05:00
Filippo BarbariandRubén Rincón Blanco 9d7ad0452b Removed UseDynamicNumberOfCompilerThreads command-line argument when running on java <11 (#6397)
This fixes #6388.

---------

Co-authored-by: Rubén Rincón Blanco <git@rinconblanco.es>
2024-04-25 21:44:25 +02:00
kevinjeon-g ddefce9925 Propagate java/kotlin errors to D8 (#6374) 2024-04-20 15:24:12 +02:00
Patrick Quist b8325cf0c6 eslint root setting and fixes (#6307) 2024-04-16 21:26:53 +02:00
kevinjeon-g b4c7c3da1a Support compilation with boot image for Android (#6346)
Updates dex2oat to specify a valid boot image for accurate compilations.
For example, these two methods should now (correctly) compile to the
same native code:
```
static int insertAndReturn(int num) {
    int[] arr = {num};
    return arr[0];
}

static int justReturn(int num) {
    return num;
}
```
2024-04-13 11:40:59 -05:00
kevinjeon-g bf299d280f Update dex2oat input arguments (#6340)
Adds '--copy-dex-files=always', as it is needed in newer versions of
dex2oat. This doesn't affect older versions.
2024-04-13 10:40:28 -05:00
kevinjeon-g 137ed94704 Simplify Android compiler properties (#6334)
updates intermediate compiler exe input to refer to the compiler's
getInfo().exe so that paths don't need to be hardcoded in properties.
2024-04-13 10:35:21 -05:00
Ofek b9512ed7dd Fix Sentry Issue (#6349)
<!-- THIS COMMENT IS INVISIBLE IN THE FINAL PR, BUT FEEL FREE TO REMOVE
IT
Thanks for taking the time to improve CE. We really appreciate it.
Before opening the PR, please make sure that the tests & linter pass
their checks,
  by running `make check`.
In the best case scenario, you are also adding tests to back up your
changes,
  but don't sweat it if you don't. We can discuss them at a later date.
Feel free to append your name to the CONTRIBUTORS.md file
Thanks again, we really appreciate this!
-->
2024-04-13 12:35:00 +03:00
Mosè GiordanoandValentin Churavy 8ad1419368 [julia] Add LLVM IrView (#6285)
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):


![image](https://github.com/compiler-explorer/compiler-explorer/assets/765740/7c2f80b4-9c92-4761-9f6e-393d0ad26935)

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>
2024-04-01 22:08:35 -05:00
narpfel f5efd390fa Optionally show disambiguating hashes in demangled Rust identifiers (#6265)
Demangled Rust identifiers under the `legacy` name mangling scheme rely
on a hash to disambiguate items with the same name, such as different
monomorphisations of the same function or different closures’
`call_once` methods.

In the `v0` mangling scheme, this is no longer a problem. However,
configuring the demangler to show hashes in `legacy` names will include
crate-id hashes in `v0` names, which are [mostly
unneeded](https://rust-lang.github.io/rfcs/2603-rust-symbol-name-mangling-v0.html#appendix-a---suggested-demangling).

This PR introduces a new checkbox *Options...* → *Verbose demangling*
that lets the user select if they want to include disambiguating hashes
in demangled identifiers.

This checkbox is only shown for compilers that support verbose
demangling, and deactivated when the *Demangle identifiers* checkbox is
unchecked.

Resolves #1754.
Resolves #6255.
2024-04-01 21:58:42 -05:00
Matt Godbolt 042e2b1c02 Handle the case where clang had no buildenvsetup. Closes #6303 (#6305) 2024-03-30 15:01:19 -05:00
Oleksandr Zarudnyi 384f5f334a Integrate zksolc (#4398) 2024-03-29 23:06:33 +01:00
Patrick Quist e96b125518 Add MadPascal (#6286) 2024-03-29 02:17:52 +01:00
Ofek f664558add For clang cross-compiles with libc++, explicitly add `-I../include/x86_64… (#6277) 2024-03-25 23:31:42 +01:00
Mosè Giordano 9fe1d359ec [julia] Do not modify in-place options in runCompiler (#6281) 2024-03-25 12:02:56 +01:00
Ofek 0cdfa06d2f Allow overriding clang demangler from properties (#6228)
Specifically bpf uses group.bpf.demangler (gcc demangler)

This fix continues #6114.
2024-03-16 09:15:57 +02:00
Ofek 8dd09d1c1f Replace the deprecated substr with substring (#6236)
Just some minor homekeeping.
2024-03-10 10:04:29 +02:00
Marc Auberer b11264c208 [Spice] Also apply abort-after-dump option to assembly output (#6203) 2024-03-02 14:09:41 +01:00
Marc Poulhiès 52bd0644e1 fix pythran wrt ldpath (#6202)
refs #6079

Signed-off-by: Marc Poulhiès <dkm@kataplop.net>
2024-02-28 19:54:31 +01:00
Marc Poulhiès 8e6c90d137 pythran: initial support (#6197)
Pythran is a python to c++ transpiler.
Our supports both the C++ and the full link to a share library (a python
module).

See https://pypi.org/project/pythran/ for more information.

fixes #6079

Signed-off-by: Marc Poulhiès <dkm@kataplop.net>
2024-02-28 16:38:03 +01:00
Ofek 02d2194004 Specify llvm-cxxfilt as the demangler for clang *groups* (#6114)
This does contain a single `.default.properties` file, but it already
contained an `/opt/compiler-explorer` reference.

@partouf maybe that would solve the mangling issue for clang-17 + libc++
?
2024-02-27 21:50:31 +02:00
Marc Poulhiès 5ebd04f90e Change getCompilerResultLanguageId prototype (#6148) 2024-02-24 19:21:23 +01:00
Marc Auberer 1e72627cb7 [Spice] Abort compilation after dump (#6170) 2024-02-20 14:56:19 +01:00
kevinjeon-g e5313c77f9 Update D8 versions (up to 8.2.42) (#6138)
This change adds recent D8 versions (8.1.72, 8.2.33, 8.2.42). Properties
for D8 have been reformatted to use groups in order to avoid duplication
of java/kotlin references.
2024-02-19 17:56:47 -06:00
David Spickett 4e272f73c0 flang: Use -masm to enable Intel syntax (#6145)
Since
https://github.com/llvm/llvm-project/commit/9ca1a1575a337931d0e49859f83a0d5b70916abd,
flang supports the use of `-masm` without having to use `-mllvm`. flang
converts this into `-mllvm...` so the result is the same.

The check still looks for `-mllvm`, as this is the best way to tell
flang and flang-to-external-fc apart. As `-masm` doesn't appear in the
--help output of flang.
2024-02-19 17:48:40 -06:00
Marc Auberer 9fa88d50d5 [Spice] Add std dir to default exec options (#6146) 2024-02-15 12:37:20 +01:00
Patrick Quist 9c5a6d3d95 Clang time trace support in execution pane (#6139) 2024-02-14 19:09:31 +01:00
David Spickett 282637dd0f flang: Enable the Intel asm syntax option (#6128)
flang-new doesn't support `-masm=intel` (though it seems likely it
eventually will), so this uses `-mllvm ...` to achieve the same thing.

flang-to-external-fc is a wrapper script that will be removed once
flang-new becomes flang, so it is not being updated and won't support
-masm or -mllvm ever.

(and you'll get the same output by choosing a gfortran compiler, since
that's what the script uses for codegen)
2024-02-12 21:53:13 -06:00
Marc Auberer 54dda76f22 New language: Spice (#6105)
Add support for the Spice programming language.

Spice (`spicelang`) is a simple, AOT compiled, LLVM-based systems
language with focus on practicality and performance.

**Key features of Spice**
- simplicity - see what you get aproach with batteries included
- performance: As Spice uses LLVM as its primary backbone, it competes
with the performance of other LLVM-based compilers
- enhanced safety: Spice implements an enhanced safety mechanism, which
includes builtin heap type with auto-free and more
- cross-compile support: Currently x86_64, AArch64 and wasm32 are
supported cross-compilation targets, but more to come
- Pretty good C and C++ interop

**Links**
- Source code: https://github.com/spicelang/spice
- Website: https://spicelang.com
- Playground (own CE instance): https://play.spicelang.com
- Infra PR: https://github.com/compiler-explorer/infra/pull/1229

**Things this PR addresses**
- General support for Spice
- Three code examples
- Spice mode (Syntax highlighting)
- Opt pipeline support
- LLVM mca and osaca support
2024-02-12 21:50:33 -06:00
Andrea TomasiandMatt Godbolt 4d39fdddb8 View Erlang jitted assembly (#6104)
Hi, this PR adds a way to view the assemply code of Erlang code.

Since OTP 24 inside the Erlang VM there is a jitter that runs while we
load the code.

The standard way to dump the asm code is to pass an option during the
startup. The main issue is that this triggers the dump of all the
modules we are loading (and it is slow).
To avoid this I'm using some instrinsics of OTP 26 but at least we dump
only what we need.

(I'm planning to add it to `infra` and then to awmason

Some references:
-
https://www.erlang.org/blog/otp-26-highlights/#improvements-in-the-erlang-compiler-and-jit
-
https://github.com/erlang/otp/blob/master/erts/emulator/beam/erl_bif_info.c#L5255

---------

Co-authored-by: Matt Godbolt <matt@godbolt.org>
2024-02-12 21:49:03 -06:00
Ofek Shilon d8fba38400 Fix #6091: Add consideration for negative prefix matches 2024-02-10 09:22:42 +02:00
Patrick Quist 4605ebfb4b Add Fortran library support (#5533) 2024-02-09 23:31:05 +01:00
kevinjeon-g 3953a3b09c Update dex2oat version string (#6096)
<!-- THIS COMMENT IS INVISIBLE IN THE FINAL PR, BUT FEEL FREE TO REMOVE
IT
Thanks for taking the time to improve CE. We really appreciate it.
Before opening the PR, please make sure that the tests & linter pass
their checks,
  by running `make check`.
In the best case scenario, you are also adding tests to back up your
changes,
  but don't sweat it if you don't. We can discuss them at a later date.
Feel free to append your name to the CONTRIBUTORS.md file
Thanks again, we really appreciate this!
-->
2024-02-05 21:27:59 -06:00
Andrea Tomasi 1cacc9ce79 Add Elixir language support (#6081)
Hi, I am adding support for the Elixir language
(https://github.com/compiler-explorer/compiler-explorer/issues/3947)
I have done this so far. It is not perfect but at least is something I
can work with.
 
In Elixir you can write several modules in the same file, so I show the
different compile utins as a list.

It works locally but I don't know how to add the Elixir language to
[infra](https://github.com/compiler-explorer/infra/)

Some notes:
- I think Elixir's macro system may be a potential security issue
because I can run code during compilation.
- The decompiled code contains a reference to the file path on the
system machine.


![elixir_compiler](https://github.com/compiler-explorer/compiler-explorer/assets/11353602/59e46c98-646d-4275-9c03-e4097a4977ef)
2024-02-05 20:54:01 -06:00
Matt Godbolt 7ba2635029 Check for non-string values in exec's env (#6087)
- warns
- fixes the case I found
2024-02-04 17:53:48 -06:00
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
kevinjeon-g 71b2065c8c Override getVersion() for dex2oat (#6076)
<!-- THIS COMMENT IS INVISIBLE IN THE FINAL PR, BUT FEEL FREE TO REMOVE
IT
Thanks for taking the time to improve CE. We really appreciate it.
Before opening the PR, please make sure that the tests & linter pass
their checks,
  by running `make check`.
In the best case scenario, you are also adding tests to back up your
changes,
  but don't sweat it if you don't. We can discuss them at a later date.
Feel free to append your name to the CONTRIBUTORS.md file
Thanks again, we really appreciate this!
-->
2024-02-03 22:21:53 +02:00
Matt Godbolt 613d7f688a Unify the way tmp dir is used (#6052)
Instead of having several globals, set via environment variables,
explicitly set the "correct" env var if passed `--tmpDir` and then
consistently use it in the rest of the program.

See @apmorton's comments in #1707
2024-01-28 18:50:46 -06:00
Jeremy Rifkin 8c1c3eab2a Add Wyrm transpiler (#6028)
https://github.com/compiler-explorer/compiler-workflows/pull/22
https://github.com/compiler-explorer/infra/pull/1218
https://github.com/compiler-explorer/misc-builder/pull/76

Depends on #6027
2024-01-21 10:43:20 -06:00