Files
compiler-explorer/examples
LJ 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](606bab9a59))
  - 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
..
2022-06-20 12:24:31 +01:00
2025-04-24 09:47:16 +02:00
2023-06-02 08:08:57 -05:00
2025-02-12 13:41:08 -06:00
2018-10-14 01:30:35 +02:00
2021-08-26 21:57:07 +02:00
2023-03-01 06:17:26 +08:00
2022-09-20 07:42:41 -05:00
2020-09-17 21:59:34 -05:00
2022-11-27 10:39:05 -06:00
2022-05-19 13:27:23 +02:00
2022-02-11 16:19:16 +01:00
2023-12-03 11:34:25 -05:00
2024-09-30 22:19:55 -05:00
2025-07-29 16:37:54 -05:00
2022-08-09 07:32:19 -05:00
2023-10-11 15:01:45 -04:00
2025-10-07 14:55:38 -05:00
2019-05-26 19:45:20 +02:00
2023-01-14 15:44:14 +01:00
2021-06-02 22:58:41 +02:00
2023-03-30 18:20:56 +02:00
2025-05-21 13:53:05 -05:00
2020-10-08 23:58:33 +02:00
2025-05-11 16:07:40 -05:00
2025-02-19 10:41:42 -06:00
2018-12-15 21:31:15 +03:00
2024-12-06 17:28:47 +01:00
2021-07-06 08:32:22 -05:00
2022-07-18 20:18:36 +02:00
2022-10-05 09:32:45 +02:00
2021-07-30 16:29:37 -04:00
2021-06-29 09:39:06 +02:00
2022-04-14 02:33:13 +02:00
2024-02-12 21:50:33 -06:00
2025-02-24 09:38:13 -06:00
2020-09-20 01:18:54 +02:00
2022-06-24 22:07:40 +02:00
2023-08-15 22:16:36 -05:00
2023-04-10 22:49:15 -05:00
2024-11-26 16:38:40 -06:00
2024-06-10 21:29:03 -05:00
2024-10-22 06:37:40 -05:00
2018-09-09 23:36:17 +12:00