diff options
author | chriseth <c@ethdev.com> | 2015-05-06 16:43:59 +0800 |
---|---|---|
committer | chriseth <c@ethdev.com> | 2015-05-06 16:43:59 +0800 |
commit | c3e5fe6a1205068c9b5ded84f8ae96d97f855c1b (patch) | |
tree | a1a16e63550143e4dcbec6283be8b2f11710c80f /ASTPrinter.cpp | |
parent | 22eaf8ecd80d3bf091826a4c71d07d4f6269ce80 (diff) | |
download | dexon-solidity-c3e5fe6a1205068c9b5ded84f8ae96d97f855c1b.tar dexon-solidity-c3e5fe6a1205068c9b5ded84f8ae96d97f855c1b.tar.gz dexon-solidity-c3e5fe6a1205068c9b5ded84f8ae96d97f855c1b.tar.bz2 dexon-solidity-c3e5fe6a1205068c9b5ded84f8ae96d97f855c1b.tar.lz dexon-solidity-c3e5fe6a1205068c9b5ded84f8ae96d97f855c1b.tar.xz dexon-solidity-c3e5fe6a1205068c9b5ded84f8ae96d97f855c1b.tar.zst dexon-solidity-c3e5fe6a1205068c9b5ded84f8ae96d97f855c1b.zip |
Structural gas estimator.
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()); |