Commit Graph
754 Commits
Author SHA1 Message Date
Vadim Zaliva 0781e2b1be Compilers for exectuable Cerberus CHERI C and ISO C semantics (#5864)
# Cerberus

[Cerberus](https://www.cl.cam.ac.uk/~pes20/cerberus/) offers executable
semantics for a substantial fragment of C and
CHERI-C languages. It is implemented via an elaboration into a simpler
Core language, which is displayed as the compiler
output in the Compiler Explorer. Evaluation of C programs (execution) is
also supported.

## Prerequisites

The easiest way to install both the Cerberus and Cerberus-CHERI
compilers is by using Docker:

`docker pull vzaliva/cerberus-cheri`

Then, for example, you can print the _Core_ elaboration for `test.c`
using ISO C semantics:

`docker run -v $HOME/tmp:/mnt -it vzaliva/cerberus-cheri cerberus
--pp=core --exec /mnt/test.c`

## Configuration

The file `etc/config/c.defaults.properties` defines a group of two
compilers: 'cerberus' for ISO C and 'cerberus-cheri'
for CHERI-C. It assumes that the corresponding executables are in the
path.

## Limitations and Future Improvement

Presently, only simple Core output is shown. It is not syntactically
highlighted nor linked to C source code locations.
Some potential future improvements include:

1. Error location handling in warning and error messages
2. Specifying execution flags
3. Core syntax highlighting
4. Display of AST
5. Display of other intermediate languages (Cabs, Ail)
6. Tooltips/links to the ISO C document from Core annotations

## See also:

- [Cerberus (project page)](https://www.cl.cam.ac.uk/~pes20/cerberus/)
- [Cerberus (GitHub
repository)](https://github.com/rems-project/cerberus)
- ["Formal Mechanised Semantics of CHERI C: Capabilities, Undefined
Behaviour, and Provenance" (paper,
preprint)](https://zaliva.org/cheric-asplos24.pdf)
- ["CHERI C semantics as an extension of the ISO C17 standard" (tech
report)](https://www.cl.cam.ac.uk/techreports/UCAM-CL-TR-988.html)
2023-12-23 18:05:35 -06:00
J. Ryan Stinnett e7b22b41be Limit exec streams to max string length (#5898)
Some operations set `exec`'s `maxOutput` to a value larger than the max
string length. This change ensures we always cap output to the engine's
string limit (currently 512 MB in recent Node versions).

This also tweaks handling when reaching the string limit to ensure
adding the "truncated" message itself does not send us beyond the limit.
2023-12-23 17:54:46 -06:00
J. Ryan Stinnett 43bdf65d54 Customise opt pipeline language by compiler (#5880)
This allows each compiler to override the default Monaco language used
by the opt pipeline view.
2023-12-12 00:54:43 -05:00
Matt Godbolt 1815ca1b99 Prettier the files, and ensure the checks check that next time 2023-12-11 22:07:10 -06:00
J. Ryan StinnettandMatt Godbolt f0e1d5d264 Add Racket optimisation pipeline (#5836)
This adds a Racket optimisation pipeline view by reusing the existing
LLVM-focused optimisation pipeline UI. A Racket-specific pass parser
translates its output into passes for the UI to present.

This new Racket optimisation pipeline view is currently only enabled for
Racket nightly, as it depends on [recent
changes](https://github.com/racket/racket/pull/4842) to Racket's
compiler output to function.

This also extends the opt pipeline view to allow customising the
function selector label as well as the options and filters for each
compiler where needed.


![image](https://github.com/compiler-explorer/compiler-explorer/assets/279572/f540b41e-fd55-4375-bb2d-a0bb977530b3)

---------

Co-authored-by: Matt Godbolt <matt@godbolt.org>
2023-12-11 19:35:45 -06:00
Robert Cohn 7d3156ae5f oneapi 2024.0.0 release (#5867)
* directory structure has changed
* no more releases of icc

Depends on deployment of
https://github.com/compiler-explorer/infra/pull/1188
2023-12-10 14:19:43 -06:00
kevinjeon-g fb0f0a86d9 Add the HandlerConfig type to the global handler config (#5858) 2023-12-10 14:03:34 -06:00
Vicente BoleaandMatt Godbolt 20d2852138 lang: add cmakescript language (#5815)
Fixes #5502 

In this PR I make an early attempt to add the CMakeScript as a language
in compiler-explorer. I will be fantastic having this since CMake is one
of the most used build system. Having an cmake interpreter in the web
would probe truly useful for teams and individuals, it will be a
fantastic way to share snippets of cmakescript and show how they are
executed with different cmake versions.

Co-authored-by: Matt Godbolt <matt@godbolt.org>
2023-12-04 21:03:50 -06:00
kevinjeon-g 7efe253f5f Add support for Android D8 (8.1.56) (#5756)
Adds D8Compiler, which applies to the Android Java and Android Kotlin
languages. D8Compiler instantiates a JavaCompiler or KotlinCompiler
using the java/kotlin dependencies' paths for D8 in the infra repo.

compiler-finder.ts has been updated to allow for duplicate compiler IDs
for 'android-java' and 'android-kotlin', as it is expected that the
compilers used for these languages is the same.
2023-12-04 19:35:56 -06:00
Jeremy RifkinandMarc Poulhiès 7680595a88 Add GIMPLE (#5817)
This PR adds GIMPLE as a language

![image](https://github.com/compiler-explorer/compiler-explorer/assets/51220084/42d2b423-0d87-4a41-b762-3d8b4e7cedd2)

---------

Co-authored-by: Marc Poulhiès <dkm@kataplop.net>
2023-12-03 11:34:25 -05:00
J. Ryan Stinnett c3e1b04c31 Rename opt pipeline without LLVM prefix (#5828)
This prepares for future work that will reuse the opt pipeline view
outside of the LLVM ecosystem by renaming related components to remove
the LLVM prefix.

The pass dumper keep its LLVM prefix, as it is assumed this part is
likely to be customised for each compiler ecosystem.

The historical component name has been preserved in the component list
as an alias to keep old links working.
2023-12-03 11:33:42 -05:00
partouf e129f242b1 Merge branch 'main' of https://github.com/compiler-explorer/compiler-explorer into main 2023-11-30 00:39:10 +01:00
partouf 142691231d fix formatting 2023-11-30 00:38:42 +01:00
Patrick Quist b918a936fb fix ldc llvmir (#5827) 2023-11-30 00:36:54 +01:00
abhishekkaushik22 63b3f6beba Fix #5660 (#5794)
Closes #5660
2023-11-27 22:17:26 -06:00
aliaegik 4ad823b080 New C3 compiler added (#5789)
c3c compiler version 0.5 (alpha) added.
2023-11-22 17:47:40 -06:00
Mauro Baladés 7a33cd6e2e Changed exec to exe for snowball (#5788) 2023-11-22 10:51:46 -06:00
Patrick Quist 04efa86241 Changes to support CMake for Windows (#5769) 2023-11-22 03:06:26 +01:00
Mauro Baladés d2f4617d0d Added support for intel and new examples (#5754) 2023-11-21 18:12:05 -06:00
Matt Godbolt a7e6ec61e3 Bump remaining deps (#5781)
And reformat everything.
2023-11-20 22:04:57 -06:00
Mauro Baladés caa8b335ba Fixed CLI args for snowball (#5753) 2023-11-14 17:14:48 -06:00
Ofek a280d8d305 Fix #4654 (#5749)
Apparently AST for ldc is an abuse of terminology, as it doesn't
produces anything resembling a syntax tree:
https://github.com/dlang/dmd/pull/6556#issuecomment-282353400 . It is
potentially meaningful only to ldc developers. Anyway the `generateAST`
result type is fixed, along with some other small stuff around.
2023-11-13 20:11:16 -06:00
Steve 6b94b29f55 Disable diffable asm for dotnet 8.0+ by default (#5739)
Since .NET 8.0, the JIT disasm no longer prints encoded bytes of
instructions by default, so we can disable diffable asm by default.
2023-11-13 20:08:43 -06:00
Patrick Quist 455d92916a Execution with heaptrack (#5644) 2023-11-07 23:59:40 +01:00
David Spickett 28e607057c LLVM TableGen: Improve docstring for Actions Override and add example (#5711)
A majority of the actions/backends expect to find certain classes and
definitions in the source code. There's no canonical reference for this
so it's a combination of incomplete docs and the actual uses in
llvm-project.

(most of the time I expect people will come from llvm-project to
experiment, rather than the other way around)

I've added an example that uses the Searchable Tables backend.

<!-- 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!
-->
2023-11-07 00:32:24 +01:00
Justin Bogner b23c01e8cc Support the opt pipeline view in dxc for HLSL (#5704) 2023-11-04 20:55:39 +01:00
David Spickett 971889e5d7 LLVM TableGen: Add actions to Overrides menu (#5699) 2023-11-04 20:54:43 +01:00
Ofek e7d266ac9c Fix #5255 (#5700) 2023-11-04 20:01:43 +01:00
Patrick Quist 4a8fdbf810 store exec+sandbox types (#5696)
prep for #5533 and #5644
2023-11-01 00:06:47 +01:00
David Spickett 91ec8f09fa LLVM TableGen: Add trunk compiler and default include path (#5652)
Since trunk will be a moving target, I've left the default compiler as
17.01.

The standard include path will allow for examples that include files
like `include "llvm/TableGen/SearchableTable.td"`, without extra
options. This is useful if you want to create a minimal example of the
records that an existing backend expects to see.
2023-10-30 20:44:14 -05:00
Steve 2f0b8028c7 Always get version string for dotnet (#5648) 2023-10-30 16:23:54 +01:00
Steve 9daa1a9447 Fix crossgen2 compilation (#5661) 2023-10-30 16:19:04 +01:00
partouf 5ef2fb1025 add types 2023-10-24 17:30:36 +02:00
David Spickett 5f3db78dce Add the LLVM TableGen language (#5629)
LLVM TableGen is used to generate complex output files in the llvm
project. A generic description of classes and definitions produces
"records" that can then be walked by a TableGen backend to produce
things like C++ code, configuration files, etc.

The biggest examples are LLVM's assembler and disassembler where all the
targets' instructions are defined in TableGen.

https://llvm.org/docs/TableGen/ProgRef.html

An example:
```
class Register<int _size, string _alias=""> {
    int size = _size;
    string alias = _alias;
}
def X0: Register<8> {}
def X29: Register<8, "frame pointer"> {}
```
```
------------- Classes -----------------
class Register<int Register:_size = ?, string Register:_alias = ""> {
  int size = Register:_size;
  string alias = Register:_alias;
}
------------- Defs -----------------
def X0 {        // Register
  int size = 8;
  string alias = "";
}
def X29 {       // Register
  int size = 8;
  string alias = "frame pointer";
}
```

It's often a pain point for people new to LLVM so having a quick way to
experiment would be a great benefit for the community (we have a Jupyter
kernel which is good but not as simple as Compiler Explorer).

The compiler for TableGen is `llvm-tblgen`. This comes with most release
builds of LLVM in /bin along with clang and the others. Its default is
to output a text dump of the records defined so that's what I've used
here. This is not executable code so I've disabled the features related
to that.

A user could pass options to `llvm-tblgen` to produce text in a format
other than this, C++ code or JSON for example. However this text dump is
the main use case.

I've re-used an existing clang install, since that includes
`llvm-tblgen` in `bin/`. I just added the 17.01 version for this first
change.

Syntax highlighting is a mix of the Fortran and Ada configuration,
following the language spec I linked above. Though I am very new to that
so it is likely incomplete.
2023-10-23 19:59:46 -05:00
Steve c5ffd00598 Allow disabling diffable asm manually (#5585)
When we see JitDisasmDiffable being set manually, we can stop
automatically emitting JitDisasmDiffable.
2023-10-23 19:53:09 -05:00
Cassandra Beckley d23bbc6596 Add AST viewer support for HLSL/DXC (#5627)
<!-- 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!
-->
Since DXC is a fork of Clang from LLVM 3.7, the AST can be generated and
parsed in a manner similar to the Clang AST.
2023-10-22 12:17:24 +02:00
Matt Godbolt c115a45ecb Final fixups to get Hylo execution and binary working 2023-10-18 15:54:55 -05:00
nickpdemarco 4fd7f325f4 merge main 2023-10-18 16:36:52 -04:00
nickpdemarco a0cb7f11ae Get execution working by setting library paths to [], be more precise about when we emit intel 2023-10-18 16:34:27 -04:00
Nick DeMarco 58ee2354be Add Hylo support (#5622)
This PR adds front end support for the
[Hylo](https://www.hylo-lang.org/) programming language. Back end
support has already been added with
https://github.com/compiler-explorer/misc-builder/pull/71 and
https://github.com/compiler-explorer/misc-builder/pull/72.
2023-10-18 12:07:38 -05:00
nickpdemarco d72be292d8 Remove old svg, comment 2023-10-18 10:28:22 -04:00
Quinton Miller 36018ff3dd Fix Crystal assembly and LLVM IR output on 1.9+ (#5610)
Crystal 1.9+ has made the `.s` and `.ll` files follow the base name of
the output rather than the input (I think this is due to
crystal-lang/crystal#13370), this PR matches the Crystal compiler's
behavior
2023-10-17 13:52:31 +02:00
nickpdemarco 1b136ae688 Add note to add LLVM IR view later 2023-10-11 15:50:29 -04:00
nickpdemarco 4ee6cda52f rename val to hylo 2023-10-11 15:01:45 -04:00
nickpdemarco 9cda199e40 Merge main, resolve conflicts with vala 2023-10-11 14:43:05 -04:00
Simon Sobisch 634f9a13ae GnuCOBOL: always pass -g to the C compiler (#5504)
As this is done with other compilers like C/C++ and doesn't add extra
code (like plain `-g` would).

(this supersedes the broken #5503)
2023-09-23 08:53:14 +02:00
Prabhat Sachdeva cc33ad1a4e Add mode with no syntax highlighting to monaco editor. (#5490)
If `languageId` is not defined, the syntax highlighting in the Monaco
editor panel defaults to **ASM**.
This pull request creates a `no-highlight-mode` with **no syntax
highlighting**. This mode can be used when the syntax highlighting is
not required.

In this PR I've also updated the result of Carbon Language to use this
`no-highlight-mode` as the **ASM** syntax highlighting wasn't matching
the execution trace of Carbon Explorer.
2023-09-22 09:54:41 -04:00
Jeremy Rifkin fb147126e8 Fix WSL for systems that don't have windows paths (#5480)
Attempt to fix #5476. As far as I can tell `process.env.winTmp` is
needed just for windows executables and WslVcCompiler. It should be
possible to just ignore the exec error and continue. If for some reason
the user doesn't have windows paths in their WSL but does want to run
windows executables they can pass `-tmpDir`.
2023-09-16 15:59:26 -04:00
Justin Bogner 6a5a78f3b8 Introduce ClangDxcCompiler for HLSL (#5388) 2023-09-04 14:14:18 +02:00
Cassandra Beckley 94dae50be0 Use the SPIR-V parser for DXC SPIR-V output (#5418) 2023-09-04 13:59:52 +02:00