mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Refactor error reporting
This commit introduces ErrorReporter, a utility class which consolidates all of the error logging functionality into a common set of functions. It also replaces all direct interactions with an ErrorList with calls to an ErrorReporter. This commit resolves issue #2209
This commit is contained in:
1 parent
0066a08aa8
commit
89b60ffbd4
47 files changed
+770
-707
No files matched your search
@@ -520,7 +520,8 @@ bool ContractCompiler::visit(FunctionDefinition const& _function)
|
||||
bool ContractCompiler::visit(InlineAssembly const& _inlineAssembly)
|
||||
{
|
||||
ErrorList errors;
|
||||
assembly::CodeGenerator codeGen(errors);
|
||||
ErrorReporter errorReporter(errors);
|
||||
assembly::CodeGenerator codeGen(errorReporter);
|
||||
unsigned startStackHeight = m_context.stackHeight();
|
||||
julia::ExternalIdentifierAccess identifierAccess;
|
||||
identifierAccess.resolve = [&](assembly::Identifier const& _identifier, julia::IdentifierContext)
|
||||
@@ -648,7 +649,7 @@ bool ContractCompiler::visit(InlineAssembly const& _inlineAssembly)
|
||||
m_context.nonConstAssembly(),
|
||||
identifierAccess
|
||||
);
|
||||
solAssert(Error::containsOnlyWarnings(errors), "Code generation for inline assembly with errors requested.");
|
||||
solAssert(Error::containsOnlyWarnings(errorReporter.errors()), "Code generation for inline assembly with errors requested.");
|
||||
m_context.setStackOffset(startStackHeight);
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user