diff options
author | Rhett Aultman <roadriverrail@gmail.com> | 2017-05-11 21:26:35 +0800 |
---|---|---|
committer | Rhett Aultman <roadriverrail@gmail.com> | 2017-05-30 22:28:31 +0800 |
commit | 89b60ffbd4c2dde26fa5e9f1d750729b5c89373e (patch) | |
tree | a4c464d4d40baaa260f071c1028f347bd287e44d /libsolidity/analysis/StaticAnalyzer.h | |
parent | 0066a08aa8f6c469cde7947ec50ca662a32123a0 (diff) | |
download | dexon-solidity-89b60ffbd4c2dde26fa5e9f1d750729b5c89373e.tar.gz dexon-solidity-89b60ffbd4c2dde26fa5e9f1d750729b5c89373e.tar.zst dexon-solidity-89b60ffbd4c2dde26fa5e9f1d750729b5c89373e.zip |
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
Diffstat (limited to 'libsolidity/analysis/StaticAnalyzer.h')
-rw-r--r-- | libsolidity/analysis/StaticAnalyzer.h | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/libsolidity/analysis/StaticAnalyzer.h b/libsolidity/analysis/StaticAnalyzer.h index 458bab2a..cd6913b5 100644 --- a/libsolidity/analysis/StaticAnalyzer.h +++ b/libsolidity/analysis/StaticAnalyzer.h @@ -44,15 +44,13 @@ class StaticAnalyzer: private ASTConstVisitor { public: /// @param _errors the reference to the list of errors and warnings to add them found during static analysis. - explicit StaticAnalyzer(ErrorList& _errors): m_errors(_errors) {} + explicit StaticAnalyzer(ErrorReporter& _errorReporter): m_errorReporter(_errorReporter) {} /// Performs static analysis on the given source unit and all of its sub-nodes. /// @returns true iff all checks passed. Note even if all checks passed, errors() can still contain warnings bool analyze(SourceUnit const& _sourceUnit); private: - /// Adds a new warning to the list of errors. - void warning(SourceLocation const& _location, std::string const& _description); virtual bool visit(ContractDefinition const& _contract) override; virtual void endVisit(ContractDefinition const& _contract) override; @@ -67,7 +65,7 @@ private: virtual bool visit(MemberAccess const& _memberAccess) override; virtual bool visit(InlineAssembly const& _inlineAssembly) override; - ErrorList& m_errors; + ErrorReporter& m_errorReporter; /// Flag that indicates whether the current contract definition is a library. bool m_library = false; |