aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity/codegen/CompilerContext.cpp
diff options
context:
space:
mode:
authorchriseth <chris@ethereum.org>2018-11-24 00:01:18 +0800
committerGitHub <noreply@github.com>2018-11-24 00:01:18 +0800
commit9a94e503da84cc66f643b3972bf8ad4defa02060 (patch)
tree8efb3b6d25ba2574689731bcbea2eac901523d24 /libsolidity/codegen/CompilerContext.cpp
parent4fb15c9327c2c4bfae29f0ff23c1ab0b1218f735 (diff)
parent8dd0338d127b50e60d50f978be68605e8f8faee5 (diff)
downloaddexon-solidity-9a94e503da84cc66f643b3972bf8ad4defa02060.tar
dexon-solidity-9a94e503da84cc66f643b3972bf8ad4defa02060.tar.gz
dexon-solidity-9a94e503da84cc66f643b3972bf8ad4defa02060.tar.bz2
dexon-solidity-9a94e503da84cc66f643b3972bf8ad4defa02060.tar.lz
dexon-solidity-9a94e503da84cc66f643b3972bf8ad4defa02060.tar.xz
dexon-solidity-9a94e503da84cc66f643b3972bf8ad4defa02060.tar.zst
dexon-solidity-9a94e503da84cc66f643b3972bf8ad4defa02060.zip
Merge pull request #5491 from ethereum/libyul-as-library
Libyul as static library (version 3 ;( )
Diffstat (limited to 'libsolidity/codegen/CompilerContext.cpp')
-rw-r--r--libsolidity/codegen/CompilerContext.cpp31
1 files changed, 15 insertions, 16 deletions
diff --git a/libsolidity/codegen/CompilerContext.cpp b/libsolidity/codegen/CompilerContext.cpp
index 9e4f2882..d1bf29fc 100644
--- a/libsolidity/codegen/CompilerContext.cpp
+++ b/libsolidity/codegen/CompilerContext.cpp
@@ -25,15 +25,14 @@
#include <libsolidity/ast/AST.h>
#include <libsolidity/codegen/Compiler.h>
#include <libsolidity/interface/Version.h>
-#include <liblangutil/ErrorReporter.h>
-#include <liblangutil/Scanner.h>
#include <libsolidity/interface/SourceReferenceFormatter.h>
-#include <liblangutil/Scanner.h>
-#include <libsolidity/inlineasm/AsmParser.h>
-#include <libsolidity/inlineasm/AsmCodeGen.h>
-#include <libsolidity/inlineasm/AsmAnalysis.h>
-#include <libsolidity/inlineasm/AsmAnalysisInfo.h>
+#include <libyul/AsmParser.h>
+#include <libyul/AsmCodeGen.h>
+#include <libyul/AsmAnalysis.h>
+#include <libyul/AsmAnalysisInfo.h>
#include <libyul/YulString.h>
+#include <liblangutil/ErrorReporter.h>
+#include <liblangutil/Scanner.h>
#include <boost/algorithm/string/replace.hpp>
@@ -43,7 +42,7 @@
// Change to "define" to output all intermediate code
#undef SOL_OUTPUT_ASM
#ifdef SOL_OUTPUT_ASM
-#include <libsolidity/inlineasm/AsmPrinter.h>
+#include <libyul/AsmPrinter.h>
#endif
@@ -324,7 +323,7 @@ void CompilerContext::appendInlineAssembly(
yul::ExternalIdentifierAccess identifierAccess;
identifierAccess.resolve = [&](
- assembly::Identifier const& _identifier,
+ yul::Identifier const& _identifier,
yul::IdentifierContext,
bool
)
@@ -333,7 +332,7 @@ void CompilerContext::appendInlineAssembly(
return it == _localVariables.end() ? size_t(-1) : 1;
};
identifierAccess.generateCode = [&](
- assembly::Identifier const& _identifier,
+ yul::Identifier const& _identifier,
yul::IdentifierContext _context,
yul::AbstractAssembly& _assembly
)
@@ -362,19 +361,19 @@ void CompilerContext::appendInlineAssembly(
ErrorList errors;
ErrorReporter errorReporter(errors);
auto scanner = make_shared<langutil::Scanner>(langutil::CharStream(_assembly), "--CODEGEN--");
- auto parserResult = assembly::Parser(errorReporter, assembly::AsmFlavour::Strict).parse(scanner, false);
+ auto parserResult = yul::Parser(errorReporter, yul::AsmFlavour::Strict).parse(scanner, false);
#ifdef SOL_OUTPUT_ASM
- cout << assembly::AsmPrinter()(*parserResult) << endl;
+ cout << yul::AsmPrinter()(*parserResult) << endl;
#endif
- assembly::AsmAnalysisInfo analysisInfo;
+ yul::AsmAnalysisInfo analysisInfo;
bool analyzerResult = false;
if (parserResult)
- analyzerResult = assembly::AsmAnalyzer(
+ analyzerResult = yul::AsmAnalyzer(
analysisInfo,
errorReporter,
m_evmVersion,
boost::none,
- assembly::AsmFlavour::Strict,
+ yul::AsmFlavour::Strict,
identifierAccess.resolve
).analyze(*parserResult);
if (!parserResult || !errorReporter.errors().empty() || !analyzerResult)
@@ -396,7 +395,7 @@ void CompilerContext::appendInlineAssembly(
}
solAssert(errorReporter.errors().empty(), "Failed to analyze inline assembly block.");
- assembly::CodeGenerator::assemble(*parserResult, analysisInfo, *m_asm, identifierAccess, _system);
+ yul::CodeGenerator::assemble(*parserResult, analysisInfo, *m_asm, identifierAccess, _system);
// Reset the source location to the one of the node (instead of the CODEGEN source location)
updateSourceLocation();