This appears to be NFC change as new pass manager handles
--passes=default<O0> correctly. Still must be useful as a safeguard and
possibly for the old pass manager that is still used by backend.
```
Contract Without (bytes) With noinline+optnone (bytes)
─────────────────────────────── ───────────────── ────────────────────────────
contract.sol:C 1,266 1,266
Fibonacci:Iterative 2,506 2,506
Storage 3,671 3,671
Fibonacci:Recursive 3,794 3,794
Computation 5,776 5,776
Fibonacci:Binet 8,786 8,786
large_div_rem 10,705 10,705
DivisionArithmetics 14,831 14,831
ERC20 32,288 32,288
ERC20Tester 34,589 34,589
```
In YUL it's possible to declare closure with a same name, but in
different scope, which previously resulted to func name conflict during
LLVM IR construction.
To solve this, track YUL scope when building LLVM IR and a special
counter that increments every time function with the same name exists in
LLVM module.
There's still assert if somehow within the same scope there 2 functions
with the same name, which should be forbidden by Yul
Fixes: #474
---------
Co-authored-by: LJ <81748770+elle-j@users.noreply.github.com>
Emscripten 4.0.12 introduced breaking change by changing module factory
to always return promise even if `WASM_ASYNC_COMPILATION=0`. To overcome this, build emscripten compiler without MODULARIZE with custom export of `createRevive`.
Added 2 options to control expected result to `revive-runner`:
```
--verify-failure <VERIFY_FAILURE>
The expected call result of the contract execution
Possible values:
- instantiate: The contract instantiation must fail
- call: The contract execution must fail
--verify-call-gas-consumed <VERIFY_CALL_GAS_CONSUMED>
The expected amount of consumed gas by the contract execution
```
---------
Co-authored-by: xermicus <bigcyrill@hotmail.com>
Cloning of emsdk has been accidentally removed, that caused inability to
build LLVM release with current main.
The change adds this cloning back before emsdk script is sourced.
This change is essential first step to unblock gracefully enable LLVM 21
in revive compiler as current action blindly fetched latest LLVM binary
from the list of releases on our page.
The change queries release version from the submodule and uses it. Next
step: build LLVM 21 release binary
Next next step: switch revive compile to LLVM 21 after all issues are
fixed
That's a workaround to avoid LLVM backend crash while selecting
instruction for 256-bit integer division.
The workaround needs to be removed after we switch to newest inkwell
that has a fix in RISC-V backend
---------
Signed-off-by: kvp <mammal_windier8j@icloud.com>