diff options
author | chriseth <chris@ethereum.org> | 2017-05-24 01:21:14 +0800 |
---|---|---|
committer | chriseth <chris@ethereum.org> | 2017-05-26 21:08:27 +0800 |
commit | 261731f7eea48902983c55163d377e26bbca07da (patch) | |
tree | 42b1c3c91e36fad0b5a35232ffca0fa0687c9090 /libsolidity/codegen | |
parent | 71b923cc36d33bf3e173f2210b33895df49fcbba (diff) | |
download | dexon-solidity-261731f7eea48902983c55163d377e26bbca07da.tar.gz dexon-solidity-261731f7eea48902983c55163d377e26bbca07da.tar.zst dexon-solidity-261731f7eea48902983c55163d377e26bbca07da.zip |
Adapt EVM codegen to new namespace.
Diffstat (limited to 'libsolidity/codegen')
-rw-r--r-- | libsolidity/codegen/CompilerContext.cpp | 10 | ||||
-rw-r--r-- | libsolidity/codegen/ContractCompiler.cpp | 8 |
2 files changed, 9 insertions, 9 deletions
diff --git a/libsolidity/codegen/CompilerContext.cpp b/libsolidity/codegen/CompilerContext.cpp index 5c4f88c4..404a3af6 100644 --- a/libsolidity/codegen/CompilerContext.cpp +++ b/libsolidity/codegen/CompilerContext.cpp @@ -266,10 +266,10 @@ void CompilerContext::appendInlineAssembly( int startStackHeight = stackHeight(); - assembly::ExternalIdentifierAccess identifierAccess; + julia::ExternalIdentifierAccess identifierAccess; identifierAccess.resolve = [&]( assembly::Identifier const& _identifier, - assembly::IdentifierContext + julia::IdentifierContext ) { auto it = std::find(_localVariables.begin(), _localVariables.end(), _identifier.name); @@ -277,7 +277,7 @@ void CompilerContext::appendInlineAssembly( }; identifierAccess.generateCode = [&]( assembly::Identifier const& _identifier, - assembly::IdentifierContext _context, + julia::IdentifierContext _context, julia::AbstractAssembly& _assembly ) { @@ -285,14 +285,14 @@ void CompilerContext::appendInlineAssembly( solAssert(it != _localVariables.end(), ""); int stackDepth = _localVariables.end() - it; int stackDiff = _assembly.stackHeight() - startStackHeight + stackDepth; - if (_context == assembly::IdentifierContext::LValue) + if (_context == julia::IdentifierContext::LValue) stackDiff -= 1; if (stackDiff < 1 || stackDiff > 16) BOOST_THROW_EXCEPTION( CompilerError() << errinfo_comment("Stack too deep (" + to_string(stackDiff) + "), try removing local variables.") ); - if (_context == assembly::IdentifierContext::RValue) + if (_context == julia::IdentifierContext::RValue) _assembly.appendInstruction(dupInstruction(stackDiff)); else { diff --git a/libsolidity/codegen/ContractCompiler.cpp b/libsolidity/codegen/ContractCompiler.cpp index 41940e1a..e79bb6dc 100644 --- a/libsolidity/codegen/ContractCompiler.cpp +++ b/libsolidity/codegen/ContractCompiler.cpp @@ -522,21 +522,21 @@ bool ContractCompiler::visit(InlineAssembly const& _inlineAssembly) ErrorList errors; assembly::CodeGenerator codeGen(errors); unsigned startStackHeight = m_context.stackHeight(); - assembly::ExternalIdentifierAccess identifierAccess; - identifierAccess.resolve = [&](assembly::Identifier const& _identifier, assembly::IdentifierContext) + julia::ExternalIdentifierAccess identifierAccess; + identifierAccess.resolve = [&](assembly::Identifier const& _identifier, julia::IdentifierContext) { auto ref = _inlineAssembly.annotation().externalReferences.find(&_identifier); if (ref == _inlineAssembly.annotation().externalReferences.end()) return size_t(-1); return ref->second.valueSize; }; - identifierAccess.generateCode = [&](assembly::Identifier const& _identifier, assembly::IdentifierContext _context, julia::AbstractAssembly& _assembly) + identifierAccess.generateCode = [&](assembly::Identifier const& _identifier, julia::IdentifierContext _context, julia::AbstractAssembly& _assembly) { auto ref = _inlineAssembly.annotation().externalReferences.find(&_identifier); solAssert(ref != _inlineAssembly.annotation().externalReferences.end(), ""); Declaration const* decl = ref->second.declaration; solAssert(!!decl, ""); - if (_context == assembly::IdentifierContext::RValue) + if (_context == julia::IdentifierContext::RValue) { int const depositBefore = _assembly.stackHeight(); solAssert(!!decl->type(), "Type of declaration required but not yet determined."); |