aboutsummaryrefslogtreecommitdiffstats
path: root/solc/jsonCompiler.cpp
diff options
context:
space:
mode:
authorRhett Aultman <roadriverrail@gmail.com>2017-05-11 21:26:35 +0800
committerRhett Aultman <roadriverrail@gmail.com>2017-05-30 22:28:31 +0800
commit89b60ffbd4c2dde26fa5e9f1d750729b5c89373e (patch)
treea4c464d4d40baaa260f071c1028f347bd287e44d /solc/jsonCompiler.cpp
parent0066a08aa8f6c469cde7947ec50ca662a32123a0 (diff)
downloaddexon-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 'solc/jsonCompiler.cpp')
-rw-r--r--solc/jsonCompiler.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/solc/jsonCompiler.cpp b/solc/jsonCompiler.cpp
index 7f99324e..1505a43d 100644
--- a/solc/jsonCompiler.cpp
+++ b/solc/jsonCompiler.cpp
@@ -218,12 +218,13 @@ string compile(StringMap const& _sources, bool _optimize, CStyleReadFileCallback
{
// Do not taint the internal error list
ErrorList formalErrors;
- if (compiler.prepareFormalAnalysis(&formalErrors))
+ ErrorReporter errorReporter(formalErrors);
+ if (compiler.prepareFormalAnalysis(&errorReporter))
output["formal"]["why3"] = compiler.formalTranslation();
- if (!formalErrors.empty())
+ if (!errorReporter.errors().empty())
{
Json::Value errors(Json::arrayValue);
- for (auto const& error: formalErrors)
+ for (auto const& error: errorReporter.errors())
errors.append(SourceReferenceFormatter::formatExceptionInformation(
*error,
(error->type() == Error::Type::Warning) ? "Warning" : "Error",