Commit Graph
452 Commits
Author SHA1 Message Date
Mats Larsen 560d18c410 Temporarily patch Kotlin runtime execution (#3151)
Fixes the problem where any (reasonable) Kotlin JVM execution would fail with a NoClassDefFound error with kotlin.jvm.internal.Intrinsics.

The Kotlin execution is now packed into a jar with the Kotlin Standard Library and executed with java -jar.
2021-12-03 22:59:08 +01:00
Björn Gustavsson 12d27b59b7 Format the output file for Erlang in a nicer way (#3135)
For Erlang, format the output in the same way as the 'S' option
does. To achieve this, we use the `beam_listing` module, which is
undocumented but has been stable for many many years.
2021-11-24 08:30:34 -06:00
Marc Poulhiès 8a6701f3a1 Fix and refactor rustc-cg-gcc GCC dump (#3128)
Conflicting changes in #3109 and #3064 left the GCC dump of rustc broken.

Reapplied the changes and refactored how the -fdump-foo-pass= option is crafted.
Instead of using stdout, use an explicit file. Beware that this won't work with
older GCC version. Regular GCC is still using the 'dump all files' instead of
the targeted option, so it's not impacted by this limitation. Only rustc-cg-gcc
is currently using this mecanism and it's using a recent libgccjit.

Really fixes #2868

Signed-off-by: Marc Poulhiès <dkm@kataplop.net>
2021-11-22 00:08:02 +01:00
Patrick Quist 2bc71691ef Erlang highlight and add to amazon (#3129) 2021-11-21 23:53:43 +01:00
Marc Poulhiès 0efd82d6a4 Fix linter error in erlang.js
Trivial linter error:
```
compiler-explorer/lib/compilers/erlang.js
  65:1  warning  More than 1 blank line not allowed  no-multiple-empty-lines

✖ 1 problem (0 errors, 1 warning)
  0 errors and 1 warning potentially fixable with the `--fix` option.
```
2021-11-21 19:15:27 +01:00
Timothy MooresandPatrick Quist 82772f4bbb add support for erlang to beam bytecode (#3094)
* add support for erlang to beam bytecode

* changed call by 'this' to overridden functions

* Update base-compiler.js

Co-authored-by: Patrick Quist <partouf@gmail.com>
2021-11-21 14:22:04 +01:00
Marc Poulhiès 177fee0739 Enable the GCC dump for the rustc using GCC backend (#3109)
Beware that the way it is working causes several dump files to be empty. The
list of potential files is based on `-fdump-passes` output, but during the
actual compilation, some passes may or may not emit something (eg. a passe may
not be executed at all because it's not applicable). The drop down list will
contain some dump names that will simply display message like:

   Pass 'cselim (tree)' was requested
   but nothing was dumped. Possible causes are:
    - pass is not valid in this (maybe you changed the compiler options);
    - pass is valid but did not emit anything (eg. it was not executed).

This is expected and until someone has a better idea, this will be the case :)

fixes: #2868
Signed-off-by: Marc Poulhiès <dkm@kataplop.net>
2021-11-21 14:18:25 +01:00
Marc PoulhièsandNico Lehmann 20ebcf7417 Honour rustc flags when emitting MIR and emit both assembly and MIR in the same execution (#3116)
* Honor compiler flags in rustc MIR output view

* Refactor rustc/MIR execution handling

Apply the same receipe as for GNAT and GCC for minimizing the number of
executions for getting extra outputs (here MIR).

After discussions in #3107, the way the output files are created is also
changed to use the syntax `--emit KIND=PATH` (see
https://doc.bccnsoft.com/docs/rust-1.36.0-docs-html/rustc/command-line-arguments.html)

Signed-off-by: Marc Poulhiès <dkm@kataplop.net>

* fixup! Refactor rustc/MIR execution handling

Co-authored-by: Nico Lehmann <nico.lehmannm@gmail.com>
2021-11-21 14:15:30 +01:00
Marc Poulhiès 88d58f9fe2 Refactor GCC dump and GNAT expanded code creation (#3064)
Instead of having a dedicated invocation of the compilers, inject needed options
in the main compilation command and do everything in one run. This should fix
GNAT race condition on ALI file, save some CPU time and make the latency a bit
better. This can work as long as everything can really be done in one run (eg.
no incompatible options, no clash on stdout/stderr).

Add optionsForBackend in base compiler class that is meant to be overloaded by
compilers for injecting options based on current backend options. Use it for
GCC dumps (BaseCompiler) and GNAT expanded code.

Fixes #3041
References #3029

Signed-off-by: Marc Poulhiès <dkm@kataplop.net>
2021-11-16 21:09:18 +01:00
Marc PoulhièsandRubén Rincón Blanco 6f18695dc0 Refactor GCC dump handling (#3024)
This change allows for only dumping a single pass (the one selected). In order
to populate the list of available dumps, it now queries GCC for the enabled
passes.

It can still be misleading to users as a pass can be enabled but for some reason
does not dump anything. In order to avoid this, the only solution seems to be to
still dump all files and filter the list... This defeats the initial goal and
only adds complexity for the current compilers.

But this makes #2868 easier to implement (see #2985 that was a aborted first
attempt) and if someday another libgccjit-based compiler is added, it could be
easily hooked to this.

It also changes the naming in the drop down menu. For example, instead of :
'009t.omplower' it now uses 'omplower (tree)' (ie.
'<pass-name> (tree|ipa|rtl)').

Fixes #3014

Signed-off-by: Marc Poulhiès <dkm@kataplop.net>
Co-authored-by: Rubén Rincón Blanco <ruben@rinconblanco.es>
2021-11-08 18:52:30 +01:00
Mats Larsen 27b3c5ec20 Set Java default encoding to UTF-8 (#3096)
The default encoding used for Java is now UTF-8. This did not have to be changed for the Scala or Kotlin compilers as those already default to UTF-8
2021-11-04 17:15:21 +01:00
Matt Godbolt cf7d70402e Await for things (#3086)
* Await for things

We had a number of things that aren't await()ing their promises.
That led to non-deterministic compiler settings like Intel support.
I used the IDE to find them all and fix the ones that I thought looked
important.

More generally we should use tslint (once we're all typescript) to
ensure this more generally. I tried the eslint equivalent but it
either overreacted or didn't catch anything.

Closes #3085
2021-10-31 15:31:45 -05:00
Patrick Quist 1ca884c367 Seperate compiler finding process (#3022) 2021-10-15 18:22:33 +02:00
Marc PoulhièsandMats Larsen 9b46d4f1fd Initial support for GNAT specific debug output (#3000)
This change only gets the GNAT Debug expanded generated code (-gnatD).

Signed-off-by: Marc Poulhiès <dkm@kataplop.net>
Co-authored-by: Mats Larsen <me@supergrecko.com>
2021-10-13 19:59:26 +02:00
Austin Morton 810134942d Avoid calling compilerProps after compiler object construction (#3005) 2021-10-04 23:21:32 -05:00
Marc Poulhiès e104811b6b Enable GCC dump for the GNAT Ada compiler (#2989)
* Enable GCC dump for the GNAT Ada compiler

GNAT is part of GCC and can handle the regular GCC options for dump files.

Signed-off-by: Marc Poulhiès <dkm@kataplop.net>
2021-10-04 22:43:49 -05:00
Mats Larsen 87ed92ac0a Implement LLVM IR output for ispc (#2972) 2021-10-04 21:55:06 -05:00
Jason ZhengandPatrick Quist d103b7f362 Add support for generating SPIR-V assembly from OpenCL C and C++ for OpenCL (#2940)
* Add support for generating SPIR-V assembly from OpenCL C and C++ for OpenCL
* Update cpp_for_opencl.amazon.properties
* Update openclc.amazon.properties

Co-authored-by: Patrick Quist <partouf@gmail.com>
2021-10-04 21:43:07 -05:00
813b654a3e Show full java asm output when using switch expression (#2996)
Fixes #2995 

Co-authored-by: Maurice Mohlek <maurice.mohlek@valtech.de>
Co-authored-by: Mats Larsen <me@supergrecko.com>
2021-10-05 01:21:50 +02:00
Mats Larsen 278d28b313 Add rustc Macro Expansion view (#2932)
Adds a new pane for producing the macro expansion of Rust code compiled with rustc.
2021-09-27 00:33:09 +02:00
partouf 8cd9aaf85a oops 2021-09-13 20:24:46 +00:00
partouf 04f39e2e8e bugfixes pascal objdump 2021-09-13 20:20:21 +00:00
bc6757ae94 Pascalchanges (#2881)
* Changes to allow Program (vs Unit) in Object Pascal

* add possibility of dpr

* more flexibility with pascal filenames

* lintfixes

* i have no idea what im doing

* apply changes to pascal-win

* pascal fixes

* pascal projectfile changes

* work in progress

* bugfixes

* bla

* bugfixes

* mostly working

Co-authored-by: paul mcgee <paul.mcgee.8@bigpond.com>
Co-authored-by: Paul McGee <paulmcgee1969@gmail.com>
2021-09-13 20:22:27 +02:00
Patrick Quist 27136f3e1d Clean trunk and execution (#2916) 2021-09-04 20:55:49 +02:00
HazandRubén Rincón Blanco b3628b2c31 OCaml Improvements: objdump and a few refactorings (#2913)
* OCaml properties fixes

- Improve defaults by adding local and system versions
  - Make no assumptions about whether local and system are the same
  - Enable OPAM workflows which rely on updating PATH
- Fix version flag
- Fix objdumper

* OCaml output refactoring

* Add an arg parser for OCaml

Derived from Pascal (for now)

* Rename default OCaml compiler ids

* Add alias of old OCaml default compiler id

Co-authored-by: Rubén Rincón Blanco <ruben@rinconblanco.es>
2021-09-03 05:51:15 +02:00
Kevin Adler 44c5162add Add support for Microsoft Visual C++ 6 (#2907)
A new compiler type 'win32-vc6' has been added, which uses a slightly
modified version of asm-parser-vc to handle assembly output differences
from current Visual Studio output.

In particular, MSVC6 does not output a comment line containing the
function's compile flags prior to the function body. The win32-vc parser
uses this to identify the start of a function and initialize
currentFunction. Instead, we use the regex that identifies a function
name to do this. Otherwise, a TypeError occurs trying to set
currentFunction.name when currentFunction is null.

In addition, MSVC6 only outputs a file comment once (presumably, until a
function from a different file is output). So instead of initializing
currentFunction.file to undefined, it is set to currentFile instead.
This should get set on the first function found in the file, but if not
it is initialized to undefined, so the behavior there would be the same.

Finally, the _DATA and _TLS segments are handled as well as some
additional miscellaneous directives.
2021-09-01 07:50:26 -05:00
Mats Larsen cfff740283 Fix execution for Java with multifile ui (#2882)
* Fix execution for Java with multifile ui

* Remove dev comment
2021-08-28 14:39:02 +02:00
Patrick Quist 5e5e60159a Multifile/IDE mode (#2725) 2021-08-26 21:57:07 +02:00
Matt Godbolt 019029c070 Support execution and binary mode in haskell. Closes #2854 2021-08-14 13:06:26 -05:00
Haz 60db8ba531 Make OCaml examples executable and objdumpable (#2853)
Changes:

- ocaml.default.properties:
  - add the relevant flags for execution and emitting binaries
  - add nicer version number reporting
  - let CE know `objdump` can be used on ocaml objects

- ocaml.js:
  - update optionsForFilter for both executable and object handling
  - override the getter for executable to work within ocamlopt context
2021-08-14 13:03:13 -05:00
ca017bac31 Add support for heterogeneous compute (#2836)
* Extract device code from assembly files.

This commit by itself does not actually add any viewing panes for the
extracted device code, nor does it provide any means to provide
device-specific postprocessing steps.

* Add a rudimentary device view.

This doesn't handle multiple device outputs correctly at the moment, and
it provides no opportunity to view device code differently from
non-device code for now.

* Lint issues

* Some more WIP getting it working.

* Add device extraction code

* More fixes, and keep state

Co-authored-by: Joshua Cranmer <joshua.cranmer@intel.com>
Co-authored-by: Patrick Quist <partouf@gmail.com>
2021-08-14 12:53:22 -05:00
Haz 4d3750bef3 Override default compiler flags for OCaml (#2849)
Fixes github issue #2848
2021-08-11 23:02:21 +02:00
Patrick Quist 508d6045a3 lintfixes 2021-07-31 20:28:01 +02:00
Joachim Schmidt 4c0711be78 Update to latest zig trunk (#2832)
Unused function parameters (used in the custom panic handler) are now
compile errors.
2021-07-31 20:21:44 +02:00
Quinton Miller 7e1835fa0f Add support for Ruby (#2816) 2021-07-30 16:29:37 -04:00
Michał Cichoń 2930b0cec2 Add support for Intel asm syntax (#2824) 2021-07-28 22:36:33 -05:00
RabsRincon d6c5752852 Reassign my copyright to Compiler Explorer Authors 2021-07-27 06:03:54 +02:00
Michał Cichoń 3bce751739 Add support for Circle (https://www.circle-lang.org/) (#2808)
* Add support for circle-lang (closes #1845)
* Add circle-128 version.
* Support keywords starting with @ (thanks Matt!)
2021-07-25 21:26:00 -05:00
Mats Larsen aa431e1336 Add rustc MIR output view (#2795)
* Add Rustc MIR representation view
* Enable MIR view for rust-cg-gcc
2021-07-24 10:56:06 -05:00
Matt Godbolt 25f48a89a0 Reassign my copyright to Compiler Explorer Authors 2021-07-24 08:46:18 -05:00
RabsRincon db6626e3e8 Reassign my copyright to Compiler Explorer Authors 2021-07-24 00:51:34 +02:00
Matt Godbolt 625732bf73 cproc tweaks 2021-07-19 22:56:45 -05:00
Marc Poulhiès 040115eaf5 Support cproc C11 compiler (#2787)
Add support for cproc C11 compiler.
cproc is a lightweight compiler using the QBE backend.

Fixes #2755
2021-07-19 22:24:46 -05:00
Artem Belevich 115cbf3817 Add support for HIP compilation for AMD GPUs. (#2759)
* Added support for HIP compilation for AMD GPUs.

At the moment it only supports stand-alone compilation w/o ROCm SDK.

* Enable barebones HIP compilation.

Clang by itself is good enough to compile simple kernels that do not need ROCm
SDK headers and bitcode libraries.

Closes #2760
2021-07-19 21:55:23 -05:00
Marc Poulhiès f000d51ad0 Adding rustc-cg-gcc (#2746)
GCC backend for rustc is still in a very early state.
It is in the process of being merged in main rustc source:
https://github.com/rust-lang/compiler-team/issues/442

Currently reusing main rust compiler class and simply remove -Cllvm= argument if
any (only for intel asm syntax).

Disabling binary until the result is more friendly (currently binary are too
big).

refs #2683
2021-07-12 15:35:01 -05:00
Quinton Miller 6ea7669814 Override CC env variable in Crystal propeties (#2776) 2021-07-12 08:37:32 -05:00
partouf 2eebf0372f lint fixes 2021-07-08 14:40:41 +00:00
Quinton MillerandPatrick Quist 94ecb093a0 Add Crystal support (#2732)
* Add Crystal support

* Fix copyright

* Add ASM parser for Crystal

* Add supportsLibraryCodeFilter

* Update crystal-mode.js

* use baseName

* Force `square` call

* Update default snippet

Co-authored-by: Patrick Quist <partouf@gmail.com>
2021-07-08 00:23:48 +02:00
Mats Larsen f3be74183d Fix execution for JVM compilers (#2767) 2021-07-06 09:42:21 -05:00
Mats Larsen e2a8e7c8ce Support execution of programs for JVM compilers (#2745)
* Bare execution for Java programs
* Support execution for Kotlin
2021-07-06 08:11:32 -05:00