aboutsummaryrefslogtreecommitdiffstats
path: root/StructuralGasEstimator.h
diff options
context:
space:
mode:
authorchriseth <c@ethdev.com>2015-05-06 19:56:40 +0800
committerchriseth <c@ethdev.com>2015-05-06 19:56:40 +0800
commitc731ae92ca68c2e2cdf761bdf1f81e27097e50fc (patch)
treea9b3ab8594588f65e325dd011d98602b253772ba /StructuralGasEstimator.h
parentc3e5fe6a1205068c9b5ded84f8ae96d97f855c1b (diff)
downloaddexon-solidity-c731ae92ca68c2e2cdf761bdf1f81e27097e50fc.tar
dexon-solidity-c731ae92ca68c2e2cdf761bdf1f81e27097e50fc.tar.gz
dexon-solidity-c731ae92ca68c2e2cdf761bdf1f81e27097e50fc.tar.bz2
dexon-solidity-c731ae92ca68c2e2cdf761bdf1f81e27097e50fc.tar.lz
dexon-solidity-c731ae92ca68c2e2cdf761bdf1f81e27097e50fc.tar.xz
dexon-solidity-c731ae92ca68c2e2cdf761bdf1f81e27097e50fc.tar.zst
dexon-solidity-c731ae92ca68c2e2cdf761bdf1f81e27097e50fc.zip
Use std::array.
Diffstat (limited to 'StructuralGasEstimator.h')
-rw-r--r--StructuralGasEstimator.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/StructuralGasEstimator.h b/StructuralGasEstimator.h
index b9e97643..df1ae509 100644
--- a/StructuralGasEstimator.h
+++ b/StructuralGasEstimator.h
@@ -24,6 +24,7 @@
#include <vector>
#include <map>
+#include <array>
#include <libsolidity/ASTForward.h>
#include <libevmasm/GasMeter.h>
#include <libevmasm/Assembly.h>
@@ -37,11 +38,13 @@ class StructuralGasEstimator
{
public:
using ASTGasConsumption = std::map<ASTNode const*, eth::GasMeter::GasConsumption>;
+ using ASTGasConsumptionSelfAccumulated =
+ std::map<ASTNode const*, std::array<eth::GasMeter::GasConsumption, 2>>;
/// Estimates the gas consumption for every assembly item in the given assembly and stores
/// it by source location.
/// @returns a mapping from each AST node to a pair of its particular and syntactically accumulated gas costs.
- std::map<ASTNode const*, eth::GasMeter::GasConsumption[2]> performEstimation(
+ ASTGasConsumptionSelfAccumulated performEstimation(
eth::AssemblyItems const& _items,
std::vector<ASTNode const*> const& _ast
);
@@ -50,7 +53,7 @@ public:
/// 1. source locations of statements that do not contain other statements
/// 2. maximal source locations that do not overlap locations coming from the first rule
ASTGasConsumption breakToStatementLevel(
- std::map<ASTNode const*, eth::GasMeter::GasConsumption[2]> const& _gasCosts,
+ ASTGasConsumptionSelfAccumulated const& _gasCosts,
std::vector<ASTNode const*> const& _roots
);
};