From dfb7d5ebd955d390142241a2abcb95995ef1ba04 Mon Sep 17 00:00:00 2001 From: chriseth Date: Wed, 12 Apr 2017 18:32:25 +0200 Subject: Move analysis out of code generator. --- libsolidity/inlineasm/AsmStack.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'libsolidity/inlineasm/AsmStack.cpp') diff --git a/libsolidity/inlineasm/AsmStack.cpp b/libsolidity/inlineasm/AsmStack.cpp index 146fc114..1903de42 100644 --- a/libsolidity/inlineasm/AsmStack.cpp +++ b/libsolidity/inlineasm/AsmStack.cpp @@ -62,8 +62,11 @@ string InlineAssemblyStack::toString() eth::Assembly InlineAssemblyStack::assemble() { - CodeGenerator codeGen(*m_parserResult, m_errors); - return codeGen.assemble(); + AsmAnalyzer::Scopes scopes; + AsmAnalyzer analyzer(scopes, m_errors); + solAssert(analyzer.analyze(*m_parserResult), ""); + CodeGenerator codeGen(m_errors); + return codeGen.assemble(*m_parserResult, scopes); } bool InlineAssemblyStack::parseAndAssemble( @@ -78,7 +81,10 @@ bool InlineAssemblyStack::parseAndAssemble( if (!errors.empty()) return false; - CodeGenerator(*parserResult, errors).assemble(_assembly, _identifierAccess); + AsmAnalyzer::Scopes scopes; + AsmAnalyzer analyzer(scopes, m_errors); + solAssert(analyzer.analyze(*m_parserResult), ""); + CodeGenerator(errors).assemble(*parserResult, scopes, _assembly, _identifierAccess); // At this point, the assembly might be messed up, but we should throw an // internal compiler error anyway. -- cgit