Support compiling Yul within StandardCompiler

This commit is contained in:
Alex Beregszaszi
2019-03-22 01:35:16 +00:00
parent ed1ad2fc14
commit 3bc2c35cc4
22 changed files with 265 additions and 14 deletions
+6 -5
View File
@@ -147,7 +147,7 @@ Input Description
.. code-block:: none
{
// Required: Source code language, such as "Solidity", "Vyper", "lll", "assembly", etc.
// Required: Source code language. Currently supported are "Solidity" and "Yul".
"language": "Solidity",
// Required
"sources":
@@ -263,8 +263,9 @@ Input Description
// devdoc - Developer documentation (natspec)
// userdoc - User documentation (natspec)
// metadata - Metadata
// ir - New assembly format before desugaring
// evm.assembly - New assembly format after desugaring
// ir - Yul intermediate representation of the code before optimization
// irOptimized - Intermediate representation after optimization
// evm.assembly - New assembly format
// evm.legacyAssembly - Old-style assembly format in JSON
// evm.bytecode.object - Bytecode object
// evm.bytecode.opcodes - Opcodes list
@@ -273,8 +274,8 @@ Input Description
// evm.deployedBytecode* - Deployed bytecode (has the same options as evm.bytecode)
// evm.methodIdentifiers - The list of function hashes
// evm.gasEstimates - Function gas estimates
// ewasm.wast - eWASM S-expressions format (not supported atm)
// ewasm.wasm - eWASM binary format (not supported atm)
// ewasm.wast - eWASM S-expressions format (not supported at the moment)
// ewasm.wasm - eWASM binary format (not supported at the moment)
//
// Note that using a using `evm`, `evm.bytecode`, `ewasm`, etc. will select every
// target part of that output. Additionally, `*` can be used as a wildcard to request everything.
+17
View File
@@ -15,6 +15,23 @@ It can already be used for "inline assembly" inside Solidity and
future versions of the Solidity compiler will even use Yul as intermediate
language. It should also be easy to build high-level optimizer stages for Yul.
In its flavour of inline-assembly, Yul can be used as a language setting
for the :ref:`standard-json interface <compiler-api>`:
::
{
"language": "Yul",
"sources": { "input.yul": { "content": "{ sstore(0, 1) }" } },
"settings": {
"outputSelection": { "*": { "*": ["*"], "": [ "*" ] } },
"optimizer": { "enabled": true, "details": { "yul": true } }
}
}
Furthermore, the commandline interface can be switched to Yul mode
using ``solc --strict-assembly``.
.. note::
Note that the flavour used for "inline assembly" does not have types