aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity/interface
diff options
context:
space:
mode:
Diffstat (limited to 'libsolidity/interface')
-rw-r--r--libsolidity/interface/AssemblyStack.cpp14
-rw-r--r--libsolidity/interface/AssemblyStack.h10
2 files changed, 6 insertions, 18 deletions
diff --git a/libsolidity/interface/AssemblyStack.cpp b/libsolidity/interface/AssemblyStack.cpp
index 31959d93..ef4e32b0 100644
--- a/libsolidity/interface/AssemblyStack.cpp
+++ b/libsolidity/interface/AssemblyStack.cpp
@@ -30,6 +30,7 @@
#include <libyul/AsmCodeGen.h>
#include <libyul/backends/evm/EVMCodeTransform.h>
#include <libyul/backends/evm/EVMAssembly.h>
+#include <libyul/YulObjectParser.h>
#include <libevmasm/Assembly.h>
@@ -69,7 +70,7 @@ bool AssemblyStack::parseAndAnalyze(std::string const& _sourceName, std::string
m_errors.clear();
m_analysisSuccessful = false;
m_scanner = make_shared<Scanner>(CharStream(_source), _sourceName);
- m_parserResult = yul::Parser(m_errorReporter, languageToAsmFlavour(m_language)).parse(m_scanner, false);
+ m_parserResult = yul::YulObjectParser(m_errorReporter, languageToAsmFlavour(m_language)).parse(m_scanner, false);
if (!m_errorReporter.errors().empty())
return false;
solAssert(m_parserResult, "");
@@ -77,17 +78,6 @@ bool AssemblyStack::parseAndAnalyze(std::string const& _sourceName, std::string
return analyzeParsed();
}
-bool AssemblyStack::analyze(yul::Block const& _block, Scanner const* _scanner)
-{
- m_errors.clear();
- m_analysisSuccessful = false;
- if (_scanner)
- m_scanner = make_shared<Scanner>(*_scanner);
- m_parserResult = make_shared<yul::Block>(_block);
-
- return analyzeParsed();
-}
-
bool AssemblyStack::analyzeParsed()
{
m_analysisInfo = make_shared<yul::AsmAnalysisInfo>();
diff --git a/libsolidity/interface/AssemblyStack.h b/libsolidity/interface/AssemblyStack.h
index 03b811db..b89faca0 100644
--- a/libsolidity/interface/AssemblyStack.h
+++ b/libsolidity/interface/AssemblyStack.h
@@ -24,6 +24,9 @@
#include <liblangutil/ErrorReporter.h>
#include <liblangutil/EVMVersion.h>
+#include <libyul/YulObject.h>
+#include <libyul/YulObjectParser.h>
+
#include <libevmasm/LinkerObject.h>
#include <string>
@@ -72,10 +75,6 @@ public:
/// 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(yul::Block const& _block, langutil::Scanner const* _scanner = nullptr);
-
/// Run the assembly step (should only be called after parseAndAnalyze).
MachineAssemblyObject assemble(Machine _machine) const;
@@ -94,8 +93,7 @@ private:
std::shared_ptr<langutil::Scanner> m_scanner;
bool m_analysisSuccessful = false;
- std::shared_ptr<yul::Block> m_parserResult;
- std::shared_ptr<yul::AsmAnalysisInfo> m_analysisInfo;
+ std::shared_ptr<yul::YulObject> m_parserResult;
langutil::ErrorList m_errors;
langutil::ErrorReporter m_errorReporter;
};