diff options
author | Liana Husikyan <liana@ethdev.com> | 2015-02-17 23:21:38 +0800 |
---|---|---|
committer | Liana Husikyan <liana@ethdev.com> | 2015-02-21 05:50:34 +0800 |
commit | 52050201e39b823ea9e6133e47c7e9e779dc1f07 (patch) | |
tree | bf415cf6c45a0f6ee9468849c5c708217f366260 /ExpressionCompiler.h | |
parent | 26132363d5a11d762224cc7c8acc6b8c854cf646 (diff) | |
download | dexon-solidity-52050201e39b823ea9e6133e47c7e9e779dc1f07.tar.gz dexon-solidity-52050201e39b823ea9e6133e47c7e9e779dc1f07.tar.zst dexon-solidity-52050201e39b823ea9e6133e47c7e9e779dc1f07.zip |
Inline member initialisation
renamed VariableDefinition class to VariableDeclarationStatement
added tests
Diffstat (limited to 'ExpressionCompiler.h')
-rw-r--r-- | ExpressionCompiler.h | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/ExpressionCompiler.h b/ExpressionCompiler.h index 471d8186..3567a914 100644 --- a/ExpressionCompiler.h +++ b/ExpressionCompiler.h @@ -59,6 +59,9 @@ public: /// Appends code for a State Variable accessor function static void appendStateVariableAccessor(CompilerContext& _context, VariableDeclaration const& _varDecl, bool _optimize = false); + /// Appends code for a State Variable Initialization function + static void appendStateVariableInitialization(CompilerContext& _context, VariableDeclaration const& _varDecl, bool _optimize = false); + private: explicit ExpressionCompiler(CompilerContext& _compilerContext, bool _optimize = false): m_optimize(_optimize), m_context(_compilerContext), m_currentLValue(m_context) {} @@ -111,6 +114,9 @@ private: /// Appends code for a State Variable accessor function void appendStateVariableAccessor(VariableDeclaration const& _varDecl); + /// Appends code for a State Variable initialization + void appendStateVariableInitialization(VariableDeclaration const& _varDecl); + /** * Helper class to store and retrieve lvalues to and from various locations. * All types except STACK store a reference in a slot on the stack, STACK just @@ -126,8 +132,13 @@ private: std::shared_ptr<Type const> const& _dataType, unsigned _baseStackOffset = 0); /// Set type according to the declaration and retrieve the reference. - /// @a _expression is the current expression + /// @a _identifier is the current identifier void fromIdentifier(Identifier const& _identifier, Declaration const& _declaration); + + /// Set type according to the declaration and retrieve the reference. + /// @a _declaration is the variable declaration + void fromStateVariable(VariableDeclaration const& _declaration); + void reset() { m_type = LValueType::None; m_dataType.reset(); m_baseStackOffset = 0; m_size = 0; } bool isValid() const { return m_type != LValueType::None; } |