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:
Rhett Aultman
2017-05-30 07:28:31 -07:00
parent 0066a08aa8
commit 89b60ffbd4
47 changed files with 770 additions and 707 deletions
+4 -4
View File
@@ -23,7 +23,6 @@
#pragma once
#include <libsolidity/inlineasm/AsmAnalysis.h>
#include <libsolidity/interface/Exceptions.h>
#include <functional>
@@ -35,6 +34,7 @@ class Assembly;
}
namespace solidity
{
class ErrorReporter;
namespace assembly
{
struct Block;
@@ -42,8 +42,8 @@ struct Block;
class CodeGenerator
{
public:
CodeGenerator(ErrorList& _errors):
m_errors(_errors) {}
CodeGenerator(ErrorReporter& _errorReporter):
m_errorReporter(_errorReporter) {}
/// Performs code generation and @returns the result.
eth::Assembly assemble(
Block const& _parsedData,
@@ -59,7 +59,7 @@ public:
);
private:
ErrorList& m_errors;
ErrorReporter& m_errorReporter;
};
}