diff options
author | chriseth <chris@ethereum.org> | 2017-04-13 00:32:25 +0800 |
---|---|---|
committer | chriseth <chris@ethereum.org> | 2017-04-25 22:49:04 +0800 |
commit | dfb7d5ebd955d390142241a2abcb95995ef1ba04 (patch) | |
tree | 6a6c4bf8091fd8d6e60272f9fb94b9b38fda4530 /libsolidity/inlineasm/AsmStack.cpp | |
parent | 4afd54b23594563036498943087bcd06ef021f94 (diff) | |
download | dexon-solidity-dfb7d5ebd955d390142241a2abcb95995ef1ba04.tar dexon-solidity-dfb7d5ebd955d390142241a2abcb95995ef1ba04.tar.gz dexon-solidity-dfb7d5ebd955d390142241a2abcb95995ef1ba04.tar.bz2 dexon-solidity-dfb7d5ebd955d390142241a2abcb95995ef1ba04.tar.lz dexon-solidity-dfb7d5ebd955d390142241a2abcb95995ef1ba04.tar.xz dexon-solidity-dfb7d5ebd955d390142241a2abcb95995ef1ba04.tar.zst dexon-solidity-dfb7d5ebd955d390142241a2abcb95995ef1ba04.zip |
Move analysis out of code generator.
Diffstat (limited to 'libsolidity/inlineasm/AsmStack.cpp')
-rw-r--r-- | libsolidity/inlineasm/AsmStack.cpp | 12 |
1 files changed, 9 insertions, 3 deletions
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. |