aboutsummaryrefslogtreecommitdiffstats
path: root/libjulia/backends
diff options
context:
space:
mode:
Diffstat (limited to 'libjulia/backends')
-rw-r--r--libjulia/backends/evm/EVMCodeTransform.cpp15
-rw-r--r--libjulia/backends/evm/EVMCodeTransform.h11
2 files changed, 12 insertions, 14 deletions
diff --git a/libjulia/backends/evm/EVMCodeTransform.cpp b/libjulia/backends/evm/EVMCodeTransform.cpp
index 18c3e63c..355a9595 100644
--- a/libjulia/backends/evm/EVMCodeTransform.cpp
+++ b/libjulia/backends/evm/EVMCodeTransform.cpp
@@ -32,14 +32,14 @@ using namespace dev::solidity;
using namespace dev::solidity::assembly;
CodeTransform::CodeTransform(
- ErrorList& _errors,
+ ErrorReporter& _errorReporter,
AbstractAssembly& _assembly,
Block const& _block,
AsmAnalysisInfo& _analysisInfo,
ExternalIdentifierAccess const& _identifierAccess,
int _initialStackHeight
):
- m_errors(_errors),
+ m_errorReporter(_errorReporter),
m_assembly(_assembly),
m_info(_analysisInfo),
m_scope(*_analysisInfo.scopes.at(&_block)),
@@ -91,11 +91,10 @@ int CodeTransform::variableHeightDiff(solidity::assembly::Scope::Variable const&
if (heightDiff <= (_forSwap ? 1 : 0) || heightDiff > (_forSwap ? 17 : 16))
{
//@TODO move this to analysis phase.
- m_errors.push_back(make_shared<Error>(
- Error::Type::TypeError,
- "Variable inaccessible, too deep inside stack (" + boost::lexical_cast<string>(heightDiff) + ")",
- _location
- ));
+ m_errorReporter.typeError(
+ _location,
+ "Variable inaccessible, too deep inside stack (" + boost::lexical_cast<string>(heightDiff) + ")"
+ );
return 0;
}
else
@@ -124,7 +123,7 @@ void CodeTransform::assignLabelIdIfUnset(Scope::Label& _label)
void CodeTransform::operator()(Block const& _block)
{
- CodeTransform(m_errors, m_assembly, _block, m_info, m_identifierAccess, m_initialStackHeight);
+ CodeTransform(m_errorReporter, m_assembly, _block, m_info, m_identifierAccess, m_initialStackHeight);
checkStackHeight(&_block);
}
diff --git a/libjulia/backends/evm/EVMCodeTransform.h b/libjulia/backends/evm/EVMCodeTransform.h
index 5408a3aa..64e76246 100644
--- a/libjulia/backends/evm/EVMCodeTransform.h
+++ b/libjulia/backends/evm/EVMCodeTransform.h
@@ -20,8 +20,6 @@
#include <libjulia/backends/evm/AbstractAssembly.h>
-#include <libsolidity/interface/Exceptions.h>
-
#include <libsolidity/inlineasm/AsmStack.h>
#include <libsolidity/inlineasm/AsmScope.h>
@@ -31,6 +29,7 @@ namespace dev
{
namespace solidity
{
+class ErrorReporter;
namespace assembly
{
struct Literal;
@@ -59,18 +58,18 @@ public:
/// of its creation.
/// @param _identifierAccess used to resolve identifiers external to the inline assembly
CodeTransform(
- solidity::ErrorList& _errors,
+ solidity::ErrorReporter& _errorReporter,
julia::AbstractAssembly& _assembly,
solidity::assembly::Block const& _block,
solidity::assembly::AsmAnalysisInfo& _analysisInfo,
ExternalIdentifierAccess const& _identifierAccess = ExternalIdentifierAccess()
- ): CodeTransform(_errors, _assembly, _block, _analysisInfo, _identifierAccess, _assembly.stackHeight())
+ ): CodeTransform(_errorReporter, _assembly, _block, _analysisInfo, _identifierAccess, _assembly.stackHeight())
{
}
private:
CodeTransform(
- solidity::ErrorList& _errors,
+ solidity::ErrorReporter& _errorReporter,
julia::AbstractAssembly& _assembly,
solidity::assembly::Block const& _block,
solidity::assembly::AsmAnalysisInfo& _analysisInfo,
@@ -107,7 +106,7 @@ private:
/// Assigns the label's id to a value taken from eth::Assembly if it has not yet been set.
void assignLabelIdIfUnset(solidity::assembly::Scope::Label& _label);
- solidity::ErrorList& m_errors;
+ solidity::ErrorReporter& m_errorReporter;
julia::AbstractAssembly& m_assembly;
solidity::assembly::AsmAnalysisInfo& m_info;
solidity::assembly::Scope& m_scope;