From f3ec2ba39e7f4b85d148a7b696ef5af499fbb6fb Mon Sep 17 00:00:00 2001 From: chriseth Date: Wed, 26 Apr 2017 15:41:08 +0200 Subject: Refactor to combined scope and stack height info. --- libsolidity/inlineasm/AsmStack.cpp | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'libsolidity/inlineasm/AsmStack.cpp') diff --git a/libsolidity/inlineasm/AsmStack.cpp b/libsolidity/inlineasm/AsmStack.cpp index 5defae4c..c2a7d8ea 100644 --- a/libsolidity/inlineasm/AsmStack.cpp +++ b/libsolidity/inlineasm/AsmStack.cpp @@ -26,6 +26,7 @@ #include #include #include +#include #include @@ -51,8 +52,8 @@ bool InlineAssemblyStack::parse( return false; *m_parserResult = std::move(*result); - AsmAnalyzer::Scopes scopes; - return (AsmAnalyzer(scopes, m_errors, _resolver)).analyze(*m_parserResult); + AsmAnalysisInfo analysisInfo; + return (AsmAnalyzer(analysisInfo, m_errors, _resolver)).analyze(*m_parserResult); } string InlineAssemblyStack::toString() @@ -62,11 +63,11 @@ string InlineAssemblyStack::toString() eth::Assembly InlineAssemblyStack::assemble() { - AsmAnalyzer::Scopes scopes; - AsmAnalyzer analyzer(scopes, m_errors); + AsmAnalysisInfo analysisInfo; + AsmAnalyzer analyzer(analysisInfo, m_errors); solAssert(analyzer.analyze(*m_parserResult), ""); CodeGenerator codeGen(m_errors); - return codeGen.assemble(*m_parserResult, scopes); + return codeGen.assemble(*m_parserResult, analysisInfo); } bool InlineAssemblyStack::parseAndAssemble( @@ -82,10 +83,10 @@ bool InlineAssemblyStack::parseAndAssemble( return false; solAssert(parserResult, ""); - AsmAnalyzer::Scopes scopes; - AsmAnalyzer analyzer(scopes, errors, _identifierAccess.resolve); + AsmAnalysisInfo analysisInfo; + AsmAnalyzer analyzer(analysisInfo, errors, _identifierAccess.resolve); solAssert(analyzer.analyze(*parserResult), ""); - CodeGenerator(errors).assemble(*parserResult, scopes, _assembly, _identifierAccess); + CodeGenerator(errors).assemble(*parserResult, analysisInfo, _assembly, _identifierAccess); // At this point, the assembly might be messed up, but we should throw an // internal compiler error anyway. -- cgit