From ec47c8946ba5f78563b7eca2512b3cee68db45b4 Mon Sep 17 00:00:00 2001 From: Christian Parpart Date: Wed, 21 Nov 2018 12:42:34 +0100 Subject: Isolating libyul library API into its own namespace `yul`. --- libyul/backends/evm/EVMCodeTransform.h | 32 +++++++++++++------------------- 1 file changed, 13 insertions(+), 19 deletions(-) (limited to 'libyul/backends/evm/EVMCodeTransform.h') diff --git a/libyul/backends/evm/EVMCodeTransform.h b/libyul/backends/evm/EVMCodeTransform.h index f4696e81..bf195dcd 100644 --- a/libyul/backends/evm/EVMCodeTransform.h +++ b/libyul/backends/evm/EVMCodeTransform.h @@ -27,18 +27,14 @@ #include #include -namespace dev -{ -namespace solidity +namespace langutil { class ErrorReporter; -namespace assembly -{ -struct AsmAnalysisInfo; -} } + namespace yul { +struct AsmAnalysisInfo; class EVMAssembly; class CodeTransform: public boost::static_visitor<> @@ -47,8 +43,8 @@ public: /// Create the code transformer. /// @param _identifierAccess used to resolve identifiers external to the inline assembly CodeTransform( - yul::AbstractAssembly& _assembly, - solidity::assembly::AsmAnalysisInfo& _analysisInfo, + AbstractAssembly& _assembly, + AsmAnalysisInfo& _analysisInfo, bool _yul = false, bool _evm15 = false, ExternalIdentifierAccess const& _identifierAccess = ExternalIdentifierAccess(), @@ -69,15 +65,14 @@ public: protected: struct Context { - using Scope = solidity::assembly::Scope; std::map labelIDs; std::map functionEntryIDs; std::map variableStackHeights; }; CodeTransform( - yul::AbstractAssembly& _assembly, - solidity::assembly::AsmAnalysisInfo& _analysisInfo, + AbstractAssembly& _assembly, + AsmAnalysisInfo& _analysisInfo, bool _yul, bool _evm15, ExternalIdentifierAccess const& _identifierAccess, @@ -116,8 +111,8 @@ private: AbstractAssembly::LabelID labelFromIdentifier(Identifier const& _identifier); /// @returns the label ID corresponding to the given label, allocating a new one if /// necessary. - AbstractAssembly::LabelID labelID(solidity::assembly::Scope::Label const& _label); - AbstractAssembly::LabelID functionEntryID(YulString _name, solidity::assembly::Scope::Function const& _function); + AbstractAssembly::LabelID labelID(Scope::Label const& _label); + AbstractAssembly::LabelID functionEntryID(YulString _name, Scope::Function const& _function); /// Generates code for an expression that is supposed to return a single value. void visitExpression(Expression const& _expression); @@ -133,15 +128,15 @@ private: /// Determines the stack height difference to the given variables. Throws /// if it is not yet in scope or the height difference is too large. Returns /// the (positive) stack height difference otherwise. - int variableHeightDiff(solidity::assembly::Scope::Variable const& _var, bool _forSwap) const; + int variableHeightDiff(Scope::Variable const& _var, bool _forSwap) const; void expectDeposit(int _deposit, int _oldHeight) const; void checkStackHeight(void const* _astElement) const; - yul::AbstractAssembly& m_assembly; - solidity::assembly::AsmAnalysisInfo& m_info; - solidity::assembly::Scope* m_scope = nullptr; + AbstractAssembly& m_assembly; + AsmAnalysisInfo& m_info; + Scope* m_scope = nullptr; bool m_yul = false; bool m_evm15 = false; bool m_useNamedLabelsForFunctions = false; @@ -155,4 +150,3 @@ private: }; } -} -- cgit