aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity/interface/AssemblyStack.h
diff options
context:
space:
mode:
Diffstat (limited to 'libsolidity/interface/AssemblyStack.h')
-rw-r--r--libsolidity/interface/AssemblyStack.h36
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;
};
}