2768 Commits
Author SHA1 Message Date
LJ 5a15d893d7 Add support for Yul intermediate view when compiling Solidity (#8219)
## What

Adds support for seeing Yul (Solidity IR) as intermediate output when
compiling Solidity.

This PR also enables that view for the Resolc compiler.

### Main Additions

- [x] Support viewing Yul in a supplementary view
- Solidity compilers can enable this by setting
`this.compiler.supportsYulView = true` in the compiler's constructor
- If custom processing of the Yul output or the Yul output filename is
needed, the compiler can override `processYulOutput()` or
`getYulOutputFilename()`
- [x] Enable the Yul view for Resolc
- [x] Implement a Yul backend option for filtering out debug info from
the output

### Notes

Source mappings are currently not handled for Yul -> Solidity.

## Overall Usage

### Steps

* Choose Solidity as the language
* Choose a Resolc compiler
* View intermediate results:
  * Yul
* (Hide/show debug info by toggling "Hide Debug Info" in the Yul view
filters)

## Screenshots

<img width="1502" height="903" alt="ce-yul-view"
src="https://github.com/user-attachments/assets/ccc897e2-cd8d-4c33-962c-522d60b63134"
/>
2025-11-04 09:00:19 -06:00
Ofek 901b7e1826 Fix for win32 link-binary (#8236)
(+ a rename).
Turns out when 'Link to Binary' was checked, msvc objdumped the obj (not
exe) file. This fixes it.
2025-11-01 12:54:31 +02:00
narpfel 938d0e5d14 Make instruction set parsing compatible with file >= v5.46 (#8226)
The identifier for 32-bit Intel ELF files was changed in `file` v5.46:
https://github.com/file/file/commit/45702aaa99b982af7bf0b7ffd60f8b0a831ff8b5.
2025-10-28 18:01:23 +01:00
Patrick Quist f5f1566bff Add timing for executable package storage (#8218) 2025-10-28 09:44:51 +01:00
Matt GodboltandClaude 4080457f2c Minor library updates (#8209)
Co-authored-by: Claude <noreply@anthropic.com>
2025-10-22 11:36:33 -05:00
Matt Godbolt b51b8250b0 Expose the naming convention of the jailing process (#8211)
To allow resolc to correctly find in-sandbox named artifacts

See #8164
2025-10-22 11:34:14 -05:00
narpfel d21e62d3a1 Fix race condition in Rust opt pipeline view (#8205)
The same race condition that was reported in #7012 also affects the opt
pipeline view.

I couldn’t reproduce the race condition locally, but on the live site it
happens relatively often, e. g. in https://godbolt.org/z/4Y1qfvTvz.
2025-10-22 09:58:21 -05:00
Frank Leon RoseandMatt Godbolt b9dc265973 Clojure language support (#8146)
<img width="1405" height="474" alt="Clojure in Compiler Explorer 2"
src="https://github.com/user-attachments/assets/76dfed9b-d0eb-4764-b371-9c6023088a50"
/>

With Macro Expansion:
<img width="1642" height="594" alt="image"
src="https://github.com/user-attachments/assets/8b511af9-3617-426e-868d-5a99e5db5756"
/>

TODO
- [x] Language configuration
- [x] Compile via wrapper
  - Inject namespace if necessary to simplify minimal code sample
  - Parse Unix style command line parameters into compiler bindings
  - Place file in path according to namespace
- [x] Install some versions of Clojure [PR
here](https://github.com/compiler-explorer/infra/pull/1849)
- [x] Macroexpansion view (modeled on Rust macro expansion view)
- [x] Filter out command line options that would break wrapper operation
- [x] ~~Parse `--help` output to a list of options~~ Reverted because
not applicable.
- [x] Short form compiler options
- [x] Support Clojure compiler settings via env var, like
`JAVA_OPTS=-Dclojure.compiler.direct-linking=true
-Dclojure.compiler.elide-meta=[:doc,:file]`

NOT DOING
- [x] ~~Support loading dependencies~~ Non-trivial enhancement. Not
necessary for initial release.

---------

Co-authored-by: Matt Godbolt <matt@godbolt.org>
2025-10-22 09:04:20 -05:00
LJandMatt Godbolt 066a942cbc Add Resolc 0.4.0 compiler for Solidity and Yul (#8164)
## What

Adds [Revive's Resolc](https://github.com/paritytech/revive) compiler
for compiling Solidity and Yul (Solidity IR) to RISC-V and PolkaVM
assembly.

### Main Additions

- [x] Implement new `ResolcCompiler`
- [x] Implement Yul language definition and config for Monaco
- [x] Add Resolc as a compiler for the Solidity and Yul languages
  - The `ResolcCompiler` handles both kinds of language input 
- [x] Implement initial `PolkaVMAsmParser` (no source mappings)
- [x] Enable viewing LLVM IR in a supplementary view
- [x] Implement a new LLVM IR backend option for toggling between
optimized and unoptimized ll
- Affects non-resolc files ([see
commit](https://github.com/compiler-explorer/compiler-explorer/pull/8164/commits/606bab9a59d49ade11d6e50c4262e9afc991c1aa))
  - Disabled by default
- (Enable by setting `this.compiler.supportsIrViewOptToggleOption =
true` in a compiler's constructor)
- The compiler's `getIrOutputFilename()` will receive the LLVM IR
backend options

### CE Infra

Accompanying CE Infra PR:
https://github.com/compiler-explorer/infra/pull/1855

## Overall Usage

### Steps

(See screenshots)

* Choose between two input languages:
  * Solidity
  * Yul (Solidity IR)
* Choose a Resolc compiler
* View assembly:
  * PolkaVM assembly (if enabling "Compile to binary")
  * RISC-V (64 bits) assembly
* View intermediate results:
  * Optimized LLVM IR (if enabling "Show Optimized" in the LLVM IR view)
  * Unoptimized LLVM IR

### Notes

Source mappings currently only exist between:
- Yul and RISC-V
- Yul and LLVM-IR

## Screenshots

<img width="1502" height="903" alt="CE Yul RISC-V LLVM IR"
src="https://github.com/user-attachments/assets/7503b9b5-0f2c-4ddf-9405-669e4bdcd02d"
/>

<img width="1502" height="903" alt="CE Solidity PolkaVM"
src="https://github.com/user-attachments/assets/eeb51c99-3eaa-4dda-b13c-ac7783e66cb8"
/>

---------

Co-authored-by: Matt Godbolt <matt@godbolt.org>
2025-10-14 13:56:59 -05:00
DipakHalkude 58e4f09867 Noscript share link (#8193) 2025-10-14 13:51:16 +02:00
Nathan S.andNathan SALAUN 822292e4ea Add support for Swift LLVM IR (#8180)
This adds support for the LLVM IR view for Swift, based on what other
LLVM based compilers do.

I tested it on my machine and it seems to work well, including with the
demangler. I'm not sure what `minIrArgs` is though, I added it because
it was there for other languages.

Co-authored-by: Nathan SALAUN <nathan.salaun@sofia.dev>
2025-10-13 14:20:25 -05:00
narpfel 685f68450a Don’t add --crate-type to rust compiler options when explicitly specified by user (#8191)
Resolves #8186.
2025-10-13 14:16:01 -05:00
Matt GodboltandClaude a1783e111a Remove spurious error logging in Java bytecode parser (#8194)
## Summary
- Removes misleading error log in Java bytecode parser for legitimate
compiler behavior
- Some Java-family compilers (Clojure, Kotlin) generate initial bytecode
instructions without source line mappings
- The code already handles this correctly; the error log was spurious

## Context
Issue #2986 has been open since 2021 with error logs about "Skipping
over instruction even though currentSourceLine == -1". After analyzing
the code path and compiler behavior:

1. **The "error" is actually expected behavior**: When compilers
generate bytecode with LineNumberTables that don't start at instruction
0, the initial instructions legitimately have no source line mappings
2. **The code handles this correctly**: These instructions are displayed
without source associations, which is the right behavior
3. **No functional issues**: After 3+ years, no users have reported
actual problems related to this

As @frankleonrose noted in the issue, this is legitimate compiler
output, not a CE bug.

## Test plan
- [x] TypeScript type checking passes
- [x] Linting passes  
- [x] Java-specific tests pass (10/10)
- [x] Related tests pass (77/77)

Closes #2986

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude <noreply@anthropic.com>
2025-10-13 14:02:30 -05:00
Patrick Quist f3571b9bc4 cmake on windows improvements (#8174) 2025-10-11 15:55:26 +02:00
Ofek 00ee2fc8b0 Initial support for binary/binary-obj in msvc (#8165) 2025-10-06 18:00:53 +03:00
Matt Godbolt 8dc0cb6c94 Major update: (#8158)
- bump pQueue:
https://github.com/sindresorhus/p-queue/releases/tag/v9.0.0
  - throwOnTimeout is removed (and is always `true`)
- 0 is not a valid timeout, so, updated tests to pass a big number (no
normal code path assumes 0)
- happy dom: breaking changes: removed commonjs, new jest; nothing
affects us
2025-10-02 14:05:56 -05:00
Matt Godbolt 69cd083301 Minor package updates (#8157)
- fixes static asset handler cast
- adds now required lessThan to graph layout (cc @jeremy-rifkin I think)
2025-10-02 13:35:25 -05:00
Ofek a679924a97 Fix #5524: Improve VC assembly filtering (#8156) 2025-10-02 19:21:44 +03:00
Ofek 1268377689 Fix #3491: improve MSVC asm filtering (#8154) 2025-10-02 01:59:18 +03:00
Partouf c83515d970 better fix 2025-09-30 01:49:12 +02:00
Partouf 62f25e9163 fix the fix 2025-09-30 01:25:28 +02:00
Partouf 70c88bc3a8 debuglogging 2025-09-30 01:11:33 +02:00
Partouf 51a576464a temp fix for faulty cache entries 2025-09-30 00:42:48 +02:00
Patrick Quist 3f317553c2 okToCache fix for nsjail errors and extra checks (#8148) 2025-09-29 22:21:51 +02:00
Ofek 5eb5262c64 Various type improvements, mostly in tests (#8144) 2025-09-27 10:17:55 +03:00
Matt GodboltandClaude 3160f628cc Fix AMD64 SHR missing and PTX documentation extraction (#8141)
Fixes test failures in assembly documentation generation.

## Import fixes

All docenizers: Change imports from `../base.js` to
`../../../types/assembly-docs.interfaces.js` with `import type`.

## AMD64: Fix missing SHR instruction

The docenizer only read the first `<table>` in HTML files. Files like
`SAL:SAR:SHL:SHR.html` have multiple tables - SHR was in table 2.

**Fix**: Read all tables and combine results.

## PTX: Fix broken documentation extraction

The PTX website structure changed. The old code looked for navigation
links like "Instructions: add, sub, mul" which no longer exist.

**Fix**: 
- Find instructions by scanning `<code>` blocks
- Map each to its documentation section
- Extract text from Description paragraphs
- Ensure common instructions (add, sub) map to their definition
sections, not changelogs

All asm-docs tests now pass.

---------

Co-authored-by: Claude <noreply@anthropic.com>
2025-09-26 15:07:59 -05:00
Ofek 5a7b0c27a4 Add CFG for MSVC compilers (#8134) 2025-09-25 00:23:36 +03:00
Ofek df5a83ea5b Fix #8081: remove -S from preprocessor compilation (#8133) 2025-09-24 15:59:14 +03:00
Ofek a971b1bc86 Fix #8131: comment filtering can leave empty lines. +Some renaming. (#8132) 2025-09-24 15:53:00 +03:00
narpfel 4836aa2360 Fix quadratic runtime in execution output reading (#8123) 2025-09-22 21:29:42 +02:00
Ofek 9bedb75b24 Fix #8116: rework GccCFGParser.filterData (#8117) 2025-09-20 22:09:05 +03:00
Ofek 80e446a16e Fix #8102: classify opt-remarks based on prefix (#8108) 2025-09-16 22:18:41 +03:00
Patrick Quist 102c74c09b fix tool invokations include paths for libraries (#8096) 2025-09-12 15:23:55 -05:00
Matt Godbolt f824efe73e Library updates and lint fixes (#8099)
* Minor updates only
* Added explicit radix parameter (10) to all Number.parseInt() calls throughout the codebase (new lint rule)
* Updated several @ts-ignore comments to @ts-expect-error for better TypeScript practices (new lint rule)
* Removed unnecessary @ts-ignore comments in some mode files (ditto)
* Used "none return" based arrow functions for some map stuff
* Replaced a `map()` call that didn't return anything to a for() loop
* Fixed up some cypress stuff, noting work for the future
2025-09-12 14:23:49 -05:00
Partouf 847ea95559 bugfix 2025-09-12 18:07:12 +02:00
Patrick Quist 0c5b4a5fd6 Add S3 overflow support for compilation workers (#8091) 2025-09-12 00:05:43 +02:00
Partouf 6b6efecb92 execution worker fix 2025-09-10 08:19:40 +02:00
Partouf 8fed840401 better protection against failures in websocket handling 2025-09-10 06:13:02 +02:00
Patrick Quist 447201a583 fix unicode stream bug (#8086) 2025-09-10 06:00:40 +02:00
Patrick Quist b3c6a321f1 Add compilation worker mode infrastructure (#7864) 2025-09-08 22:07:47 +02:00
Andy SofferandMatt Kulukundis 082c4304f2 Add tool arguments to bronto-refactor tool. (#8079)
This change just feeds the arguments passed via CE directly to the
binary tool.

Co-authored-by: Matt Kulukundis <matt@brontosource.dev>
2025-09-08 13:02:27 -05:00
Partouf 74a7611f3e fix #2986 2025-08-26 12:39:37 +02:00
narpfel 028bd96400 Update rustfmt to 1.89 and 2024 edition (#8059)
Resolves #8058.
2025-08-25 21:23:40 -05:00
narpfel 63faf792ba Fix jump to label with symbols containing $ (#8051)
For example Rust will mangle `<` to `$LT$`:
https://godbolt.org/z/86n9M6P3f
2025-08-25 21:19:07 -05:00
kevinjeon-g fc37e42d13 Fix errors in dex2oat compilation (#8050)
This fixes missing inlines (noticed on ArrayList iterators) and
incorrectly-emitted read barriers on local dex2oat.
2025-08-25 21:17:55 -05:00
Matt Godbolt 7c74b5aa0d Make compiler startup less chatty (#8043) 2025-08-19 08:48:30 -05:00
Ofek 96103f044f Fix #8000: stop forcing dwarf 4 (#8036) 2025-08-16 17:39:09 +03:00
narpfel 5d1d7cf77b Fix demangling for symbols with dots in jump instructions (#8028)
For example Rust on AArch64: https://godbolt.org/z/e3q9Wv7zj
2025-08-14 10:09:02 -05:00
narpfel 68db4ca482 Remove unused method AsmParser.labelFindFor (#8022)
`AsmParser.labelFindFor` was only called in tests.
2025-08-12 08:50:53 -05:00
narpfel f289b79f1d Don’t filter .set directives that declare merged functions (#8021)
Resolves #2409.
2025-08-11 14:31:44 -05:00