Merge pull request #5220 from ethereum/libjulia-to-libyul

Renames `libjulia` directory to `libyul` & namespace `dev::julia` to `dev::yul`
This commit is contained in:
Christian Parpart 2018-10-15 12:30:00 +02:00 committed by GitHub
commit b2b845d6de
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
185 changed files with 243 additions and 243 deletions

View File

@ -1,6 +1,6 @@
# Until we have a clear separation, libjulia has to be included here # Until we have a clear separation, libyul has to be included here
file(GLOB_RECURSE sources "*.cpp" "../libjulia/*.cpp") file(GLOB_RECURSE sources "*.cpp" "../libyul/*.cpp")
file(GLOB_RECURSE headers "*.h" "../libjulia/*.h") file(GLOB_RECURSE headers "*.h" "../libyul/*.h")
find_package(Z3 QUIET) find_package(Z3 QUIET)
if (${Z3_FOUND}) if (${Z3_FOUND})

View File

@ -269,8 +269,8 @@ bool ReferencesResolver::visit(InlineAssembly const& _inlineAssembly)
// external references. // external references.
ErrorList errors; ErrorList errors;
ErrorReporter errorsIgnored(errors); ErrorReporter errorsIgnored(errors);
julia::ExternalIdentifierAccess::Resolver resolver = yul::ExternalIdentifierAccess::Resolver resolver =
[&](assembly::Identifier const& _identifier, julia::IdentifierContext, bool _crossesFunctionBoundary) { [&](assembly::Identifier const& _identifier, yul::IdentifierContext, bool _crossesFunctionBoundary) {
auto declarations = m_resolver.nameFromCurrentScope(_identifier.name); auto declarations = m_resolver.nameFromCurrentScope(_identifier.name);
bool isSlot = boost::algorithm::ends_with(_identifier.name, "_slot"); bool isSlot = boost::algorithm::ends_with(_identifier.name, "_slot");
bool isOffset = boost::algorithm::ends_with(_identifier.name, "_offset"); bool isOffset = boost::algorithm::ends_with(_identifier.name, "_offset");

View File

@ -952,9 +952,9 @@ bool TypeChecker::visit(InlineAssembly const& _inlineAssembly)
{ {
// External references have already been resolved in a prior stage and stored in the annotation. // External references have already been resolved in a prior stage and stored in the annotation.
// We run the resolve step again regardless. // We run the resolve step again regardless.
julia::ExternalIdentifierAccess::Resolver identifierAccess = [&]( yul::ExternalIdentifierAccess::Resolver identifierAccess = [&](
assembly::Identifier const& _identifier, assembly::Identifier const& _identifier,
julia::IdentifierContext _context, yul::IdentifierContext _context,
bool bool
) )
{ {
@ -978,7 +978,7 @@ bool TypeChecker::visit(InlineAssembly const& _inlineAssembly)
m_errorReporter.typeError(_identifier.location, "The suffixes _offset and _slot can only be used on storage variables."); m_errorReporter.typeError(_identifier.location, "The suffixes _offset and _slot can only be used on storage variables.");
return size_t(-1); return size_t(-1);
} }
else if (_context != julia::IdentifierContext::RValue) else if (_context != yul::IdentifierContext::RValue)
{ {
m_errorReporter.typeError(_identifier.location, "Storage variables cannot be assigned to."); m_errorReporter.typeError(_identifier.location, "Storage variables cannot be assigned to.");
return size_t(-1); return size_t(-1);
@ -1008,13 +1008,13 @@ bool TypeChecker::visit(InlineAssembly const& _inlineAssembly)
m_errorReporter.typeError(_identifier.location, "The suffixes _offset and _slot can only be used on storage variables."); m_errorReporter.typeError(_identifier.location, "The suffixes _offset and _slot can only be used on storage variables.");
return size_t(-1); return size_t(-1);
} }
else if (_context == julia::IdentifierContext::LValue) else if (_context == yul::IdentifierContext::LValue)
{ {
m_errorReporter.typeError(_identifier.location, "Only local variables can be assigned to in inline assembly."); m_errorReporter.typeError(_identifier.location, "Only local variables can be assigned to in inline assembly.");
return size_t(-1); return size_t(-1);
} }
if (_context == julia::IdentifierContext::RValue) if (_context == yul::IdentifierContext::RValue)
{ {
solAssert(!!declaration->type(), "Type of declaration required but not yet determined."); solAssert(!!declaration->type(), "Type of declaration required but not yet determined.");
if (dynamic_cast<FunctionDefinition const*>(declaration)) if (dynamic_cast<FunctionDefinition const*>(declaration))

View File

@ -318,10 +318,10 @@ void CompilerContext::appendInlineAssembly(
{ {
int startStackHeight = stackHeight(); int startStackHeight = stackHeight();
julia::ExternalIdentifierAccess identifierAccess; yul::ExternalIdentifierAccess identifierAccess;
identifierAccess.resolve = [&]( identifierAccess.resolve = [&](
assembly::Identifier const& _identifier, assembly::Identifier const& _identifier,
julia::IdentifierContext, yul::IdentifierContext,
bool bool
) )
{ {
@ -330,15 +330,15 @@ void CompilerContext::appendInlineAssembly(
}; };
identifierAccess.generateCode = [&]( identifierAccess.generateCode = [&](
assembly::Identifier const& _identifier, assembly::Identifier const& _identifier,
julia::IdentifierContext _context, yul::IdentifierContext _context,
julia::AbstractAssembly& _assembly yul::AbstractAssembly& _assembly
) )
{ {
auto it = std::find(_localVariables.begin(), _localVariables.end(), _identifier.name); auto it = std::find(_localVariables.begin(), _localVariables.end(), _identifier.name);
solAssert(it != _localVariables.end(), ""); solAssert(it != _localVariables.end(), "");
int stackDepth = _localVariables.end() - it; int stackDepth = _localVariables.end() - it;
int stackDiff = _assembly.stackHeight() - startStackHeight + stackDepth; int stackDiff = _assembly.stackHeight() - startStackHeight + stackDepth;
if (_context == julia::IdentifierContext::LValue) if (_context == yul::IdentifierContext::LValue)
stackDiff -= 1; stackDiff -= 1;
if (stackDiff < 1 || stackDiff > 16) if (stackDiff < 1 || stackDiff > 16)
BOOST_THROW_EXCEPTION( BOOST_THROW_EXCEPTION(
@ -346,7 +346,7 @@ void CompilerContext::appendInlineAssembly(
errinfo_sourceLocation(_identifier.location) << errinfo_sourceLocation(_identifier.location) <<
errinfo_comment("Stack too deep (" + to_string(stackDiff) + "), try removing local variables.") errinfo_comment("Stack too deep (" + to_string(stackDiff) + "), try removing local variables.")
); );
if (_context == julia::IdentifierContext::RValue) if (_context == yul::IdentifierContext::RValue)
_assembly.appendInstruction(dupInstruction(stackDiff)); _assembly.appendInstruction(dupInstruction(stackDiff));
else else
{ {

View File

@ -494,21 +494,21 @@ bool ContractCompiler::visit(FunctionDefinition const& _function)
bool ContractCompiler::visit(InlineAssembly const& _inlineAssembly) bool ContractCompiler::visit(InlineAssembly const& _inlineAssembly)
{ {
unsigned startStackHeight = m_context.stackHeight(); unsigned startStackHeight = m_context.stackHeight();
julia::ExternalIdentifierAccess identifierAccess; yul::ExternalIdentifierAccess identifierAccess;
identifierAccess.resolve = [&](assembly::Identifier const& _identifier, julia::IdentifierContext, bool) identifierAccess.resolve = [&](assembly::Identifier const& _identifier, yul::IdentifierContext, bool)
{ {
auto ref = _inlineAssembly.annotation().externalReferences.find(&_identifier); auto ref = _inlineAssembly.annotation().externalReferences.find(&_identifier);
if (ref == _inlineAssembly.annotation().externalReferences.end()) if (ref == _inlineAssembly.annotation().externalReferences.end())
return size_t(-1); return size_t(-1);
return ref->second.valueSize; return ref->second.valueSize;
}; };
identifierAccess.generateCode = [&](assembly::Identifier const& _identifier, julia::IdentifierContext _context, julia::AbstractAssembly& _assembly) identifierAccess.generateCode = [&](assembly::Identifier const& _identifier, yul::IdentifierContext _context, yul::AbstractAssembly& _assembly)
{ {
auto ref = _inlineAssembly.annotation().externalReferences.find(&_identifier); auto ref = _inlineAssembly.annotation().externalReferences.find(&_identifier);
solAssert(ref != _inlineAssembly.annotation().externalReferences.end(), ""); solAssert(ref != _inlineAssembly.annotation().externalReferences.end(), "");
Declaration const* decl = ref->second.declaration; Declaration const* decl = ref->second.declaration;
solAssert(!!decl, ""); solAssert(!!decl, "");
if (_context == julia::IdentifierContext::RValue) if (_context == yul::IdentifierContext::RValue)
{ {
int const depositBefore = _assembly.stackHeight(); int const depositBefore = _assembly.stackHeight();
solAssert(!!decl->type(), "Type of declaration required but not yet determined."); solAssert(!!decl->type(), "Type of declaration required but not yet determined.");

View File

@ -145,7 +145,7 @@ bool AsmAnalyzer::operator()(assembly::Identifier const& _identifier)
if (m_resolver) if (m_resolver)
{ {
bool insideFunction = m_currentScope->insideFunction(); bool insideFunction = m_currentScope->insideFunction();
stackSize = m_resolver(_identifier, julia::IdentifierContext::RValue, insideFunction); stackSize = m_resolver(_identifier, yul::IdentifierContext::RValue, insideFunction);
} }
if (stackSize == size_t(-1)) if (stackSize == size_t(-1))
{ {
@ -512,7 +512,7 @@ bool AsmAnalyzer::checkAssignment(assembly::Identifier const& _variable, size_t
else if (m_resolver) else if (m_resolver)
{ {
bool insideFunction = m_currentScope->insideFunction(); bool insideFunction = m_currentScope->insideFunction();
variableSize = m_resolver(_variable, julia::IdentifierContext::LValue, insideFunction); variableSize = m_resolver(_variable, yul::IdentifierContext::LValue, insideFunction);
} }
if (variableSize == size_t(-1)) if (variableSize == size_t(-1))
{ {

View File

@ -25,7 +25,7 @@
#include <libsolidity/inlineasm/AsmScope.h> #include <libsolidity/inlineasm/AsmScope.h>
#include <libjulia/backends/evm/AbstractAssembly.h> #include <libyul/backends/evm/AbstractAssembly.h>
#include <libsolidity/inlineasm/AsmDataForward.h> #include <libsolidity/inlineasm/AsmDataForward.h>
@ -59,7 +59,7 @@ public:
EVMVersion _evmVersion, EVMVersion _evmVersion,
boost::optional<Error::Type> _errorTypeForLoose, boost::optional<Error::Type> _errorTypeForLoose,
AsmFlavour _flavour = AsmFlavour::Loose, AsmFlavour _flavour = AsmFlavour::Loose,
julia::ExternalIdentifierAccess::Resolver const& _resolver = julia::ExternalIdentifierAccess::Resolver() yul::ExternalIdentifierAccess::Resolver const& _resolver = yul::ExternalIdentifierAccess::Resolver()
): ):
m_resolver(_resolver), m_resolver(_resolver),
m_info(_analysisInfo), m_info(_analysisInfo),
@ -106,7 +106,7 @@ private:
void checkLooseFeature(SourceLocation const& _location, std::string const& _description); void checkLooseFeature(SourceLocation const& _location, std::string const& _description);
int m_stackHeight = 0; int m_stackHeight = 0;
julia::ExternalIdentifierAccess::Resolver m_resolver; yul::ExternalIdentifierAccess::Resolver m_resolver;
Scope* m_currentScope = nullptr; Scope* m_currentScope = nullptr;
/// Variables that are active at the current point in assembly (as opposed to /// Variables that are active at the current point in assembly (as opposed to
/// "part of the scope but not yet declared") /// "part of the scope but not yet declared")

View File

@ -32,8 +32,8 @@
#include <libevmasm/SourceLocation.h> #include <libevmasm/SourceLocation.h>
#include <libevmasm/Instruction.h> #include <libevmasm/Instruction.h>
#include <libjulia/backends/evm/AbstractAssembly.h> #include <libyul/backends/evm/AbstractAssembly.h>
#include <libjulia/backends/evm/EVMCodeTransform.h> #include <libyul/backends/evm/EVMCodeTransform.h>
#include <libdevcore/CommonIO.h> #include <libdevcore/CommonIO.h>
@ -49,7 +49,7 @@ using namespace dev;
using namespace dev::solidity; using namespace dev::solidity;
using namespace dev::solidity::assembly; using namespace dev::solidity::assembly;
class EthAssemblyAdapter: public julia::AbstractAssembly class EthAssemblyAdapter: public yul::AbstractAssembly
{ {
public: public:
explicit EthAssemblyAdapter(eth::Assembly& _assembly): explicit EthAssemblyAdapter(eth::Assembly& _assembly):
@ -145,12 +145,12 @@ void assembly::CodeGenerator::assemble(
Block const& _parsedData, Block const& _parsedData,
AsmAnalysisInfo& _analysisInfo, AsmAnalysisInfo& _analysisInfo,
eth::Assembly& _assembly, eth::Assembly& _assembly,
julia::ExternalIdentifierAccess const& _identifierAccess, yul::ExternalIdentifierAccess const& _identifierAccess,
bool _useNamedLabelsForFunctions bool _useNamedLabelsForFunctions
) )
{ {
EthAssemblyAdapter assemblyAdapter(_assembly); EthAssemblyAdapter assemblyAdapter(_assembly);
julia::CodeTransform( yul::CodeTransform(
assemblyAdapter, assemblyAdapter,
_analysisInfo, _analysisInfo,
false, false,

View File

@ -46,7 +46,7 @@ public:
Block const& _parsedData, Block const& _parsedData,
AsmAnalysisInfo& _analysisInfo, AsmAnalysisInfo& _analysisInfo,
eth::Assembly& _assembly, eth::Assembly& _assembly,
julia::ExternalIdentifierAccess const& _identifierAccess = julia::ExternalIdentifierAccess(), yul::ExternalIdentifierAccess const& _identifierAccess = yul::ExternalIdentifierAccess(),
bool _useNamedLabelsForFunctions = false bool _useNamedLabelsForFunctions = false
); );
}; };

View File

@ -31,8 +31,8 @@
#include <libevmasm/Assembly.h> #include <libevmasm/Assembly.h>
#include <libjulia/backends/evm/EVMCodeTransform.h> #include <libyul/backends/evm/EVMCodeTransform.h>
#include <libjulia/backends/evm/EVMAssembly.h> #include <libyul/backends/evm/EVMAssembly.h>
using namespace std; using namespace std;
using namespace dev; using namespace dev;
@ -116,8 +116,8 @@ MachineAssemblyObject AssemblyStack::assemble(Machine _machine) const
case Machine::EVM15: case Machine::EVM15:
{ {
MachineAssemblyObject object; MachineAssemblyObject object;
julia::EVMAssembly assembly(true); yul::EVMAssembly assembly(true);
julia::CodeTransform(assembly, *m_analysisInfo, m_language == Language::Yul, true)(*m_parserResult); yul::CodeTransform(assembly, *m_analysisInfo, m_language == Language::Yul, true)(*m_parserResult);
object.bytecode = make_shared<eth::LinkerObject>(assembly.finalize()); object.bytecode = make_shared<eth::LinkerObject>(assembly.finalize());
/// TODO: fill out text representation /// TODO: fill out text representation
return object; return object;

View File

@ -25,7 +25,7 @@
namespace dev namespace dev
{ {
namespace julia namespace yul
{ {
using Instruction = solidity::assembly::Instruction; using Instruction = solidity::assembly::Instruction;

View File

@ -25,7 +25,7 @@
namespace dev namespace dev
{ {
namespace julia namespace yul
{ {
struct YulException: virtual Exception {}; struct YulException: virtual Exception {};

View File

@ -38,7 +38,7 @@ struct Instruction;
struct Identifier; struct Identifier;
} }
} }
namespace julia namespace yul
{ {
/// ///
@ -106,7 +106,7 @@ struct ExternalIdentifierAccess
/// Resolve an external reference given by the identifier in the given context. /// Resolve an external reference given by the identifier in the given context.
/// @returns the size of the value (number of stack slots) or size_t(-1) if not found. /// @returns the size of the value (number of stack slots) or size_t(-1) if not found.
Resolver resolve; Resolver resolve;
using CodeGenerator = std::function<void(solidity::assembly::Identifier const&, IdentifierContext, julia::AbstractAssembly&)>; using CodeGenerator = std::function<void(solidity::assembly::Identifier const&, IdentifierContext, yul::AbstractAssembly&)>;
/// Generate code for retrieving the value (rvalue context) or storing the value (lvalue context) /// Generate code for retrieving the value (rvalue context) or storing the value (lvalue context)
/// of an identifier. The code should be appended to the assembly. In rvalue context, the value is supposed /// of an identifier. The code should be appended to the assembly. In rvalue context, the value is supposed
/// to be put onto the stack, in lvalue context, the value is assumed to be at the top of the stack. /// to be put onto the stack, in lvalue context, the value is assumed to be at the top of the stack.

View File

@ -18,7 +18,7 @@
* Assembly interface for EVM and EVM1.5. * Assembly interface for EVM and EVM1.5.
*/ */
#include <libjulia/backends/evm/EVMAssembly.h> #include <libyul/backends/evm/EVMAssembly.h>
#include <libevmasm/Instruction.h> #include <libevmasm/Instruction.h>
@ -26,7 +26,7 @@
using namespace std; using namespace std;
using namespace dev; using namespace dev;
using namespace dev::julia; using namespace dev::yul;
namespace namespace
{ {

View File

@ -20,7 +20,7 @@
#pragma once #pragma once
#include <libjulia/backends/evm/AbstractAssembly.h> #include <libyul/backends/evm/AbstractAssembly.h>
#include <libevmasm/LinkerObject.h> #include <libevmasm/LinkerObject.h>
@ -28,7 +28,7 @@
namespace dev namespace dev
{ {
namespace julia namespace yul
{ {
class EVMAssembly: public AbstractAssembly class EVMAssembly: public AbstractAssembly

View File

@ -18,7 +18,7 @@
* Common code generator for translating Yul / 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> #include <libyul/backends/evm/EVMCodeTransform.h>
#include <libsolidity/inlineasm/AsmAnalysisInfo.h> #include <libsolidity/inlineasm/AsmAnalysisInfo.h>
#include <libsolidity/inlineasm/AsmData.h> #include <libsolidity/inlineasm/AsmData.h>
@ -29,7 +29,7 @@
using namespace std; using namespace std;
using namespace dev; using namespace dev;
using namespace dev::julia; using namespace dev::yul;
using namespace dev::solidity; using namespace dev::solidity;
using Scope = dev::solidity::assembly::Scope; using Scope = dev::solidity::assembly::Scope;

View File

@ -18,9 +18,9 @@
* Common code generator for translating Yul / 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> #include <libyul/backends/evm/EVMAssembly.h>
#include <libjulia/ASTDataForward.h> #include <libyul/ASTDataForward.h>
#include <libsolidity/inlineasm/AsmScope.h> #include <libsolidity/inlineasm/AsmScope.h>
@ -37,7 +37,7 @@ namespace assembly
struct AsmAnalysisInfo; struct AsmAnalysisInfo;
} }
} }
namespace julia namespace yul
{ {
class EVMAssembly; class EVMAssembly;
@ -47,7 +47,7 @@ public:
/// Create the code transformer. /// Create the code transformer.
/// @param _identifierAccess used to resolve identifiers external to the inline assembly /// @param _identifierAccess used to resolve identifiers external to the inline assembly
CodeTransform( CodeTransform(
julia::AbstractAssembly& _assembly, yul::AbstractAssembly& _assembly,
solidity::assembly::AsmAnalysisInfo& _analysisInfo, solidity::assembly::AsmAnalysisInfo& _analysisInfo,
bool _yul = false, bool _yul = false,
bool _evm15 = false, bool _evm15 = false,
@ -76,7 +76,7 @@ protected:
}; };
CodeTransform( CodeTransform(
julia::AbstractAssembly& _assembly, yul::AbstractAssembly& _assembly,
solidity::assembly::AsmAnalysisInfo& _analysisInfo, solidity::assembly::AsmAnalysisInfo& _analysisInfo,
bool _yul, bool _yul,
bool _evm15, bool _evm15,
@ -139,7 +139,7 @@ private:
void checkStackHeight(void const* _astElement) const; void checkStackHeight(void const* _astElement) const;
julia::AbstractAssembly& m_assembly; yul::AbstractAssembly& m_assembly;
solidity::assembly::AsmAnalysisInfo& m_info; solidity::assembly::AsmAnalysisInfo& m_info;
solidity::assembly::Scope* m_scope = nullptr; solidity::assembly::Scope* m_scope = nullptr;
bool m_yul = false; bool m_yul = false;

View File

@ -18,9 +18,9 @@
* Creates an independent copy of an AST, renaming identifiers to be unique. * Creates an independent copy of an AST, renaming identifiers to be unique.
*/ */
#include <libjulia/optimiser/ASTCopier.h> #include <libyul/optimiser/ASTCopier.h>
#include <libjulia/Exceptions.h> #include <libyul/Exceptions.h>
#include <libsolidity/inlineasm/AsmData.h> #include <libsolidity/inlineasm/AsmData.h>
@ -28,7 +28,7 @@
using namespace std; using namespace std;
using namespace dev; using namespace dev;
using namespace dev::julia; using namespace dev::yul;
Statement ASTCopier::operator()(Instruction const&) Statement ASTCopier::operator()(Instruction const&)
{ {

View File

@ -20,7 +20,7 @@
#pragma once #pragma once
#include <libjulia/ASTDataForward.h> #include <libyul/ASTDataForward.h>
#include <boost/variant.hpp> #include <boost/variant.hpp>
#include <boost/optional.hpp> #include <boost/optional.hpp>
@ -31,7 +31,7 @@
namespace dev namespace dev
{ {
namespace julia namespace yul
{ {
class ExpressionCopier: public boost::static_visitor<Expression> class ExpressionCopier: public boost::static_visitor<Expression>

View File

@ -18,7 +18,7 @@
* Generic AST walker. * Generic AST walker.
*/ */
#include <libjulia/optimiser/ASTWalker.h> #include <libyul/optimiser/ASTWalker.h>
#include <libsolidity/inlineasm/AsmData.h> #include <libsolidity/inlineasm/AsmData.h>
@ -26,7 +26,7 @@
using namespace std; using namespace std;
using namespace dev; using namespace dev;
using namespace dev::julia; using namespace dev::yul;
using namespace dev::solidity; using namespace dev::solidity;

View File

@ -20,9 +20,9 @@
#pragma once #pragma once
#include <libjulia/ASTDataForward.h> #include <libyul/ASTDataForward.h>
#include <libjulia/Exceptions.h> #include <libyul/Exceptions.h>
#include <boost/variant.hpp> #include <boost/variant.hpp>
#include <boost/optional.hpp> #include <boost/optional.hpp>
@ -33,7 +33,7 @@
namespace dev namespace dev
{ {
namespace julia namespace yul
{ {
/** /**

View File

@ -19,17 +19,17 @@
* in scope by a reference to that variable. * in scope by a reference to that variable.
*/ */
#include <libjulia/optimiser/CommonSubexpressionEliminator.h> #include <libyul/optimiser/CommonSubexpressionEliminator.h>
#include <libjulia/optimiser/Metrics.h> #include <libyul/optimiser/Metrics.h>
#include <libjulia/optimiser/SyntacticalEquality.h> #include <libyul/optimiser/SyntacticalEquality.h>
#include <libjulia/Exceptions.h> #include <libyul/Exceptions.h>
#include <libsolidity/inlineasm/AsmData.h> #include <libsolidity/inlineasm/AsmData.h>
using namespace std; using namespace std;
using namespace dev; using namespace dev;
using namespace dev::julia; using namespace dev::yul;
void CommonSubexpressionEliminator::visit(Expression& _e) void CommonSubexpressionEliminator::visit(Expression& _e)
{ {

View File

@ -21,11 +21,11 @@
#pragma once #pragma once
#include <libjulia/optimiser/DataFlowAnalyzer.h> #include <libyul/optimiser/DataFlowAnalyzer.h>
namespace dev namespace dev
{ {
namespace julia namespace yul
{ {
/** /**

View File

@ -20,11 +20,11 @@
* Common Subexpression Eliminator. * Common Subexpression Eliminator.
*/ */
#include <libjulia/optimiser/DataFlowAnalyzer.h> #include <libyul/optimiser/DataFlowAnalyzer.h>
#include <libjulia/optimiser/NameCollector.h> #include <libyul/optimiser/NameCollector.h>
#include <libjulia/optimiser/Semantics.h> #include <libyul/optimiser/Semantics.h>
#include <libjulia/Exceptions.h> #include <libyul/Exceptions.h>
#include <libsolidity/inlineasm/AsmData.h> #include <libsolidity/inlineasm/AsmData.h>
@ -34,7 +34,7 @@
using namespace std; using namespace std;
using namespace dev; using namespace dev;
using namespace dev::julia; using namespace dev::yul;
void DataFlowAnalyzer::operator()(Assignment& _assignment) void DataFlowAnalyzer::operator()(Assignment& _assignment)
{ {

View File

@ -22,7 +22,7 @@
#pragma once #pragma once
#include <libjulia/optimiser/ASTWalker.h> #include <libyul/optimiser/ASTWalker.h>
#include <string> #include <string>
#include <map> #include <map>
@ -30,7 +30,7 @@
namespace dev namespace dev
{ {
namespace julia namespace yul
{ {
/** /**

View File

@ -18,16 +18,16 @@
* Optimiser component that makes all identifiers unique. * Optimiser component that makes all identifiers unique.
*/ */
#include <libjulia/optimiser/Disambiguator.h> #include <libyul/optimiser/Disambiguator.h>
#include <libjulia/Exceptions.h> #include <libyul/Exceptions.h>
#include <libsolidity/inlineasm/AsmData.h> #include <libsolidity/inlineasm/AsmData.h>
#include <libsolidity/inlineasm/AsmScope.h> #include <libsolidity/inlineasm/AsmScope.h>
using namespace std; using namespace std;
using namespace dev; using namespace dev;
using namespace dev::julia; using namespace dev::yul;
using namespace dev::solidity; using namespace dev::solidity;
using Scope = dev::solidity::assembly::Scope; using Scope = dev::solidity::assembly::Scope;

View File

@ -20,10 +20,10 @@
#pragma once #pragma once
#include <libjulia/ASTDataForward.h> #include <libyul/ASTDataForward.h>
#include <libjulia/optimiser/ASTCopier.h> #include <libyul/optimiser/ASTCopier.h>
#include <libjulia/optimiser/NameDispenser.h> #include <libyul/optimiser/NameDispenser.h>
#include <libsolidity/inlineasm/AsmAnalysisInfo.h> #include <libsolidity/inlineasm/AsmAnalysisInfo.h>
@ -34,7 +34,7 @@
namespace dev namespace dev
{ {
namespace julia namespace yul
{ {
/** /**

View File

@ -18,11 +18,11 @@
* Optimiser component that performs function inlining inside expressions. * Optimiser component that performs function inlining inside expressions.
*/ */
#include <libjulia/optimiser/ExpressionInliner.h> #include <libyul/optimiser/ExpressionInliner.h>
#include <libjulia/optimiser/InlinableExpressionFunctionFinder.h> #include <libyul/optimiser/InlinableExpressionFunctionFinder.h>
#include <libjulia/optimiser/Substitution.h> #include <libyul/optimiser/Substitution.h>
#include <libjulia/optimiser/Semantics.h> #include <libyul/optimiser/Semantics.h>
#include <libsolidity/inlineasm/AsmData.h> #include <libsolidity/inlineasm/AsmData.h>
@ -30,7 +30,7 @@
using namespace std; using namespace std;
using namespace dev; using namespace dev;
using namespace dev::julia; using namespace dev::yul;
using namespace dev::solidity; using namespace dev::solidity;
void ExpressionInliner::run() void ExpressionInliner::run()

View File

@ -19,9 +19,9 @@
*/ */
#pragma once #pragma once
#include <libjulia/optimiser/ASTWalker.h> #include <libyul/optimiser/ASTWalker.h>
#include <libjulia/ASTDataForward.h> #include <libyul/ASTDataForward.h>
#include <boost/variant.hpp> #include <boost/variant.hpp>
#include <boost/optional.hpp> #include <boost/optional.hpp>
@ -30,7 +30,7 @@
namespace dev namespace dev
{ {
namespace julia namespace yul
{ {
/** /**

View File

@ -19,11 +19,11 @@
* it more or less inlines variable declarations. * it more or less inlines variable declarations.
*/ */
#include <libjulia/optimiser/ExpressionJoiner.h> #include <libyul/optimiser/ExpressionJoiner.h>
#include <libjulia/optimiser/NameCollector.h> #include <libyul/optimiser/NameCollector.h>
#include <libjulia/optimiser/Utilities.h> #include <libyul/optimiser/Utilities.h>
#include <libjulia/Exceptions.h> #include <libyul/Exceptions.h>
#include <libsolidity/inlineasm/AsmData.h> #include <libsolidity/inlineasm/AsmData.h>
@ -33,7 +33,7 @@
using namespace std; using namespace std;
using namespace dev; using namespace dev;
using namespace dev::julia; using namespace dev::yul;
using namespace dev::solidity; using namespace dev::solidity;
void ExpressionJoiner::operator()(FunctionalInstruction& _instruction) void ExpressionJoiner::operator()(FunctionalInstruction& _instruction)

View File

@ -20,15 +20,15 @@
*/ */
#pragma once #pragma once
#include <libjulia/ASTDataForward.h> #include <libyul/ASTDataForward.h>
#include <libjulia/optimiser/ASTWalker.h> #include <libyul/optimiser/ASTWalker.h>
#include <map> #include <map>
namespace dev namespace dev
{ {
namespace julia namespace yul
{ {
class NameCollector; class NameCollector;

View File

@ -18,10 +18,10 @@
* Optimiser component that uses the simplification rules to simplify expressions. * Optimiser component that uses the simplification rules to simplify expressions.
*/ */
#include <libjulia/optimiser/ExpressionSimplifier.h> #include <libyul/optimiser/ExpressionSimplifier.h>
#include <libjulia/optimiser/SimplificationRules.h> #include <libyul/optimiser/SimplificationRules.h>
#include <libjulia/optimiser/Semantics.h> #include <libyul/optimiser/Semantics.h>
#include <libsolidity/inlineasm/AsmData.h> #include <libsolidity/inlineasm/AsmData.h>
@ -29,7 +29,7 @@
using namespace std; using namespace std;
using namespace dev; using namespace dev;
using namespace dev::julia; using namespace dev::yul;
using namespace dev::solidity; using namespace dev::solidity;

View File

@ -20,13 +20,13 @@
#pragma once #pragma once
#include <libjulia/ASTDataForward.h> #include <libyul/ASTDataForward.h>
#include <libjulia/optimiser/ASTWalker.h> #include <libyul/optimiser/ASTWalker.h>
namespace dev namespace dev
{ {
namespace julia namespace yul
{ {
/** /**

View File

@ -19,9 +19,9 @@
* declarations. * declarations.
*/ */
#include <libjulia/optimiser/ExpressionSplitter.h> #include <libyul/optimiser/ExpressionSplitter.h>
#include <libjulia/optimiser/ASTWalker.h> #include <libyul/optimiser/ASTWalker.h>
#include <libsolidity/inlineasm/AsmData.h> #include <libsolidity/inlineasm/AsmData.h>
@ -31,7 +31,7 @@
using namespace std; using namespace std;
using namespace dev; using namespace dev;
using namespace dev::julia; using namespace dev::yul;
using namespace dev::solidity; using namespace dev::solidity;
void ExpressionSplitter::operator()(FunctionalInstruction& _instruction) void ExpressionSplitter::operator()(FunctionalInstruction& _instruction)

View File

@ -20,16 +20,16 @@
*/ */
#pragma once #pragma once
#include <libjulia/ASTDataForward.h> #include <libyul/ASTDataForward.h>
#include <libjulia/optimiser/ASTWalker.h> #include <libyul/optimiser/ASTWalker.h>
#include <libjulia/optimiser/NameDispenser.h> #include <libyul/optimiser/NameDispenser.h>
#include <vector> #include <vector>
namespace dev namespace dev
{ {
namespace julia namespace yul
{ {
class NameCollector; class NameCollector;

View File

@ -18,13 +18,13 @@
* Optimiser component that performs function inlining for arbitrary functions. * Optimiser component that performs function inlining for arbitrary functions.
*/ */
#include <libjulia/optimiser/FullInliner.h> #include <libyul/optimiser/FullInliner.h>
#include <libjulia/optimiser/ASTCopier.h> #include <libyul/optimiser/ASTCopier.h>
#include <libjulia/optimiser/ASTWalker.h> #include <libyul/optimiser/ASTWalker.h>
#include <libjulia/optimiser/NameCollector.h> #include <libyul/optimiser/NameCollector.h>
#include <libjulia/optimiser/Semantics.h> #include <libyul/optimiser/Semantics.h>
#include <libjulia/Exceptions.h> #include <libyul/Exceptions.h>
#include <libsolidity/inlineasm/AsmData.h> #include <libsolidity/inlineasm/AsmData.h>
@ -34,7 +34,7 @@
using namespace std; using namespace std;
using namespace dev; using namespace dev;
using namespace dev::julia; using namespace dev::yul;
using namespace dev::solidity; using namespace dev::solidity;
FullInliner::FullInliner(Block& _ast): FullInliner::FullInliner(Block& _ast):

View File

@ -19,12 +19,12 @@
*/ */
#pragma once #pragma once
#include <libjulia/ASTDataForward.h> #include <libyul/ASTDataForward.h>
#include <libjulia/optimiser/ASTCopier.h> #include <libyul/optimiser/ASTCopier.h>
#include <libjulia/optimiser/ASTWalker.h> #include <libyul/optimiser/ASTWalker.h>
#include <libjulia/optimiser/NameDispenser.h> #include <libyul/optimiser/NameDispenser.h>
#include <libjulia/Exceptions.h> #include <libyul/Exceptions.h>
#include <libevmasm/SourceLocation.h> #include <libevmasm/SourceLocation.h>
@ -35,7 +35,7 @@
namespace dev namespace dev
{ {
namespace julia namespace yul
{ {
class NameCollector; class NameCollector;

View File

@ -19,7 +19,7 @@
* statements are moved to a block of their own followed by all function definitions. * statements are moved to a block of their own followed by all function definitions.
*/ */
#include <libjulia/optimiser/FunctionGrouper.h> #include <libyul/optimiser/FunctionGrouper.h>
#include <libsolidity/inlineasm/AsmData.h> #include <libsolidity/inlineasm/AsmData.h>
@ -27,7 +27,7 @@
using namespace std; using namespace std;
using namespace dev; using namespace dev;
using namespace dev::julia; using namespace dev::yul;
using namespace dev::solidity; using namespace dev::solidity;

View File

@ -21,11 +21,11 @@
#pragma once #pragma once
#include <libjulia/ASTDataForward.h> #include <libyul/ASTDataForward.h>
namespace dev namespace dev
{ {
namespace julia namespace yul
{ {
/** /**

View File

@ -20,8 +20,8 @@
* anywhere else. * anywhere else.
*/ */
#include <libjulia/optimiser/FunctionHoister.h> #include <libyul/optimiser/FunctionHoister.h>
#include <libjulia/optimiser/Utilities.h> #include <libyul/optimiser/Utilities.h>
#include <libsolidity/inlineasm/AsmData.h> #include <libsolidity/inlineasm/AsmData.h>
@ -29,7 +29,7 @@
using namespace std; using namespace std;
using namespace dev; using namespace dev;
using namespace dev::julia; using namespace dev::yul;
using namespace dev::solidity; using namespace dev::solidity;
void FunctionHoister::operator()(Block& _block) void FunctionHoister::operator()(Block& _block)

View File

@ -21,13 +21,13 @@
#pragma once #pragma once
#include <libjulia/ASTDataForward.h> #include <libyul/ASTDataForward.h>
#include <libjulia/optimiser/ASTWalker.h> #include <libyul/optimiser/ASTWalker.h>
namespace dev namespace dev
{ {
namespace julia namespace yul
{ {
/** /**

View File

@ -18,15 +18,15 @@
* Optimiser component that identifies functions to be inlined. * Optimiser component that identifies functions to be inlined.
*/ */
#include <libjulia/optimiser/InlinableExpressionFunctionFinder.h> #include <libyul/optimiser/InlinableExpressionFunctionFinder.h>
#include <libjulia/optimiser/Utilities.h> #include <libyul/optimiser/Utilities.h>
#include <libsolidity/inlineasm/AsmData.h> #include <libsolidity/inlineasm/AsmData.h>
using namespace std; using namespace std;
using namespace dev; using namespace dev;
using namespace dev::julia; using namespace dev::yul;
void InlinableExpressionFunctionFinder::operator()(Identifier const& _identifier) void InlinableExpressionFunctionFinder::operator()(Identifier const& _identifier)
{ {

View File

@ -20,14 +20,14 @@
#pragma once #pragma once
#include <libjulia/ASTDataForward.h> #include <libyul/ASTDataForward.h>
#include <libjulia/optimiser/ASTWalker.h> #include <libyul/optimiser/ASTWalker.h>
#include <set> #include <set>
namespace dev namespace dev
{ {
namespace julia namespace yul
{ {
/** /**

View File

@ -19,10 +19,10 @@
* inputs nor outputs. * inputs nor outputs.
*/ */
#include <libjulia/optimiser/MainFunction.h> #include <libyul/optimiser/MainFunction.h>
#include <libjulia/optimiser/NameCollector.h> #include <libyul/optimiser/NameCollector.h>
#include <libjulia/Exceptions.h> #include <libyul/Exceptions.h>
#include <libsolidity/inlineasm/AsmData.h> #include <libsolidity/inlineasm/AsmData.h>
@ -30,7 +30,7 @@
using namespace std; using namespace std;
using namespace dev; using namespace dev;
using namespace dev::julia; using namespace dev::yul;
using namespace dev::solidity; using namespace dev::solidity;
void MainFunction::operator()(Block& _block) void MainFunction::operator()(Block& _block)

View File

@ -21,11 +21,11 @@
#pragma once #pragma once
#include <libjulia/ASTDataForward.h> #include <libyul/ASTDataForward.h>
namespace dev namespace dev
{ {
namespace julia namespace yul
{ {
/** /**

View File

@ -18,12 +18,12 @@
* Module providing metrics for the optimizer. * Module providing metrics for the optimizer.
*/ */
#include <libjulia/optimiser/Metrics.h> #include <libyul/optimiser/Metrics.h>
#include <libsolidity/inlineasm/AsmData.h> #include <libsolidity/inlineasm/AsmData.h>
using namespace dev; using namespace dev;
using namespace dev::julia; using namespace dev::yul;
size_t CodeSize::codeSize(Statement const& _statement) size_t CodeSize::codeSize(Statement const& _statement)
{ {

View File

@ -20,11 +20,11 @@
#pragma once #pragma once
#include <libjulia/optimiser/ASTWalker.h> #include <libyul/optimiser/ASTWalker.h>
namespace dev namespace dev
{ {
namespace julia namespace yul
{ {
class CodeSize: public ASTWalker class CodeSize: public ASTWalker

View File

@ -18,13 +18,13 @@
* Specific AST walker that collects all defined names. * Specific AST walker that collects all defined names.
*/ */
#include <libjulia/optimiser/NameCollector.h> #include <libyul/optimiser/NameCollector.h>
#include <libsolidity/inlineasm/AsmData.h> #include <libsolidity/inlineasm/AsmData.h>
using namespace std; using namespace std;
using namespace dev; using namespace dev;
using namespace dev::julia; using namespace dev::yul;
void NameCollector::operator()(VariableDeclaration const& _varDecl) void NameCollector::operator()(VariableDeclaration const& _varDecl)
{ {

View File

@ -20,7 +20,7 @@
#pragma once #pragma once
#include <libjulia/optimiser/ASTWalker.h> #include <libyul/optimiser/ASTWalker.h>
#include <string> #include <string>
#include <map> #include <map>
@ -28,7 +28,7 @@
namespace dev namespace dev
{ {
namespace julia namespace yul
{ {
/** /**

View File

@ -18,11 +18,11 @@
* Optimiser component that can create new unique names. * Optimiser component that can create new unique names.
*/ */
#include <libjulia/optimiser/NameDispenser.h> #include <libyul/optimiser/NameDispenser.h>
using namespace std; using namespace std;
using namespace dev; using namespace dev;
using namespace dev::julia; using namespace dev::yul;
string NameDispenser::newName(string const& _prefix) string NameDispenser::newName(string const& _prefix)
{ {

View File

@ -24,7 +24,7 @@
namespace dev namespace dev
{ {
namespace julia namespace yul
{ {
struct NameDispenser struct NameDispenser

View File

@ -18,17 +18,17 @@
* Optimisation stage that replaces variables by their most recently assigned expressions. * Optimisation stage that replaces variables by their most recently assigned expressions.
*/ */
#include <libjulia/optimiser/Rematerialiser.h> #include <libyul/optimiser/Rematerialiser.h>
#include <libjulia/optimiser/Metrics.h> #include <libyul/optimiser/Metrics.h>
#include <libjulia/optimiser/ASTCopier.h> #include <libyul/optimiser/ASTCopier.h>
#include <libjulia/Exceptions.h> #include <libyul/Exceptions.h>
#include <libsolidity/inlineasm/AsmData.h> #include <libsolidity/inlineasm/AsmData.h>
using namespace std; using namespace std;
using namespace dev; using namespace dev;
using namespace dev::julia; using namespace dev::yul;
void Rematerialiser::visit(Expression& _e) void Rematerialiser::visit(Expression& _e)
{ {

View File

@ -20,7 +20,7 @@
#pragma once #pragma once
#include <libjulia/optimiser/DataFlowAnalyzer.h> #include <libyul/optimiser/DataFlowAnalyzer.h>
#include <string> #include <string>
#include <map> #include <map>
@ -28,7 +28,7 @@
namespace dev namespace dev
{ {
namespace julia namespace yul
{ {
/** /**

View File

@ -18,9 +18,9 @@
* Specific AST walkers that collect semantical facts. * Specific AST walkers that collect semantical facts.
*/ */
#include <libjulia/optimiser/Semantics.h> #include <libyul/optimiser/Semantics.h>
#include <libjulia/Exceptions.h> #include <libyul/Exceptions.h>
#include <libsolidity/inlineasm/AsmData.h> #include <libsolidity/inlineasm/AsmData.h>
@ -30,7 +30,7 @@
using namespace std; using namespace std;
using namespace dev; using namespace dev;
using namespace dev::julia; using namespace dev::yul;
MovableChecker::MovableChecker(Expression const& _expression) MovableChecker::MovableChecker(Expression const& _expression)
{ {

View File

@ -20,7 +20,7 @@
#pragma once #pragma once
#include <libjulia/optimiser/ASTWalker.h> #include <libyul/optimiser/ASTWalker.h>
#include <string> #include <string>
#include <map> #include <map>
@ -28,7 +28,7 @@
namespace dev namespace dev
{ {
namespace julia namespace yul
{ {
/** /**

View File

@ -18,12 +18,12 @@
* Module for applying replacement rules against Expressions. * Module for applying replacement rules against Expressions.
*/ */
#include <libjulia/optimiser/SimplificationRules.h> #include <libyul/optimiser/SimplificationRules.h>
#include <libjulia/optimiser/Utilities.h> #include <libyul/optimiser/Utilities.h>
#include <libjulia/optimiser/ASTCopier.h> #include <libyul/optimiser/ASTCopier.h>
#include <libjulia/optimiser/Semantics.h> #include <libyul/optimiser/Semantics.h>
#include <libjulia/optimiser/SyntacticalEquality.h> #include <libyul/optimiser/SyntacticalEquality.h>
#include <libsolidity/inlineasm/AsmData.h> #include <libsolidity/inlineasm/AsmData.h>
@ -31,7 +31,7 @@
using namespace std; using namespace std;
using namespace dev; using namespace dev;
using namespace dev::julia; using namespace dev::yul;
SimplificationRule<Pattern> const* SimplificationRules::findFirstMatch(Expression const& _expr) SimplificationRule<Pattern> const* SimplificationRules::findFirstMatch(Expression const& _expr)

View File

@ -23,7 +23,7 @@
#include <libevmasm/ExpressionClasses.h> #include <libevmasm/ExpressionClasses.h>
#include <libevmasm/SimplificationRule.h> #include <libevmasm/SimplificationRule.h>
#include <libjulia/ASTDataForward.h> #include <libyul/ASTDataForward.h>
#include <libsolidity/inlineasm/AsmData.h> #include <libsolidity/inlineasm/AsmData.h>
@ -34,7 +34,7 @@
namespace dev namespace dev
{ {
namespace julia namespace yul
{ {
class Pattern; class Pattern;

View File

@ -18,13 +18,13 @@
* Specific AST copier that replaces certain identifiers with expressions. * Specific AST copier that replaces certain identifiers with expressions.
*/ */
#include <libjulia/optimiser/Substitution.h> #include <libyul/optimiser/Substitution.h>
#include <libsolidity/inlineasm/AsmData.h> #include <libsolidity/inlineasm/AsmData.h>
using namespace std; using namespace std;
using namespace dev; using namespace dev;
using namespace dev::julia; using namespace dev::yul;
Expression Substitution::translate(Expression const& _expression) Expression Substitution::translate(Expression const& _expression)
{ {

View File

@ -20,7 +20,7 @@
#pragma once #pragma once
#include <libjulia/optimiser/ASTCopier.h> #include <libyul/optimiser/ASTCopier.h>
#include <string> #include <string>
#include <map> #include <map>
@ -28,7 +28,7 @@
namespace dev namespace dev
{ {
namespace julia namespace yul
{ {
/** /**

View File

@ -18,9 +18,9 @@
* Component that can compare ASTs for equality on a syntactic basis. * Component that can compare ASTs for equality on a syntactic basis.
*/ */
#include <libjulia/optimiser/SyntacticalEquality.h> #include <libyul/optimiser/SyntacticalEquality.h>
#include <libjulia/Exceptions.h> #include <libyul/Exceptions.h>
#include <libsolidity/inlineasm/AsmData.h> #include <libsolidity/inlineasm/AsmData.h>
@ -28,7 +28,7 @@
using namespace std; using namespace std;
using namespace dev; using namespace dev;
using namespace dev::julia; using namespace dev::yul;
bool SyntacticalEqualityChecker::equal(Expression const& _e1, Expression const& _e2) bool SyntacticalEqualityChecker::equal(Expression const& _e1, Expression const& _e2)
{ {

View File

@ -20,13 +20,13 @@
#pragma once #pragma once
#include <libjulia/ASTDataForward.h> #include <libyul/ASTDataForward.h>
#include <vector> #include <vector>
namespace dev namespace dev
{ {
namespace julia namespace yul
{ {
/** /**

View File

@ -18,12 +18,12 @@
* Optimisation stage that removes unused variables and functions. * Optimisation stage that removes unused variables and functions.
*/ */
#include <libjulia/optimiser/UnusedPruner.h> #include <libyul/optimiser/UnusedPruner.h>
#include <libjulia/optimiser/NameCollector.h> #include <libyul/optimiser/NameCollector.h>
#include <libjulia/optimiser/Semantics.h> #include <libyul/optimiser/Semantics.h>
#include <libjulia/optimiser/Utilities.h> #include <libyul/optimiser/Utilities.h>
#include <libjulia/Exceptions.h> #include <libyul/Exceptions.h>
#include <libsolidity/inlineasm/AsmData.h> #include <libsolidity/inlineasm/AsmData.h>
@ -31,7 +31,7 @@
using namespace std; using namespace std;
using namespace dev; using namespace dev;
using namespace dev::julia; using namespace dev::yul;
UnusedPruner::UnusedPruner(Block& _ast) UnusedPruner::UnusedPruner(Block& _ast)
{ {

View File

@ -20,7 +20,7 @@
#pragma once #pragma once
#include <libjulia/optimiser/ASTWalker.h> #include <libyul/optimiser/ASTWalker.h>
#include <string> #include <string>
#include <map> #include <map>
@ -28,7 +28,7 @@
namespace dev namespace dev
{ {
namespace julia namespace yul
{ {
/** /**

View File

@ -18,7 +18,7 @@
* Some useful snippets for the optimiser. * Some useful snippets for the optimiser.
*/ */
#include <libjulia/optimiser/Utilities.h> #include <libyul/optimiser/Utilities.h>
#include <libsolidity/inlineasm/AsmData.h> #include <libsolidity/inlineasm/AsmData.h>
@ -28,9 +28,9 @@
using namespace std; using namespace std;
using namespace dev; using namespace dev;
using namespace dev::julia; using namespace dev::yul;
void dev::julia::removeEmptyBlocks(Block& _block) void dev::yul::removeEmptyBlocks(Block& _block)
{ {
auto isEmptyBlock = [](Statement const& _st) -> bool { auto isEmptyBlock = [](Statement const& _st) -> bool {
return _st.type() == typeid(Block) && boost::get<Block>(_st).statements.empty(); return _st.type() == typeid(Block) && boost::get<Block>(_st).statements.empty();

View File

@ -20,11 +20,11 @@
#pragma once #pragma once
#include <libjulia/ASTDataForward.h> #include <libyul/ASTDataForward.h>
namespace dev namespace dev
{ {
namespace julia namespace yul
{ {
/// Removes statements that are just empty blocks (non-recursive). /// Removes statements that are just empty blocks (non-recursive).

View File

@ -7,8 +7,8 @@ file(GLOB libdevcore_sources "libdevcore/*.cpp")
file(GLOB libdevcore_headers "libdevcore/*.h") file(GLOB libdevcore_headers "libdevcore/*.h")
file(GLOB libevmasm_sources "libevmasm/*.cpp") file(GLOB libevmasm_sources "libevmasm/*.cpp")
file(GLOB libevmasm_headers "libevmasm/*.h") file(GLOB libevmasm_headers "libevmasm/*.h")
file(GLOB libjulia_sources "libjulia/*.cpp") file(GLOB libyul_sources "libyul/*.cpp")
file(GLOB libjulia_headers "libjulia/*.h") file(GLOB libyul_headers "libyul/*.h")
file(GLOB liblll_sources "liblll/*.cpp") file(GLOB liblll_sources "liblll/*.cpp")
file(GLOB liblll_headers "liblll/*.h") file(GLOB liblll_headers "liblll/*.h")
file(GLOB libsolidity_sources "libsolidity/*.cpp") file(GLOB libsolidity_sources "libsolidity/*.cpp")
@ -18,7 +18,7 @@ add_executable(soltest ${sources} ${headers}
${contracts_sources} ${contracts_headers} ${contracts_sources} ${contracts_headers}
${libdevcore_sources} ${libdevcore_headers} ${libdevcore_sources} ${libdevcore_headers}
${libevmasm_sources} ${libevmasm_headers} ${libevmasm_sources} ${libevmasm_headers}
${libjulia_sources} ${libjulia_headers} ${libyul_sources} ${libyul_headers}
${liblll_sources} ${liblll_headers} ${liblll_sources} ${liblll_headers}
${libsolidity_sources} ${libsolidity_headers} ${libsolidity_sources} ${libsolidity_headers}
) )

View File

@ -38,7 +38,7 @@
#include <test/Options.h> #include <test/Options.h>
#include <test/libsolidity/ASTJSONTest.h> #include <test/libsolidity/ASTJSONTest.h>
#include <test/libsolidity/SyntaxTest.h> #include <test/libsolidity/SyntaxTest.h>
#include <test/libjulia/YulOptimizerTest.h> #include <test/libyul/YulOptimizerTest.h>
#include <boost/algorithm/string.hpp> #include <boost/algorithm/string.hpp>
#include <boost/algorithm/string/predicate.hpp> #include <boost/algorithm/string/predicate.hpp>
@ -141,9 +141,9 @@ test_suite* init_unit_test_suite( int /*argc*/, char* /*argv*/[] )
) > 0, "no JSON AST tests found"); ) > 0, "no JSON AST tests found");
solAssert(registerTests( solAssert(registerTests(
master, master,
dev::test::Options::get().testPath / "libjulia", dev::test::Options::get().testPath / "libyul",
"yulOptimizerTests", "yulOptimizerTests",
dev::julia::test::YulOptimizerTest::create dev::yul::test::YulOptimizerTest::create
) > 0, "no Yul Optimizer tests found"); ) > 0, "no Yul Optimizer tests found");
if (dev::test::Options::get().disableIPC) if (dev::test::Options::get().disableIPC)
{ {

View File

@ -19,11 +19,11 @@
* Common functions the Yul tests. * Common functions the Yul tests.
*/ */
#include <test/libjulia/Common.h> #include <test/libyul/Common.h>
#include <test/Options.h> #include <test/Options.h>
#include <libjulia/optimiser/Disambiguator.h> #include <libyul/optimiser/Disambiguator.h>
#include <libsolidity/parsing/Scanner.h> #include <libsolidity/parsing/Scanner.h>
@ -37,10 +37,10 @@
#include <boost/test/unit_test.hpp> #include <boost/test/unit_test.hpp>
using namespace std; using namespace std;
using namespace dev::julia; using namespace dev::yul;
using namespace dev::solidity; using namespace dev::solidity;
void dev::julia::test::printErrors(ErrorList const& _errors, Scanner const& _scanner) void dev::yul::test::printErrors(ErrorList const& _errors, Scanner const& _scanner)
{ {
SourceReferenceFormatter formatter(cout, [&](std::string const&) -> Scanner const& { return _scanner; }); SourceReferenceFormatter formatter(cout, [&](std::string const&) -> Scanner const& { return _scanner; });
@ -52,7 +52,7 @@ void dev::julia::test::printErrors(ErrorList const& _errors, Scanner const& _sca
} }
pair<shared_ptr<Block>, shared_ptr<assembly::AsmAnalysisInfo>> dev::julia::test::parse(string const& _source, bool _yul) pair<shared_ptr<Block>, shared_ptr<assembly::AsmAnalysisInfo>> dev::yul::test::parse(string const& _source, bool _yul)
{ {
auto flavour = _yul ? assembly::AsmFlavour::Yul : assembly::AsmFlavour::Strict; auto flavour = _yul ? assembly::AsmFlavour::Yul : assembly::AsmFlavour::Strict;
ErrorList errors; ErrorList errors;
@ -83,13 +83,13 @@ pair<shared_ptr<Block>, shared_ptr<assembly::AsmAnalysisInfo>> dev::julia::test:
return {}; return {};
} }
assembly::Block dev::julia::test::disambiguate(string const& _source, bool _yul) assembly::Block dev::yul::test::disambiguate(string const& _source, bool _yul)
{ {
auto result = parse(_source, _yul); auto result = parse(_source, _yul);
return boost::get<Block>(Disambiguator(*result.second)(*result.first)); return boost::get<Block>(Disambiguator(*result.second)(*result.first));
} }
string dev::julia::test::format(string const& _source, bool _yul) string dev::yul::test::format(string const& _source, bool _yul)
{ {
return assembly::AsmPrinter(_yul)(*parse(_source, _yul).first); return assembly::AsmPrinter(_yul)(*parse(_source, _yul).first);
} }

View File

@ -39,7 +39,7 @@ namespace assembly
struct AsmAnalysisInfo; struct AsmAnalysisInfo;
} }
} }
namespace julia namespace yul
{ {
namespace test namespace test
{ {

View File

@ -19,13 +19,13 @@
* Unit tests for the Yul function inliner. * Unit tests for the Yul function inliner.
*/ */
#include <test/libjulia/Common.h> #include <test/libyul/Common.h>
#include <libjulia/optimiser/ExpressionInliner.h> #include <libyul/optimiser/ExpressionInliner.h>
#include <libjulia/optimiser/InlinableExpressionFunctionFinder.h> #include <libyul/optimiser/InlinableExpressionFunctionFinder.h>
#include <libjulia/optimiser/FullInliner.h> #include <libyul/optimiser/FullInliner.h>
#include <libjulia/optimiser/FunctionHoister.h> #include <libyul/optimiser/FunctionHoister.h>
#include <libjulia/optimiser/FunctionGrouper.h> #include <libyul/optimiser/FunctionGrouper.h>
#include <libsolidity/inlineasm/AsmPrinter.h> #include <libsolidity/inlineasm/AsmPrinter.h>
@ -36,8 +36,8 @@
using namespace std; using namespace std;
using namespace dev; using namespace dev;
using namespace dev::julia; using namespace dev::yul;
using namespace dev::julia::test; using namespace dev::yul::test;
using namespace dev::solidity; using namespace dev::solidity;
namespace namespace

View File

@ -15,25 +15,25 @@
along with solidity. If not, see <http://www.gnu.org/licenses/>. along with solidity. If not, see <http://www.gnu.org/licenses/>.
*/ */
#include <test/libjulia/YulOptimizerTest.h> #include <test/libyul/YulOptimizerTest.h>
#include <test/libsolidity/FormattedScope.h> #include <test/libsolidity/FormattedScope.h>
#include <test/Options.h> #include <test/Options.h>
#include <libjulia/optimiser/Disambiguator.h> #include <libyul/optimiser/Disambiguator.h>
#include <libjulia/optimiser/CommonSubexpressionEliminator.h> #include <libyul/optimiser/CommonSubexpressionEliminator.h>
#include <libjulia/optimiser/NameCollector.h> #include <libyul/optimiser/NameCollector.h>
#include <libjulia/optimiser/ExpressionSplitter.h> #include <libyul/optimiser/ExpressionSplitter.h>
#include <libjulia/optimiser/FunctionGrouper.h> #include <libyul/optimiser/FunctionGrouper.h>
#include <libjulia/optimiser/FunctionHoister.h> #include <libyul/optimiser/FunctionHoister.h>
#include <libjulia/optimiser/ExpressionInliner.h> #include <libyul/optimiser/ExpressionInliner.h>
#include <libjulia/optimiser/FullInliner.h> #include <libyul/optimiser/FullInliner.h>
#include <libjulia/optimiser/MainFunction.h> #include <libyul/optimiser/MainFunction.h>
#include <libjulia/optimiser/Rematerialiser.h> #include <libyul/optimiser/Rematerialiser.h>
#include <libjulia/optimiser/ExpressionSimplifier.h> #include <libyul/optimiser/ExpressionSimplifier.h>
#include <libjulia/optimiser/UnusedPruner.h> #include <libyul/optimiser/UnusedPruner.h>
#include <libjulia/optimiser/ExpressionJoiner.h> #include <libyul/optimiser/ExpressionJoiner.h>
#include <libsolidity/parsing/Scanner.h> #include <libsolidity/parsing/Scanner.h>
#include <libsolidity/inlineasm/AsmPrinter.h> #include <libsolidity/inlineasm/AsmPrinter.h>
@ -48,8 +48,8 @@
#include <fstream> #include <fstream>
using namespace dev; using namespace dev;
using namespace dev::julia; using namespace dev::yul;
using namespace dev::julia::test; using namespace dev::yul::test;
using namespace dev::solidity; using namespace dev::solidity;
using namespace dev::solidity::test; using namespace dev::solidity::test;
using namespace std; using namespace std;

View File

@ -33,7 +33,7 @@ struct AsmAnalysisInfo;
struct Block; struct Block;
} }
} }
namespace julia namespace yul
{ {
namespace test namespace test
{ {

Some files were not shown because too many files have changed in this diff Show More