diff options
author | Alex Beregszaszi <alex@rtfs.hu> | 2017-06-09 18:36:36 +0800 |
---|---|---|
committer | Alex Beregszaszi <alex@rtfs.hu> | 2017-06-09 18:43:40 +0800 |
commit | ae6251effd0474cd25379f09148da95b3486e9b4 (patch) | |
tree | f725f8e35d5abfb451133467f6086fa2677a394a /libsolidity/codegen/CompilerContext.cpp | |
parent | 76667fed4f9865c4a3a5a267c469446f8bce1bef (diff) | |
download | dexon-solidity-ae6251effd0474cd25379f09148da95b3486e9b4.tar dexon-solidity-ae6251effd0474cd25379f09148da95b3486e9b4.tar.gz dexon-solidity-ae6251effd0474cd25379f09148da95b3486e9b4.tar.bz2 dexon-solidity-ae6251effd0474cd25379f09148da95b3486e9b4.tar.lz dexon-solidity-ae6251effd0474cd25379f09148da95b3486e9b4.tar.xz dexon-solidity-ae6251effd0474cd25379f09148da95b3486e9b4.tar.zst dexon-solidity-ae6251effd0474cd25379f09148da95b3486e9b4.zip |
Use inline assembly directly and not via AsmStack
Diffstat (limited to 'libsolidity/codegen/CompilerContext.cpp')
-rw-r--r-- | libsolidity/codegen/CompilerContext.cpp | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/libsolidity/codegen/CompilerContext.cpp b/libsolidity/codegen/CompilerContext.cpp index 9c4fbcbb..d98efcad 100644 --- a/libsolidity/codegen/CompilerContext.cpp +++ b/libsolidity/codegen/CompilerContext.cpp @@ -25,8 +25,11 @@ #include <libsolidity/ast/AST.h> #include <libsolidity/codegen/Compiler.h> #include <libsolidity/interface/Version.h> -#include <libsolidity/inlineasm/AsmData.h> -#include <libsolidity/inlineasm/AsmStack.h> +#include <libsolidity/interface/ErrorReporter.h> +#include <libsolidity/inlineasm/AsmParser.h> +#include <libsolidity/inlineasm/AsmCodeGen.h> +#include <libsolidity/inlineasm/AsmAnalysis.h> +#include <libsolidity/inlineasm/AsmAnalysisInfo.h> #include <boost/algorithm/string/replace.hpp> @@ -302,7 +305,18 @@ void CompilerContext::appendInlineAssembly( } }; - solAssert(assembly::InlineAssemblyStack().parseAndAssemble(*assembly, *m_asm, identifierAccess), "Failed to assemble inline assembly block."); + ErrorList errors; + ErrorReporter errorReporter(errors); + auto scanner = make_shared<Scanner>(CharStream(*assembly), "--CODEGEN--"); + auto parserResult = assembly::Parser(errorReporter).parse(scanner); + solAssert(parserResult, "Failed to parse inline assembly block."); + solAssert(errorReporter.errors().empty(), "Failed to parse inline assembly block."); + + assembly::AsmAnalysisInfo analysisInfo; + assembly::AsmAnalyzer analyzer(analysisInfo, errorReporter, false, identifierAccess.resolve); + solAssert(analyzer.analyze(*parserResult), "Failed to analyze inline assembly block."); + solAssert(errorReporter.errors().empty(), "Failed to analyze inline assembly block."); + assembly::CodeGenerator::assemble(*parserResult, analysisInfo, *m_asm, identifierAccess); } FunctionDefinition const& CompilerContext::resolveVirtualFunction( |