diff options
author | chriseth <chris@ethereum.org> | 2018-12-03 22:48:03 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-12-03 22:48:03 +0800 |
commit | c8a2cb62832afb2dc09ccee6fd42c1516dfdb981 (patch) | |
tree | 7977e9dcbbc215088c05b847f849871ef5d4ae66 /libsolidity/interface/AssemblyStack.h | |
parent | 1d4f565a64988a3400847d2655ca24f73f234bc6 (diff) | |
parent | 590be1d84cea9850ce69b68be3dc5294b39041e5 (diff) | |
download | dexon-solidity-c8a2cb62832afb2dc09ccee6fd42c1516dfdb981.tar.gz dexon-solidity-c8a2cb62832afb2dc09ccee6fd42c1516dfdb981.tar.zst dexon-solidity-c8a2cb62832afb2dc09ccee6fd42c1516dfdb981.zip |
Merge pull request #5571 from ethereum/develop
Version 0.5.1
Diffstat (limited to 'libsolidity/interface/AssemblyStack.h')
-rw-r--r-- | libsolidity/interface/AssemblyStack.h | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/libsolidity/interface/AssemblyStack.h b/libsolidity/interface/AssemblyStack.h index 8132ce63..0d04ffec 100644 --- a/libsolidity/interface/AssemblyStack.h +++ b/libsolidity/interface/AssemblyStack.h @@ -21,24 +21,26 @@ #pragma once -#include <libsolidity/interface/ErrorReporter.h> -#include <libsolidity/interface/EVMVersion.h> +#include <liblangutil/ErrorReporter.h> +#include <liblangutil/EVMVersion.h> + +#include <libyul/Object.h> +#include <libyul/ObjectParser.h> #include <libevmasm/LinkerObject.h> #include <string> #include <memory> +namespace langutil +{ +class Scanner; +} + namespace dev { namespace solidity { -class Scanner; -namespace assembly -{ -struct AsmAnalysisInfo; -struct Block; -} struct MachineAssemblyObject { @@ -61,21 +63,20 @@ public: {} /// @returns the scanner used during parsing - Scanner const& scanner() const; + langutil::Scanner const& scanner() const; /// Runs parsing and analysis steps, returns false if input cannot be assembled. /// Multiple calls overwrite the previous state. bool parseAndAnalyze(std::string const& _sourceName, std::string const& _source); - /// Runs analysis step on the supplied block, returns false if input cannot be assembled. - /// Multiple calls overwrite the previous state. - bool analyze(assembly::Block const& _block, Scanner const* _scanner = nullptr); + /// Run the optimizer suite. Can only be used with Yul or strict assembly. + void optimize(); /// Run the assembly step (should only be called after parseAndAnalyze). MachineAssemblyObject assemble(Machine _machine) const; /// @returns the errors generated during parsing, analysis (and potentially assembly). - ErrorList const& errors() const { return m_errors; } + langutil::ErrorList const& errors() const { return m_errors; } /// Pretty-print the input after having parsed it. std::string print() const; @@ -86,13 +87,12 @@ private: Language m_language = Language::Assembly; EVMVersion m_evmVersion; - std::shared_ptr<Scanner> m_scanner; + std::shared_ptr<langutil::Scanner> m_scanner; bool m_analysisSuccessful = false; - std::shared_ptr<assembly::Block> m_parserResult; - std::shared_ptr<assembly::AsmAnalysisInfo> m_analysisInfo; - ErrorList m_errors; - ErrorReporter m_errorReporter; + std::shared_ptr<yul::Object> m_parserResult; + langutil::ErrorList m_errors; + langutil::ErrorReporter m_errorReporter; }; } |