diff options
author | Lefteris Karapetsas <lefteris@refu.co> | 2015-01-27 01:16:47 +0800 |
---|---|---|
committer | Lefteris Karapetsas <lefteris@refu.co> | 2015-01-29 04:46:16 +0800 |
commit | 6e793b24996610c5a88a0aafb9fad365d9f12b00 (patch) | |
tree | 16887c6be06407418adbd88a7473ad7db4dd8de5 /ExpressionCompiler.h | |
parent | 3ec6c0b1cbe1be0a95f711ce74b0e360fabdaa96 (diff) | |
download | dexon-solidity-6e793b24996610c5a88a0aafb9fad365d9f12b00.tar.gz dexon-solidity-6e793b24996610c5a88a0aafb9fad365d9f12b00.tar.zst dexon-solidity-6e793b24996610c5a88a0aafb9fad365d9f12b00.zip |
Work on ExpressionCompiler preparing for Accessors from storage
Diffstat (limited to 'ExpressionCompiler.h')
-rw-r--r-- | ExpressionCompiler.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/ExpressionCompiler.h b/ExpressionCompiler.h index 8f784fde..7189bef9 100644 --- a/ExpressionCompiler.h +++ b/ExpressionCompiler.h @@ -95,6 +95,9 @@ private: unsigned appendArgumentCopyToMemory(TypePointers const& _functionType, std::vector<ASTPointer<Expression const>> const& _arguments, unsigned _memoryOffset = 0); + /// Appends code for a State Variable accessor function + void appendStateVariableAccessor(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 @@ -111,6 +114,8 @@ private: /// Set type according to the declaration and retrieve the reference. /// @a _expression is the current expression void fromIdentifier(Identifier const& _identifier, Declaration const& _declaration); + /// Convenience function to set type for a state variable and retrieve the reference + void fromStateVariable(Declaration const& _varDecl, std::shared_ptr<Type const> const& _type); void reset() { m_type = NONE; m_baseStackOffset = 0; m_size = 0; } bool isValid() const { return m_type != NONE; } @@ -125,6 +130,9 @@ private: /// also removes the reference from the stack (note that is does not reset the type to @a NONE). /// @a _expression is the current expression, used for error reporting. void retrieveValue(Expression const& _expression, bool _remove = false) const; + /// Convenience function to retrive Value from Storage. Specific version of + /// @ref retrieveValue + void retrieveValueFromStorage(Expression const& _expression, bool _remove = false) const; /// Stores a value (from the stack directly beneath the reference, which is assumed to /// be on the top of the stack, if any) in the lvalue and removes the reference. /// Also removes the stored value from the stack if @a _move is |