diff options
author | Daniel Kirchner <daniel@ekpyron.org> | 2018-05-04 21:58:10 +0800 |
---|---|---|
committer | Daniel Kirchner <daniel@ekpyron.org> | 2018-05-15 02:23:40 +0800 |
commit | 995623f0fa37fdaa6be3dd2d95540fc123ce4248 (patch) | |
tree | 100a146f59c86364e1080abff42c794d499e4767 /libsolidity/interface | |
parent | ab63ab1cbb2f3fe68d2db991710b53e2c8c25f2d (diff) | |
download | dexon-solidity-995623f0fa37fdaa6be3dd2d95540fc123ce4248.tar.gz dexon-solidity-995623f0fa37fdaa6be3dd2d95540fc123ce4248.tar.zst dexon-solidity-995623f0fa37fdaa6be3dd2d95540fc123ce4248.zip |
Add control flow graph.
Diffstat (limited to 'libsolidity/interface')
-rw-r--r-- | libsolidity/interface/CompilerStack.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/libsolidity/interface/CompilerStack.cpp b/libsolidity/interface/CompilerStack.cpp index 4ff14aa2..195f806a 100644 --- a/libsolidity/interface/CompilerStack.cpp +++ b/libsolidity/interface/CompilerStack.cpp @@ -29,6 +29,7 @@ #include <libsolidity/ast/AST.h> #include <libsolidity/parsing/Scanner.h> #include <libsolidity/parsing/Parser.h> +#include <libsolidity/analysis/ControlFlowGraph.h> #include <libsolidity/analysis/GlobalContext.h> #include <libsolidity/analysis/NameAndTypeResolver.h> #include <libsolidity/analysis/TypeChecker.h> @@ -224,6 +225,14 @@ bool CompilerStack::analyze() if (noErrors) { + CFG cfg(m_errorReporter); + for (Source const* source: m_sourceOrder) + if (!cfg.constructFlow(*source->ast)) + noErrors = false; + } + + if (noErrors) + { StaticAnalyzer staticAnalyzer(m_errorReporter); for (Source const* source: m_sourceOrder) if (!staticAnalyzer.analyze(*source->ast)) |