mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Merge pull request #4318 from ethereum/yul-internal
Rename some internal constructs from Julia/Iulia to Yul
This commit is contained in:
commit
e6595d8806
@ -15,7 +15,7 @@
|
||||
along with solidity. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
/**
|
||||
* Exceptions in Julia.
|
||||
* Exceptions in Yul.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
@ -28,8 +28,8 @@ namespace dev
|
||||
namespace julia
|
||||
{
|
||||
|
||||
struct IuliaException: virtual Exception {};
|
||||
struct OptimizerException: virtual IuliaException {};
|
||||
struct YulException: virtual Exception {};
|
||||
struct OptimizerException: virtual YulException {};
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -42,7 +42,7 @@ namespace julia
|
||||
{
|
||||
|
||||
///
|
||||
/// Assembly class that abstracts both the libevmasm assembly and the new julia evm assembly.
|
||||
/// Assembly class that abstracts both the libevmasm assembly and the new Yul assembly.
|
||||
///
|
||||
class AbstractAssembly
|
||||
{
|
||||
|
@ -15,7 +15,7 @@
|
||||
along with solidity. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
/**
|
||||
* Common code generator for translating Julia / inline assembly to EVM and EVM1.5.
|
||||
* Common code generator for translating Yul / inline assembly to EVM and EVM1.5.
|
||||
*/
|
||||
|
||||
#include <libjulia/backends/evm/EVMCodeTransform.h>
|
||||
@ -331,7 +331,7 @@ void CodeTransform::operator()(FunctionDefinition const& _function)
|
||||
CodeTransform(
|
||||
m_assembly,
|
||||
m_info,
|
||||
m_julia,
|
||||
m_yul,
|
||||
m_evm15,
|
||||
m_identifierAccess,
|
||||
m_useNamedLabelsForFunctions,
|
||||
|
@ -15,7 +15,7 @@
|
||||
along with solidity. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
/**
|
||||
* Common code generator for translating Julia / inline assembly to EVM and EVM1.5.
|
||||
* Common code generator for translating Yul / inline assembly to EVM and EVM1.5.
|
||||
*/
|
||||
|
||||
#include <libjulia/backends/evm/EVMAssembly.h>
|
||||
@ -49,14 +49,14 @@ public:
|
||||
CodeTransform(
|
||||
julia::AbstractAssembly& _assembly,
|
||||
solidity::assembly::AsmAnalysisInfo& _analysisInfo,
|
||||
bool _julia = false,
|
||||
bool _yul = false,
|
||||
bool _evm15 = false,
|
||||
ExternalIdentifierAccess const& _identifierAccess = ExternalIdentifierAccess(),
|
||||
bool _useNamedLabelsForFunctions = false
|
||||
): CodeTransform(
|
||||
_assembly,
|
||||
_analysisInfo,
|
||||
_julia,
|
||||
_yul,
|
||||
_evm15,
|
||||
_identifierAccess,
|
||||
_useNamedLabelsForFunctions,
|
||||
@ -78,7 +78,7 @@ protected:
|
||||
CodeTransform(
|
||||
julia::AbstractAssembly& _assembly,
|
||||
solidity::assembly::AsmAnalysisInfo& _analysisInfo,
|
||||
bool _julia,
|
||||
bool _yul,
|
||||
bool _evm15,
|
||||
ExternalIdentifierAccess const& _identifierAccess,
|
||||
bool _useNamedLabelsForFunctions,
|
||||
@ -87,7 +87,7 @@ protected:
|
||||
):
|
||||
m_assembly(_assembly),
|
||||
m_info(_analysisInfo),
|
||||
m_julia(_julia),
|
||||
m_yul(_yul),
|
||||
m_evm15(_evm15),
|
||||
m_useNamedLabelsForFunctions(_useNamedLabelsForFunctions),
|
||||
m_identifierAccess(_identifierAccess),
|
||||
@ -142,7 +142,7 @@ private:
|
||||
julia::AbstractAssembly& m_assembly;
|
||||
solidity::assembly::AsmAnalysisInfo& m_info;
|
||||
solidity::assembly::Scope* m_scope = nullptr;
|
||||
bool m_julia = false;
|
||||
bool m_yul = false;
|
||||
bool m_evm15 = false;
|
||||
bool m_useNamedLabelsForFunctions = false;
|
||||
ExternalIdentifierAccess m_identifierAccess;
|
||||
|
@ -62,7 +62,7 @@ public:
|
||||
};
|
||||
|
||||
/**
|
||||
* Creates a copy of a iulia AST potentially replacing identifier names.
|
||||
* Creates a copy of a Yul AST potentially replacing identifier names.
|
||||
* Base class to be extended.
|
||||
*/
|
||||
class ASTCopier: public ExpressionCopier, public StatementCopier
|
||||
|
@ -38,7 +38,7 @@ namespace julia
|
||||
{
|
||||
|
||||
/**
|
||||
* Creates a copy of a iulia AST replacing all identifiers by unique names.
|
||||
* Creates a copy of a Yul AST replacing all identifiers by unique names.
|
||||
*/
|
||||
class Disambiguator: public ASTCopier
|
||||
{
|
||||
|
@ -1,6 +1,6 @@
|
||||
## IULIA Optimiser
|
||||
## Yul Optimiser
|
||||
|
||||
The iulia optimiser consists of several stages and components that all transform
|
||||
The Yul optimiser consists of several stages and components that all transform
|
||||
the AST in a semantically equivalent way. The goal is to end up either with code
|
||||
that is shorter or at least only marginally longer but will allow further
|
||||
optimisation steps.
|
||||
@ -81,7 +81,7 @@ a loop or conditional, the first one is not inside), the first assignment is rem
|
||||
|
||||
## Expression Simplifier
|
||||
|
||||
This step can only be applied for the EVM-flavoured dialect of iulia. It applies
|
||||
This step can only be applied for the EVM-flavoured dialect of Yul. It applies
|
||||
simple rules like ``x + 0 == x`` to simplify expressions.
|
||||
|
||||
## Ineffective Statement Remover
|
||||
|
@ -59,7 +59,7 @@ void UnusedPruner::operator()(Block& _block)
|
||||
// Multi-variable declarations are special. We can only remove it
|
||||
// if all vairables are unused and the right-hand-side is either
|
||||
// movable or it return a single value. In the latter case, we
|
||||
// replace `let a := f()` by `pop(f())` (in pure IULIA, this will be
|
||||
// replace `let a := f()` by `pop(f())` (in pure Yul, this will be
|
||||
// `drop(f())`).
|
||||
if (boost::algorithm::none_of(
|
||||
varDecl.variables,
|
||||
@ -74,7 +74,7 @@ void UnusedPruner::operator()(Block& _block)
|
||||
statement = Block{std::move(varDecl.location), {}};
|
||||
}
|
||||
else if (varDecl.variables.size() == 1)
|
||||
// In pure IULIA, this should be replaced by a function call to `drop`
|
||||
// In pure Yul, this should be replaced by a function call to `drop`
|
||||
// instead of `pop`.
|
||||
statement = ExpressionStatement{varDecl.location, FunctionalInstruction{
|
||||
varDecl.location,
|
||||
|
@ -47,7 +47,7 @@ do\
|
||||
}\
|
||||
while(false)
|
||||
|
||||
BOOST_AUTO_TEST_SUITE(IuliaCSE)
|
||||
BOOST_AUTO_TEST_SUITE(YulCSE)
|
||||
|
||||
BOOST_AUTO_TEST_CASE(smoke_test)
|
||||
{
|
||||
|
@ -39,7 +39,7 @@ do\
|
||||
}\
|
||||
while(false)
|
||||
|
||||
BOOST_AUTO_TEST_SUITE(IuliaDisambiguator)
|
||||
BOOST_AUTO_TEST_SUITE(YulDisambiguator)
|
||||
|
||||
BOOST_AUTO_TEST_CASE(smoke_test)
|
||||
{
|
||||
|
@ -16,7 +16,7 @@
|
||||
*/
|
||||
/**
|
||||
* @date 2017
|
||||
* Unit tests for the iulia function grouper.
|
||||
* Unit tests for the Yul function grouper.
|
||||
*/
|
||||
|
||||
#include <test/libjulia/Common.h>
|
||||
@ -43,7 +43,7 @@ do\
|
||||
}\
|
||||
while(false)
|
||||
|
||||
BOOST_AUTO_TEST_SUITE(IuliaFunctionGrouper)
|
||||
BOOST_AUTO_TEST_SUITE(YulFunctionGrouper)
|
||||
|
||||
BOOST_AUTO_TEST_CASE(smoke_test)
|
||||
{
|
||||
|
@ -16,7 +16,7 @@
|
||||
*/
|
||||
/**
|
||||
* @date 2017
|
||||
* Unit tests for the iulia function hoister.
|
||||
* Unit tests for the Yul function hoister.
|
||||
*/
|
||||
|
||||
#include <test/libjulia/Common.h>
|
||||
@ -43,7 +43,7 @@ do\
|
||||
}\
|
||||
while(false)
|
||||
|
||||
BOOST_AUTO_TEST_SUITE(IuliaFunctionHoister)
|
||||
BOOST_AUTO_TEST_SUITE(YulFunctionHoister)
|
||||
|
||||
BOOST_AUTO_TEST_CASE(smoke_test)
|
||||
{
|
||||
|
@ -16,7 +16,7 @@
|
||||
*/
|
||||
/**
|
||||
* @date 2017
|
||||
* Unit tests for the iulia function inliner.
|
||||
* Unit tests for the Yul function inliner.
|
||||
*/
|
||||
|
||||
#include <test/libjulia/Common.h>
|
||||
@ -55,24 +55,24 @@ string inlinableFunctions(string const& _source)
|
||||
);
|
||||
}
|
||||
|
||||
string inlineFunctions(string const& _source, bool _julia = true)
|
||||
string inlineFunctions(string const& _source, bool _yul = true)
|
||||
{
|
||||
auto ast = disambiguate(_source, _julia);
|
||||
auto ast = disambiguate(_source, _yul);
|
||||
ExpressionInliner(ast).run();
|
||||
return assembly::AsmPrinter(_julia)(ast);
|
||||
return assembly::AsmPrinter(_yul)(ast);
|
||||
}
|
||||
string fullInline(string const& _source, bool _julia = true)
|
||||
string fullInline(string const& _source, bool _yul = true)
|
||||
{
|
||||
Block ast = disambiguate(_source, _julia);
|
||||
Block ast = disambiguate(_source, _yul);
|
||||
(FunctionHoister{})(ast);
|
||||
(FunctionGrouper{})(ast);\
|
||||
FullInliner(ast).run();
|
||||
return assembly::AsmPrinter(_julia)(ast);
|
||||
return assembly::AsmPrinter(_yul)(ast);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
BOOST_AUTO_TEST_SUITE(IuliaInlinableFunctionFilter)
|
||||
BOOST_AUTO_TEST_SUITE(YulInlinableFunctionFilter)
|
||||
|
||||
BOOST_AUTO_TEST_CASE(smoke_test)
|
||||
{
|
||||
@ -121,7 +121,7 @@ BOOST_AUTO_TEST_CASE(negative)
|
||||
|
||||
BOOST_AUTO_TEST_SUITE_END()
|
||||
|
||||
BOOST_AUTO_TEST_SUITE(IuliaFunctionInliner)
|
||||
BOOST_AUTO_TEST_SUITE(YulFunctionInliner)
|
||||
|
||||
BOOST_AUTO_TEST_CASE(simple)
|
||||
{
|
||||
@ -210,7 +210,7 @@ BOOST_AUTO_TEST_CASE(double_recursive_calls)
|
||||
|
||||
BOOST_AUTO_TEST_SUITE_END()
|
||||
|
||||
BOOST_AUTO_TEST_SUITE(IuliaFullInliner)
|
||||
BOOST_AUTO_TEST_SUITE(YulFullInliner)
|
||||
|
||||
BOOST_AUTO_TEST_CASE(simple)
|
||||
{
|
||||
|
@ -16,7 +16,7 @@
|
||||
*/
|
||||
/**
|
||||
* @date 2018
|
||||
* Unit tests for the Julia MainFunction transformation.
|
||||
* Unit tests for the Yul MainFunction transformation.
|
||||
*/
|
||||
|
||||
#include <test/libjulia/Common.h>
|
||||
@ -45,7 +45,7 @@ do\
|
||||
}\
|
||||
while(false)
|
||||
|
||||
BOOST_AUTO_TEST_SUITE(JuliaMainFunction)
|
||||
BOOST_AUTO_TEST_SUITE(YulMainFunction)
|
||||
|
||||
BOOST_AUTO_TEST_CASE(smoke_test)
|
||||
{
|
||||
|
@ -119,7 +119,7 @@ do \
|
||||
BOOST_CHECK(searchErrorMessage(err, (substring))); \
|
||||
} while(0)
|
||||
|
||||
BOOST_AUTO_TEST_SUITE(JuliaParser)
|
||||
BOOST_AUTO_TEST_SUITE(YulParser)
|
||||
|
||||
BOOST_AUTO_TEST_CASE(smoke_test)
|
||||
{
|
||||
|
@ -48,7 +48,7 @@ do\
|
||||
}\
|
||||
while(false)
|
||||
|
||||
BOOST_AUTO_TEST_SUITE(IuliaRematerialiser)
|
||||
BOOST_AUTO_TEST_SUITE(YulRematerialiser)
|
||||
|
||||
BOOST_AUTO_TEST_CASE(smoke_test)
|
||||
{
|
||||
|
@ -48,7 +48,7 @@ do\
|
||||
}\
|
||||
while(false)
|
||||
|
||||
BOOST_AUTO_TEST_SUITE(IuliaSimplifier)
|
||||
BOOST_AUTO_TEST_SUITE(YulSimplifier)
|
||||
|
||||
BOOST_AUTO_TEST_CASE(smoke_test)
|
||||
{
|
||||
|
@ -48,7 +48,7 @@ do\
|
||||
}\
|
||||
while(false)
|
||||
|
||||
BOOST_AUTO_TEST_SUITE(IuliaUnusedPruner)
|
||||
BOOST_AUTO_TEST_SUITE(YulUnusedPruner)
|
||||
|
||||
BOOST_AUTO_TEST_CASE(smoke_test)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user