diff options
Diffstat (limited to 'ASTPrinter.cpp')
-rw-r--r-- | ASTPrinter.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/ASTPrinter.cpp b/ASTPrinter.cpp index 713059d3..f21ec5e3 100644 --- a/ASTPrinter.cpp +++ b/ASTPrinter.cpp @@ -30,8 +30,10 @@ namespace dev namespace solidity { -ASTPrinter::ASTPrinter(ASTNode const& _ast, string const& _source): - m_indentation(0), m_source(_source), m_ast(&_ast) +ASTPrinter::ASTPrinter(ASTNode const& _ast, + string const& _source, + StructuralGasEstimator::ASTGasConsumption const& _gasCosts +): m_indentation(0), m_source(_source), m_ast(&_ast), m_gasCosts(_gasCosts) { } @@ -503,6 +505,8 @@ void ASTPrinter::endVisit(Literal const&) void ASTPrinter::printSourcePart(ASTNode const& _node) { + if (m_gasCosts.count(&_node)) + *m_ostream << getIndentation() << " Gas costs: " << m_gasCosts.at(&_node) << endl; if (!m_source.empty()) { SourceLocation const& location(_node.getLocation()); |