From 1304361b9c48438d5c55903492b5f11c3dac73e5 Mon Sep 17 00:00:00 2001 From: Christian Parpart Date: Mon, 15 Oct 2018 11:58:51 +0200 Subject: [PATCH] Renaming namespace dev::julia to dev::yul. --- libsolidity/analysis/ReferencesResolver.cpp | 4 ++-- libsolidity/analysis/TypeChecker.cpp | 10 +++++----- libsolidity/codegen/CompilerContext.cpp | 12 ++++++------ libsolidity/codegen/ContractCompiler.cpp | 8 ++++---- libsolidity/inlineasm/AsmAnalysis.cpp | 4 ++-- libsolidity/inlineasm/AsmAnalysis.h | 4 ++-- libsolidity/inlineasm/AsmCodeGen.cpp | 6 +++--- libsolidity/inlineasm/AsmCodeGen.h | 2 +- libsolidity/interface/AssemblyStack.cpp | 4 ++-- libyul/ASTDataForward.h | 2 +- libyul/Exceptions.h | 2 +- libyul/backends/evm/AbstractAssembly.h | 4 ++-- libyul/backends/evm/EVMAssembly.cpp | 2 +- libyul/backends/evm/EVMAssembly.h | 2 +- libyul/backends/evm/EVMCodeTransform.cpp | 2 +- libyul/backends/evm/EVMCodeTransform.h | 8 ++++---- libyul/optimiser/ASTCopier.cpp | 2 +- libyul/optimiser/ASTCopier.h | 2 +- libyul/optimiser/ASTWalker.cpp | 2 +- libyul/optimiser/ASTWalker.h | 2 +- libyul/optimiser/CommonSubexpressionEliminator.cpp | 2 +- libyul/optimiser/CommonSubexpressionEliminator.h | 2 +- libyul/optimiser/DataFlowAnalyzer.cpp | 2 +- libyul/optimiser/DataFlowAnalyzer.h | 2 +- libyul/optimiser/Disambiguator.cpp | 2 +- libyul/optimiser/Disambiguator.h | 2 +- libyul/optimiser/ExpressionInliner.cpp | 2 +- libyul/optimiser/ExpressionInliner.h | 2 +- libyul/optimiser/ExpressionJoiner.cpp | 2 +- libyul/optimiser/ExpressionJoiner.h | 2 +- libyul/optimiser/ExpressionSimplifier.cpp | 2 +- libyul/optimiser/ExpressionSimplifier.h | 2 +- libyul/optimiser/ExpressionSplitter.cpp | 2 +- libyul/optimiser/ExpressionSplitter.h | 2 +- libyul/optimiser/FullInliner.cpp | 2 +- libyul/optimiser/FullInliner.h | 2 +- libyul/optimiser/FunctionGrouper.cpp | 2 +- libyul/optimiser/FunctionGrouper.h | 2 +- libyul/optimiser/FunctionHoister.cpp | 2 +- libyul/optimiser/FunctionHoister.h | 2 +- .../optimiser/InlinableExpressionFunctionFinder.cpp | 2 +- libyul/optimiser/InlinableExpressionFunctionFinder.h | 2 +- libyul/optimiser/MainFunction.cpp | 2 +- libyul/optimiser/MainFunction.h | 2 +- libyul/optimiser/Metrics.cpp | 2 +- libyul/optimiser/Metrics.h | 2 +- libyul/optimiser/NameCollector.cpp | 2 +- libyul/optimiser/NameCollector.h | 2 +- libyul/optimiser/NameDispenser.cpp | 2 +- libyul/optimiser/NameDispenser.h | 2 +- libyul/optimiser/Rematerialiser.cpp | 2 +- libyul/optimiser/Rematerialiser.h | 2 +- libyul/optimiser/Semantics.cpp | 2 +- libyul/optimiser/Semantics.h | 2 +- libyul/optimiser/SimplificationRules.cpp | 2 +- libyul/optimiser/SimplificationRules.h | 2 +- libyul/optimiser/Substitution.cpp | 2 +- libyul/optimiser/Substitution.h | 2 +- libyul/optimiser/SyntacticalEquality.cpp | 2 +- libyul/optimiser/SyntacticalEquality.h | 2 +- libyul/optimiser/UnusedPruner.cpp | 2 +- libyul/optimiser/UnusedPruner.h | 2 +- libyul/optimiser/Utilities.cpp | 4 ++-- libyul/optimiser/Utilities.h | 2 +- test/boostTest.cpp | 2 +- test/libyul/Common.cpp | 10 +++++----- test/libyul/Common.h | 2 +- test/libyul/Inliner.cpp | 4 ++-- test/libyul/YulOptimizerTest.cpp | 4 ++-- test/libyul/YulOptimizerTest.h | 2 +- test/tools/isoltest.cpp | 2 +- 71 files changed, 100 insertions(+), 100 deletions(-) diff --git a/libsolidity/analysis/ReferencesResolver.cpp b/libsolidity/analysis/ReferencesResolver.cpp index 81de3c437..f62d9c3bb 100644 --- a/libsolidity/analysis/ReferencesResolver.cpp +++ b/libsolidity/analysis/ReferencesResolver.cpp @@ -269,8 +269,8 @@ bool ReferencesResolver::visit(InlineAssembly const& _inlineAssembly) // external references. ErrorList errors; ErrorReporter errorsIgnored(errors); - julia::ExternalIdentifierAccess::Resolver resolver = - [&](assembly::Identifier const& _identifier, julia::IdentifierContext, bool _crossesFunctionBoundary) { + yul::ExternalIdentifierAccess::Resolver resolver = + [&](assembly::Identifier const& _identifier, yul::IdentifierContext, bool _crossesFunctionBoundary) { auto declarations = m_resolver.nameFromCurrentScope(_identifier.name); bool isSlot = boost::algorithm::ends_with(_identifier.name, "_slot"); bool isOffset = boost::algorithm::ends_with(_identifier.name, "_offset"); diff --git a/libsolidity/analysis/TypeChecker.cpp b/libsolidity/analysis/TypeChecker.cpp index 164b0b022..3830935f5 100644 --- a/libsolidity/analysis/TypeChecker.cpp +++ b/libsolidity/analysis/TypeChecker.cpp @@ -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. // We run the resolve step again regardless. - julia::ExternalIdentifierAccess::Resolver identifierAccess = [&]( + yul::ExternalIdentifierAccess::Resolver identifierAccess = [&]( assembly::Identifier const& _identifier, - julia::IdentifierContext _context, + yul::IdentifierContext _context, 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."); 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."); 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."); 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."); 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."); if (dynamic_cast(declaration)) diff --git a/libsolidity/codegen/CompilerContext.cpp b/libsolidity/codegen/CompilerContext.cpp index 71b615b8b..089386b56 100644 --- a/libsolidity/codegen/CompilerContext.cpp +++ b/libsolidity/codegen/CompilerContext.cpp @@ -318,10 +318,10 @@ void CompilerContext::appendInlineAssembly( { int startStackHeight = stackHeight(); - julia::ExternalIdentifierAccess identifierAccess; + yul::ExternalIdentifierAccess identifierAccess; identifierAccess.resolve = [&]( assembly::Identifier const& _identifier, - julia::IdentifierContext, + yul::IdentifierContext, bool ) { @@ -330,15 +330,15 @@ void CompilerContext::appendInlineAssembly( }; identifierAccess.generateCode = [&]( assembly::Identifier const& _identifier, - julia::IdentifierContext _context, - julia::AbstractAssembly& _assembly + yul::IdentifierContext _context, + yul::AbstractAssembly& _assembly ) { auto it = std::find(_localVariables.begin(), _localVariables.end(), _identifier.name); solAssert(it != _localVariables.end(), ""); int stackDepth = _localVariables.end() - it; int stackDiff = _assembly.stackHeight() - startStackHeight + stackDepth; - if (_context == julia::IdentifierContext::LValue) + if (_context == yul::IdentifierContext::LValue) stackDiff -= 1; if (stackDiff < 1 || stackDiff > 16) BOOST_THROW_EXCEPTION( @@ -346,7 +346,7 @@ void CompilerContext::appendInlineAssembly( errinfo_sourceLocation(_identifier.location) << 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)); else { diff --git a/libsolidity/codegen/ContractCompiler.cpp b/libsolidity/codegen/ContractCompiler.cpp index 3a0fccfb8..c845da8f7 100644 --- a/libsolidity/codegen/ContractCompiler.cpp +++ b/libsolidity/codegen/ContractCompiler.cpp @@ -494,21 +494,21 @@ bool ContractCompiler::visit(FunctionDefinition const& _function) bool ContractCompiler::visit(InlineAssembly const& _inlineAssembly) { unsigned startStackHeight = m_context.stackHeight(); - julia::ExternalIdentifierAccess identifierAccess; - identifierAccess.resolve = [&](assembly::Identifier const& _identifier, julia::IdentifierContext, bool) + yul::ExternalIdentifierAccess identifierAccess; + identifierAccess.resolve = [&](assembly::Identifier const& _identifier, yul::IdentifierContext, bool) { auto ref = _inlineAssembly.annotation().externalReferences.find(&_identifier); if (ref == _inlineAssembly.annotation().externalReferences.end()) return size_t(-1); 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); solAssert(ref != _inlineAssembly.annotation().externalReferences.end(), ""); Declaration const* decl = ref->second.declaration; solAssert(!!decl, ""); - if (_context == julia::IdentifierContext::RValue) + if (_context == yul::IdentifierContext::RValue) { int const depositBefore = _assembly.stackHeight(); solAssert(!!decl->type(), "Type of declaration required but not yet determined."); diff --git a/libsolidity/inlineasm/AsmAnalysis.cpp b/libsolidity/inlineasm/AsmAnalysis.cpp index 947b6d059..04b5d1a8b 100644 --- a/libsolidity/inlineasm/AsmAnalysis.cpp +++ b/libsolidity/inlineasm/AsmAnalysis.cpp @@ -145,7 +145,7 @@ bool AsmAnalyzer::operator()(assembly::Identifier const& _identifier) if (m_resolver) { 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)) { @@ -512,7 +512,7 @@ bool AsmAnalyzer::checkAssignment(assembly::Identifier const& _variable, size_t else if (m_resolver) { 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)) { diff --git a/libsolidity/inlineasm/AsmAnalysis.h b/libsolidity/inlineasm/AsmAnalysis.h index fd5c6ac7a..a8673efa5 100644 --- a/libsolidity/inlineasm/AsmAnalysis.h +++ b/libsolidity/inlineasm/AsmAnalysis.h @@ -59,7 +59,7 @@ public: EVMVersion _evmVersion, boost::optional _errorTypeForLoose, AsmFlavour _flavour = AsmFlavour::Loose, - julia::ExternalIdentifierAccess::Resolver const& _resolver = julia::ExternalIdentifierAccess::Resolver() + yul::ExternalIdentifierAccess::Resolver const& _resolver = yul::ExternalIdentifierAccess::Resolver() ): m_resolver(_resolver), m_info(_analysisInfo), @@ -106,7 +106,7 @@ private: void checkLooseFeature(SourceLocation const& _location, std::string const& _description); int m_stackHeight = 0; - julia::ExternalIdentifierAccess::Resolver m_resolver; + yul::ExternalIdentifierAccess::Resolver m_resolver; Scope* m_currentScope = nullptr; /// Variables that are active at the current point in assembly (as opposed to /// "part of the scope but not yet declared") diff --git a/libsolidity/inlineasm/AsmCodeGen.cpp b/libsolidity/inlineasm/AsmCodeGen.cpp index 0c1baf4c1..3a62b232d 100644 --- a/libsolidity/inlineasm/AsmCodeGen.cpp +++ b/libsolidity/inlineasm/AsmCodeGen.cpp @@ -49,7 +49,7 @@ using namespace dev; using namespace dev::solidity; using namespace dev::solidity::assembly; -class EthAssemblyAdapter: public julia::AbstractAssembly +class EthAssemblyAdapter: public yul::AbstractAssembly { public: explicit EthAssemblyAdapter(eth::Assembly& _assembly): @@ -145,12 +145,12 @@ void assembly::CodeGenerator::assemble( Block const& _parsedData, AsmAnalysisInfo& _analysisInfo, eth::Assembly& _assembly, - julia::ExternalIdentifierAccess const& _identifierAccess, + yul::ExternalIdentifierAccess const& _identifierAccess, bool _useNamedLabelsForFunctions ) { EthAssemblyAdapter assemblyAdapter(_assembly); - julia::CodeTransform( + yul::CodeTransform( assemblyAdapter, _analysisInfo, false, diff --git a/libsolidity/inlineasm/AsmCodeGen.h b/libsolidity/inlineasm/AsmCodeGen.h index 277e18790..bbc31397b 100644 --- a/libsolidity/inlineasm/AsmCodeGen.h +++ b/libsolidity/inlineasm/AsmCodeGen.h @@ -46,7 +46,7 @@ public: Block const& _parsedData, AsmAnalysisInfo& _analysisInfo, eth::Assembly& _assembly, - julia::ExternalIdentifierAccess const& _identifierAccess = julia::ExternalIdentifierAccess(), + yul::ExternalIdentifierAccess const& _identifierAccess = yul::ExternalIdentifierAccess(), bool _useNamedLabelsForFunctions = false ); }; diff --git a/libsolidity/interface/AssemblyStack.cpp b/libsolidity/interface/AssemblyStack.cpp index dbd976d1e..26496de79 100644 --- a/libsolidity/interface/AssemblyStack.cpp +++ b/libsolidity/interface/AssemblyStack.cpp @@ -116,8 +116,8 @@ MachineAssemblyObject AssemblyStack::assemble(Machine _machine) const case Machine::EVM15: { MachineAssemblyObject object; - julia::EVMAssembly assembly(true); - julia::CodeTransform(assembly, *m_analysisInfo, m_language == Language::Yul, true)(*m_parserResult); + yul::EVMAssembly assembly(true); + yul::CodeTransform(assembly, *m_analysisInfo, m_language == Language::Yul, true)(*m_parserResult); object.bytecode = make_shared(assembly.finalize()); /// TODO: fill out text representation return object; diff --git a/libyul/ASTDataForward.h b/libyul/ASTDataForward.h index 143b9c46a..7f131b5ee 100644 --- a/libyul/ASTDataForward.h +++ b/libyul/ASTDataForward.h @@ -25,7 +25,7 @@ namespace dev { -namespace julia +namespace yul { using Instruction = solidity::assembly::Instruction; diff --git a/libyul/Exceptions.h b/libyul/Exceptions.h index 48624a56e..c423b66ff 100644 --- a/libyul/Exceptions.h +++ b/libyul/Exceptions.h @@ -25,7 +25,7 @@ namespace dev { -namespace julia +namespace yul { struct YulException: virtual Exception {}; diff --git a/libyul/backends/evm/AbstractAssembly.h b/libyul/backends/evm/AbstractAssembly.h index b68189238..d75058f7a 100644 --- a/libyul/backends/evm/AbstractAssembly.h +++ b/libyul/backends/evm/AbstractAssembly.h @@ -38,7 +38,7 @@ struct Instruction; struct Identifier; } } -namespace julia +namespace yul { /// @@ -106,7 +106,7 @@ struct ExternalIdentifierAccess /// 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. Resolver resolve; - using CodeGenerator = std::function; + using CodeGenerator = std::function; /// 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 /// to be put onto the stack, in lvalue context, the value is assumed to be at the top of the stack. diff --git a/libyul/backends/evm/EVMAssembly.cpp b/libyul/backends/evm/EVMAssembly.cpp index af0ddbb8b..b2f0878f6 100644 --- a/libyul/backends/evm/EVMAssembly.cpp +++ b/libyul/backends/evm/EVMAssembly.cpp @@ -26,7 +26,7 @@ using namespace std; using namespace dev; -using namespace dev::julia; +using namespace dev::yul; namespace { diff --git a/libyul/backends/evm/EVMAssembly.h b/libyul/backends/evm/EVMAssembly.h index 30abad971..556ed5a58 100644 --- a/libyul/backends/evm/EVMAssembly.h +++ b/libyul/backends/evm/EVMAssembly.h @@ -28,7 +28,7 @@ namespace dev { -namespace julia +namespace yul { class EVMAssembly: public AbstractAssembly diff --git a/libyul/backends/evm/EVMCodeTransform.cpp b/libyul/backends/evm/EVMCodeTransform.cpp index afc9e608c..89086b4e3 100644 --- a/libyul/backends/evm/EVMCodeTransform.cpp +++ b/libyul/backends/evm/EVMCodeTransform.cpp @@ -29,7 +29,7 @@ using namespace std; using namespace dev; -using namespace dev::julia; +using namespace dev::yul; using namespace dev::solidity; using Scope = dev::solidity::assembly::Scope; diff --git a/libyul/backends/evm/EVMCodeTransform.h b/libyul/backends/evm/EVMCodeTransform.h index 6a0941b63..22ebbf43f 100644 --- a/libyul/backends/evm/EVMCodeTransform.h +++ b/libyul/backends/evm/EVMCodeTransform.h @@ -37,7 +37,7 @@ namespace assembly struct AsmAnalysisInfo; } } -namespace julia +namespace yul { class EVMAssembly; @@ -47,7 +47,7 @@ public: /// Create the code transformer. /// @param _identifierAccess used to resolve identifiers external to the inline assembly CodeTransform( - julia::AbstractAssembly& _assembly, + yul::AbstractAssembly& _assembly, solidity::assembly::AsmAnalysisInfo& _analysisInfo, bool _yul = false, bool _evm15 = false, @@ -76,7 +76,7 @@ protected: }; CodeTransform( - julia::AbstractAssembly& _assembly, + yul::AbstractAssembly& _assembly, solidity::assembly::AsmAnalysisInfo& _analysisInfo, bool _yul, bool _evm15, @@ -139,7 +139,7 @@ private: void checkStackHeight(void const* _astElement) const; - julia::AbstractAssembly& m_assembly; + yul::AbstractAssembly& m_assembly; solidity::assembly::AsmAnalysisInfo& m_info; solidity::assembly::Scope* m_scope = nullptr; bool m_yul = false; diff --git a/libyul/optimiser/ASTCopier.cpp b/libyul/optimiser/ASTCopier.cpp index c3fe77787..4b7f21f8b 100644 --- a/libyul/optimiser/ASTCopier.cpp +++ b/libyul/optimiser/ASTCopier.cpp @@ -28,7 +28,7 @@ using namespace std; using namespace dev; -using namespace dev::julia; +using namespace dev::yul; Statement ASTCopier::operator()(Instruction const&) { diff --git a/libyul/optimiser/ASTCopier.h b/libyul/optimiser/ASTCopier.h index ce9226a64..13369cef4 100644 --- a/libyul/optimiser/ASTCopier.h +++ b/libyul/optimiser/ASTCopier.h @@ -31,7 +31,7 @@ namespace dev { -namespace julia +namespace yul { class ExpressionCopier: public boost::static_visitor diff --git a/libyul/optimiser/ASTWalker.cpp b/libyul/optimiser/ASTWalker.cpp index 042d1f117..e29dda6bc 100644 --- a/libyul/optimiser/ASTWalker.cpp +++ b/libyul/optimiser/ASTWalker.cpp @@ -26,7 +26,7 @@ using namespace std; using namespace dev; -using namespace dev::julia; +using namespace dev::yul; using namespace dev::solidity; diff --git a/libyul/optimiser/ASTWalker.h b/libyul/optimiser/ASTWalker.h index b34559a31..41617d55d 100644 --- a/libyul/optimiser/ASTWalker.h +++ b/libyul/optimiser/ASTWalker.h @@ -33,7 +33,7 @@ namespace dev { -namespace julia +namespace yul { /** diff --git a/libyul/optimiser/CommonSubexpressionEliminator.cpp b/libyul/optimiser/CommonSubexpressionEliminator.cpp index 8bb4ca2e0..23d15cad9 100644 --- a/libyul/optimiser/CommonSubexpressionEliminator.cpp +++ b/libyul/optimiser/CommonSubexpressionEliminator.cpp @@ -29,7 +29,7 @@ using namespace std; using namespace dev; -using namespace dev::julia; +using namespace dev::yul; void CommonSubexpressionEliminator::visit(Expression& _e) { diff --git a/libyul/optimiser/CommonSubexpressionEliminator.h b/libyul/optimiser/CommonSubexpressionEliminator.h index 37cd80ff3..f8aa0ee1c 100644 --- a/libyul/optimiser/CommonSubexpressionEliminator.h +++ b/libyul/optimiser/CommonSubexpressionEliminator.h @@ -25,7 +25,7 @@ namespace dev { -namespace julia +namespace yul { /** diff --git a/libyul/optimiser/DataFlowAnalyzer.cpp b/libyul/optimiser/DataFlowAnalyzer.cpp index 3300a2bd8..ca1e51530 100644 --- a/libyul/optimiser/DataFlowAnalyzer.cpp +++ b/libyul/optimiser/DataFlowAnalyzer.cpp @@ -34,7 +34,7 @@ using namespace std; using namespace dev; -using namespace dev::julia; +using namespace dev::yul; void DataFlowAnalyzer::operator()(Assignment& _assignment) { diff --git a/libyul/optimiser/DataFlowAnalyzer.h b/libyul/optimiser/DataFlowAnalyzer.h index 054f6bd49..f998eadf4 100644 --- a/libyul/optimiser/DataFlowAnalyzer.h +++ b/libyul/optimiser/DataFlowAnalyzer.h @@ -30,7 +30,7 @@ namespace dev { -namespace julia +namespace yul { /** diff --git a/libyul/optimiser/Disambiguator.cpp b/libyul/optimiser/Disambiguator.cpp index 87da0391e..af3507e17 100644 --- a/libyul/optimiser/Disambiguator.cpp +++ b/libyul/optimiser/Disambiguator.cpp @@ -27,7 +27,7 @@ using namespace std; using namespace dev; -using namespace dev::julia; +using namespace dev::yul; using namespace dev::solidity; using Scope = dev::solidity::assembly::Scope; diff --git a/libyul/optimiser/Disambiguator.h b/libyul/optimiser/Disambiguator.h index f6b8fd46e..0829fd583 100644 --- a/libyul/optimiser/Disambiguator.h +++ b/libyul/optimiser/Disambiguator.h @@ -34,7 +34,7 @@ namespace dev { -namespace julia +namespace yul { /** diff --git a/libyul/optimiser/ExpressionInliner.cpp b/libyul/optimiser/ExpressionInliner.cpp index d4f7c4a48..9bf0a3fb1 100644 --- a/libyul/optimiser/ExpressionInliner.cpp +++ b/libyul/optimiser/ExpressionInliner.cpp @@ -30,7 +30,7 @@ using namespace std; using namespace dev; -using namespace dev::julia; +using namespace dev::yul; using namespace dev::solidity; void ExpressionInliner::run() diff --git a/libyul/optimiser/ExpressionInliner.h b/libyul/optimiser/ExpressionInliner.h index 99fa68c90..971a2ee0a 100644 --- a/libyul/optimiser/ExpressionInliner.h +++ b/libyul/optimiser/ExpressionInliner.h @@ -30,7 +30,7 @@ namespace dev { -namespace julia +namespace yul { /** diff --git a/libyul/optimiser/ExpressionJoiner.cpp b/libyul/optimiser/ExpressionJoiner.cpp index ebf013463..3dfab3716 100644 --- a/libyul/optimiser/ExpressionJoiner.cpp +++ b/libyul/optimiser/ExpressionJoiner.cpp @@ -33,7 +33,7 @@ using namespace std; using namespace dev; -using namespace dev::julia; +using namespace dev::yul; using namespace dev::solidity; void ExpressionJoiner::operator()(FunctionalInstruction& _instruction) diff --git a/libyul/optimiser/ExpressionJoiner.h b/libyul/optimiser/ExpressionJoiner.h index a7ae50bcf..df18e58f1 100644 --- a/libyul/optimiser/ExpressionJoiner.h +++ b/libyul/optimiser/ExpressionJoiner.h @@ -28,7 +28,7 @@ namespace dev { -namespace julia +namespace yul { class NameCollector; diff --git a/libyul/optimiser/ExpressionSimplifier.cpp b/libyul/optimiser/ExpressionSimplifier.cpp index 5d89cef03..c95fb3d5b 100644 --- a/libyul/optimiser/ExpressionSimplifier.cpp +++ b/libyul/optimiser/ExpressionSimplifier.cpp @@ -29,7 +29,7 @@ using namespace std; using namespace dev; -using namespace dev::julia; +using namespace dev::yul; using namespace dev::solidity; diff --git a/libyul/optimiser/ExpressionSimplifier.h b/libyul/optimiser/ExpressionSimplifier.h index d11cd5d6c..1b9d69604 100644 --- a/libyul/optimiser/ExpressionSimplifier.h +++ b/libyul/optimiser/ExpressionSimplifier.h @@ -26,7 +26,7 @@ namespace dev { -namespace julia +namespace yul { /** diff --git a/libyul/optimiser/ExpressionSplitter.cpp b/libyul/optimiser/ExpressionSplitter.cpp index e4e2739e2..dab0545f0 100644 --- a/libyul/optimiser/ExpressionSplitter.cpp +++ b/libyul/optimiser/ExpressionSplitter.cpp @@ -31,7 +31,7 @@ using namespace std; using namespace dev; -using namespace dev::julia; +using namespace dev::yul; using namespace dev::solidity; void ExpressionSplitter::operator()(FunctionalInstruction& _instruction) diff --git a/libyul/optimiser/ExpressionSplitter.h b/libyul/optimiser/ExpressionSplitter.h index 89757df3d..339acbf0b 100644 --- a/libyul/optimiser/ExpressionSplitter.h +++ b/libyul/optimiser/ExpressionSplitter.h @@ -29,7 +29,7 @@ namespace dev { -namespace julia +namespace yul { class NameCollector; diff --git a/libyul/optimiser/FullInliner.cpp b/libyul/optimiser/FullInliner.cpp index 7af642be1..4e4199870 100644 --- a/libyul/optimiser/FullInliner.cpp +++ b/libyul/optimiser/FullInliner.cpp @@ -34,7 +34,7 @@ using namespace std; using namespace dev; -using namespace dev::julia; +using namespace dev::yul; using namespace dev::solidity; FullInliner::FullInliner(Block& _ast): diff --git a/libyul/optimiser/FullInliner.h b/libyul/optimiser/FullInliner.h index ecf987f71..8112fb4bd 100644 --- a/libyul/optimiser/FullInliner.h +++ b/libyul/optimiser/FullInliner.h @@ -35,7 +35,7 @@ namespace dev { -namespace julia +namespace yul { class NameCollector; diff --git a/libyul/optimiser/FunctionGrouper.cpp b/libyul/optimiser/FunctionGrouper.cpp index cbdd215fc..3d2e53220 100644 --- a/libyul/optimiser/FunctionGrouper.cpp +++ b/libyul/optimiser/FunctionGrouper.cpp @@ -27,7 +27,7 @@ using namespace std; using namespace dev; -using namespace dev::julia; +using namespace dev::yul; using namespace dev::solidity; diff --git a/libyul/optimiser/FunctionGrouper.h b/libyul/optimiser/FunctionGrouper.h index 57279c168..63cfbfb13 100644 --- a/libyul/optimiser/FunctionGrouper.h +++ b/libyul/optimiser/FunctionGrouper.h @@ -25,7 +25,7 @@ namespace dev { -namespace julia +namespace yul { /** diff --git a/libyul/optimiser/FunctionHoister.cpp b/libyul/optimiser/FunctionHoister.cpp index 99525494d..c196dead1 100644 --- a/libyul/optimiser/FunctionHoister.cpp +++ b/libyul/optimiser/FunctionHoister.cpp @@ -29,7 +29,7 @@ using namespace std; using namespace dev; -using namespace dev::julia; +using namespace dev::yul; using namespace dev::solidity; void FunctionHoister::operator()(Block& _block) diff --git a/libyul/optimiser/FunctionHoister.h b/libyul/optimiser/FunctionHoister.h index 80d55703c..823b9e2b8 100644 --- a/libyul/optimiser/FunctionHoister.h +++ b/libyul/optimiser/FunctionHoister.h @@ -27,7 +27,7 @@ namespace dev { -namespace julia +namespace yul { /** diff --git a/libyul/optimiser/InlinableExpressionFunctionFinder.cpp b/libyul/optimiser/InlinableExpressionFunctionFinder.cpp index e6332f3a7..69dd2095f 100644 --- a/libyul/optimiser/InlinableExpressionFunctionFinder.cpp +++ b/libyul/optimiser/InlinableExpressionFunctionFinder.cpp @@ -26,7 +26,7 @@ using namespace std; using namespace dev; -using namespace dev::julia; +using namespace dev::yul; void InlinableExpressionFunctionFinder::operator()(Identifier const& _identifier) { diff --git a/libyul/optimiser/InlinableExpressionFunctionFinder.h b/libyul/optimiser/InlinableExpressionFunctionFinder.h index 69c003e6c..3887e6e5d 100644 --- a/libyul/optimiser/InlinableExpressionFunctionFinder.h +++ b/libyul/optimiser/InlinableExpressionFunctionFinder.h @@ -27,7 +27,7 @@ namespace dev { -namespace julia +namespace yul { /** diff --git a/libyul/optimiser/MainFunction.cpp b/libyul/optimiser/MainFunction.cpp index dfc195740..c8f35207f 100644 --- a/libyul/optimiser/MainFunction.cpp +++ b/libyul/optimiser/MainFunction.cpp @@ -30,7 +30,7 @@ using namespace std; using namespace dev; -using namespace dev::julia; +using namespace dev::yul; using namespace dev::solidity; void MainFunction::operator()(Block& _block) diff --git a/libyul/optimiser/MainFunction.h b/libyul/optimiser/MainFunction.h index 4d790729d..4a73283a8 100644 --- a/libyul/optimiser/MainFunction.h +++ b/libyul/optimiser/MainFunction.h @@ -25,7 +25,7 @@ namespace dev { -namespace julia +namespace yul { /** diff --git a/libyul/optimiser/Metrics.cpp b/libyul/optimiser/Metrics.cpp index ce7c1bed6..eb2d39e8f 100644 --- a/libyul/optimiser/Metrics.cpp +++ b/libyul/optimiser/Metrics.cpp @@ -23,7 +23,7 @@ #include using namespace dev; -using namespace dev::julia; +using namespace dev::yul; size_t CodeSize::codeSize(Statement const& _statement) { diff --git a/libyul/optimiser/Metrics.h b/libyul/optimiser/Metrics.h index f0d6a2032..8ed73cca5 100644 --- a/libyul/optimiser/Metrics.h +++ b/libyul/optimiser/Metrics.h @@ -24,7 +24,7 @@ namespace dev { -namespace julia +namespace yul { class CodeSize: public ASTWalker diff --git a/libyul/optimiser/NameCollector.cpp b/libyul/optimiser/NameCollector.cpp index cbc7aad26..b71fa982f 100644 --- a/libyul/optimiser/NameCollector.cpp +++ b/libyul/optimiser/NameCollector.cpp @@ -24,7 +24,7 @@ using namespace std; using namespace dev; -using namespace dev::julia; +using namespace dev::yul; void NameCollector::operator()(VariableDeclaration const& _varDecl) { diff --git a/libyul/optimiser/NameCollector.h b/libyul/optimiser/NameCollector.h index 9ea326746..b8f6c1d70 100644 --- a/libyul/optimiser/NameCollector.h +++ b/libyul/optimiser/NameCollector.h @@ -28,7 +28,7 @@ namespace dev { -namespace julia +namespace yul { /** diff --git a/libyul/optimiser/NameDispenser.cpp b/libyul/optimiser/NameDispenser.cpp index 4b1773893..f7385471d 100644 --- a/libyul/optimiser/NameDispenser.cpp +++ b/libyul/optimiser/NameDispenser.cpp @@ -22,7 +22,7 @@ using namespace std; using namespace dev; -using namespace dev::julia; +using namespace dev::yul; string NameDispenser::newName(string const& _prefix) { diff --git a/libyul/optimiser/NameDispenser.h b/libyul/optimiser/NameDispenser.h index 91c43d549..64ec318f0 100644 --- a/libyul/optimiser/NameDispenser.h +++ b/libyul/optimiser/NameDispenser.h @@ -24,7 +24,7 @@ namespace dev { -namespace julia +namespace yul { struct NameDispenser diff --git a/libyul/optimiser/Rematerialiser.cpp b/libyul/optimiser/Rematerialiser.cpp index 5f2b9e8b7..dd6653eaf 100644 --- a/libyul/optimiser/Rematerialiser.cpp +++ b/libyul/optimiser/Rematerialiser.cpp @@ -28,7 +28,7 @@ using namespace std; using namespace dev; -using namespace dev::julia; +using namespace dev::yul; void Rematerialiser::visit(Expression& _e) { diff --git a/libyul/optimiser/Rematerialiser.h b/libyul/optimiser/Rematerialiser.h index d06c2754b..afcfab3e7 100644 --- a/libyul/optimiser/Rematerialiser.h +++ b/libyul/optimiser/Rematerialiser.h @@ -28,7 +28,7 @@ namespace dev { -namespace julia +namespace yul { /** diff --git a/libyul/optimiser/Semantics.cpp b/libyul/optimiser/Semantics.cpp index d610341d6..33f3af77b 100644 --- a/libyul/optimiser/Semantics.cpp +++ b/libyul/optimiser/Semantics.cpp @@ -30,7 +30,7 @@ using namespace std; using namespace dev; -using namespace dev::julia; +using namespace dev::yul; MovableChecker::MovableChecker(Expression const& _expression) { diff --git a/libyul/optimiser/Semantics.h b/libyul/optimiser/Semantics.h index 1963e7a36..1caa12fbe 100644 --- a/libyul/optimiser/Semantics.h +++ b/libyul/optimiser/Semantics.h @@ -28,7 +28,7 @@ namespace dev { -namespace julia +namespace yul { /** diff --git a/libyul/optimiser/SimplificationRules.cpp b/libyul/optimiser/SimplificationRules.cpp index ca3f2984f..762473e53 100644 --- a/libyul/optimiser/SimplificationRules.cpp +++ b/libyul/optimiser/SimplificationRules.cpp @@ -31,7 +31,7 @@ using namespace std; using namespace dev; -using namespace dev::julia; +using namespace dev::yul; SimplificationRule const* SimplificationRules::findFirstMatch(Expression const& _expr) diff --git a/libyul/optimiser/SimplificationRules.h b/libyul/optimiser/SimplificationRules.h index 2b5bccd53..25d91573a 100644 --- a/libyul/optimiser/SimplificationRules.h +++ b/libyul/optimiser/SimplificationRules.h @@ -34,7 +34,7 @@ namespace dev { -namespace julia +namespace yul { class Pattern; diff --git a/libyul/optimiser/Substitution.cpp b/libyul/optimiser/Substitution.cpp index eafe1da94..4a000a85b 100644 --- a/libyul/optimiser/Substitution.cpp +++ b/libyul/optimiser/Substitution.cpp @@ -24,7 +24,7 @@ using namespace std; using namespace dev; -using namespace dev::julia; +using namespace dev::yul; Expression Substitution::translate(Expression const& _expression) { diff --git a/libyul/optimiser/Substitution.h b/libyul/optimiser/Substitution.h index c7e604ca4..b734cdca1 100644 --- a/libyul/optimiser/Substitution.h +++ b/libyul/optimiser/Substitution.h @@ -28,7 +28,7 @@ namespace dev { -namespace julia +namespace yul { /** diff --git a/libyul/optimiser/SyntacticalEquality.cpp b/libyul/optimiser/SyntacticalEquality.cpp index a235e509a..f22b5c31b 100644 --- a/libyul/optimiser/SyntacticalEquality.cpp +++ b/libyul/optimiser/SyntacticalEquality.cpp @@ -28,7 +28,7 @@ using namespace std; using namespace dev; -using namespace dev::julia; +using namespace dev::yul; bool SyntacticalEqualityChecker::equal(Expression const& _e1, Expression const& _e2) { diff --git a/libyul/optimiser/SyntacticalEquality.h b/libyul/optimiser/SyntacticalEquality.h index 58d4f3654..e9fbebe0a 100644 --- a/libyul/optimiser/SyntacticalEquality.h +++ b/libyul/optimiser/SyntacticalEquality.h @@ -26,7 +26,7 @@ namespace dev { -namespace julia +namespace yul { /** diff --git a/libyul/optimiser/UnusedPruner.cpp b/libyul/optimiser/UnusedPruner.cpp index 10b1c1719..74b6bee40 100644 --- a/libyul/optimiser/UnusedPruner.cpp +++ b/libyul/optimiser/UnusedPruner.cpp @@ -31,7 +31,7 @@ using namespace std; using namespace dev; -using namespace dev::julia; +using namespace dev::yul; UnusedPruner::UnusedPruner(Block& _ast) { diff --git a/libyul/optimiser/UnusedPruner.h b/libyul/optimiser/UnusedPruner.h index 305c62a7f..327921ea9 100644 --- a/libyul/optimiser/UnusedPruner.h +++ b/libyul/optimiser/UnusedPruner.h @@ -28,7 +28,7 @@ namespace dev { -namespace julia +namespace yul { /** diff --git a/libyul/optimiser/Utilities.cpp b/libyul/optimiser/Utilities.cpp index 7591ed5b0..df01ed39b 100644 --- a/libyul/optimiser/Utilities.cpp +++ b/libyul/optimiser/Utilities.cpp @@ -28,9 +28,9 @@ using namespace std; 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 { return _st.type() == typeid(Block) && boost::get(_st).statements.empty(); diff --git a/libyul/optimiser/Utilities.h b/libyul/optimiser/Utilities.h index ae77d2e00..5b18a27cf 100644 --- a/libyul/optimiser/Utilities.h +++ b/libyul/optimiser/Utilities.h @@ -24,7 +24,7 @@ namespace dev { -namespace julia +namespace yul { /// Removes statements that are just empty blocks (non-recursive). diff --git a/test/boostTest.cpp b/test/boostTest.cpp index c199535ab..d27ba1f6d 100644 --- a/test/boostTest.cpp +++ b/test/boostTest.cpp @@ -143,7 +143,7 @@ test_suite* init_unit_test_suite( int /*argc*/, char* /*argv*/[] ) master, dev::test::Options::get().testPath / "libyul", "yulOptimizerTests", - dev::julia::test::YulOptimizerTest::create + dev::yul::test::YulOptimizerTest::create ) > 0, "no Yul Optimizer tests found"); if (dev::test::Options::get().disableIPC) { diff --git a/test/libyul/Common.cpp b/test/libyul/Common.cpp index f23136e6c..4c50180af 100644 --- a/test/libyul/Common.cpp +++ b/test/libyul/Common.cpp @@ -37,10 +37,10 @@ #include using namespace std; -using namespace dev::julia; +using namespace dev::yul; 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; }); @@ -52,7 +52,7 @@ void dev::julia::test::printErrors(ErrorList const& _errors, Scanner const& _sca } -pair, shared_ptr> dev::julia::test::parse(string const& _source, bool _yul) +pair, shared_ptr> dev::yul::test::parse(string const& _source, bool _yul) { auto flavour = _yul ? assembly::AsmFlavour::Yul : assembly::AsmFlavour::Strict; ErrorList errors; @@ -83,13 +83,13 @@ pair, shared_ptr> dev::julia::test: 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); return boost::get(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); } diff --git a/test/libyul/Common.h b/test/libyul/Common.h index b9c3d2fb8..ee191494d 100644 --- a/test/libyul/Common.h +++ b/test/libyul/Common.h @@ -39,7 +39,7 @@ namespace assembly struct AsmAnalysisInfo; } } -namespace julia +namespace yul { namespace test { diff --git a/test/libyul/Inliner.cpp b/test/libyul/Inliner.cpp index 471b2e2f6..44c6411af 100644 --- a/test/libyul/Inliner.cpp +++ b/test/libyul/Inliner.cpp @@ -36,8 +36,8 @@ using namespace std; using namespace dev; -using namespace dev::julia; -using namespace dev::julia::test; +using namespace dev::yul; +using namespace dev::yul::test; using namespace dev::solidity; namespace diff --git a/test/libyul/YulOptimizerTest.cpp b/test/libyul/YulOptimizerTest.cpp index 62a4aa108..8b37830f4 100644 --- a/test/libyul/YulOptimizerTest.cpp +++ b/test/libyul/YulOptimizerTest.cpp @@ -48,8 +48,8 @@ #include using namespace dev; -using namespace dev::julia; -using namespace dev::julia::test; +using namespace dev::yul; +using namespace dev::yul::test; using namespace dev::solidity; using namespace dev::solidity::test; using namespace std; diff --git a/test/libyul/YulOptimizerTest.h b/test/libyul/YulOptimizerTest.h index 8f9a81f7a..7db17ceb7 100644 --- a/test/libyul/YulOptimizerTest.h +++ b/test/libyul/YulOptimizerTest.h @@ -33,7 +33,7 @@ struct AsmAnalysisInfo; struct Block; } } -namespace julia +namespace yul { namespace test { diff --git a/test/tools/isoltest.cpp b/test/tools/isoltest.cpp index a8e2b09e8..bdc89fb39 100644 --- a/test/tools/isoltest.cpp +++ b/test/tools/isoltest.cpp @@ -388,7 +388,7 @@ Allowed options)", "Yul Optimizer", testPath / "libyul", "yulOptimizerTests", - julia::test::YulOptimizerTest::create, + yul::test::YulOptimizerTest::create, formatted )) global_stats += *stats;