|
@ -61,7 +61,9 @@ public: |
|
|
/// Stores zero in the lvalue. Removes the reference from the stack if @a _removeReference is true.
|
|
|
/// Stores zero in the lvalue. Removes the reference from the stack if @a _removeReference is true.
|
|
|
/// @a _location is the source location of the requested operation
|
|
|
/// @a _location is the source location of the requested operation
|
|
|
virtual void setToZero( |
|
|
virtual void setToZero( |
|
|
SourceLocation const& _location = SourceLocation(), bool _removeReference = true) const = 0; |
|
|
SourceLocation const& _location = SourceLocation(), |
|
|
|
|
|
bool _removeReference = true |
|
|
|
|
|
) const = 0; |
|
|
|
|
|
|
|
|
protected: |
|
|
protected: |
|
|
CompilerContext& m_context; |
|
|
CompilerContext& m_context; |
|
@ -78,10 +80,15 @@ public: |
|
|
|
|
|
|
|
|
virtual unsigned sizeOnStack() const override { return 0; } |
|
|
virtual unsigned sizeOnStack() const override { return 0; } |
|
|
virtual void retrieveValue(SourceLocation const& _location, bool _remove = false) const override; |
|
|
virtual void retrieveValue(SourceLocation const& _location, bool _remove = false) const override; |
|
|
virtual void storeValue(Type const& _sourceType, |
|
|
virtual void storeValue( |
|
|
SourceLocation const& _location = SourceLocation(), bool _move = false) const override; |
|
|
Type const& _sourceType, |
|
|
|
|
|
SourceLocation const& _location = SourceLocation(), |
|
|
|
|
|
bool _move = false |
|
|
|
|
|
) const override; |
|
|
virtual void setToZero( |
|
|
virtual void setToZero( |
|
|
SourceLocation const& _location = SourceLocation(), bool _removeReference = true) const override; |
|
|
SourceLocation const& _location = SourceLocation(), |
|
|
|
|
|
bool _removeReference = true |
|
|
|
|
|
) const override; |
|
|
|
|
|
|
|
|
private: |
|
|
private: |
|
|
/// Base stack offset (@see CompilerContext::getBaseStackOffsetOfVariable) of the local variable.
|
|
|
/// Base stack offset (@see CompilerContext::getBaseStackOffsetOfVariable) of the local variable.
|
|
@ -101,10 +108,15 @@ public: |
|
|
/// Constructs the LValue and assumes that the storage reference is already on the stack.
|
|
|
/// Constructs the LValue and assumes that the storage reference is already on the stack.
|
|
|
StorageItem(CompilerContext& _compilerContext, Type const& _type); |
|
|
StorageItem(CompilerContext& _compilerContext, Type const& _type); |
|
|
virtual void retrieveValue(SourceLocation const& _location, bool _remove = false) const override; |
|
|
virtual void retrieveValue(SourceLocation const& _location, bool _remove = false) const override; |
|
|
virtual void storeValue(Type const& _sourceType, |
|
|
virtual void storeValue( |
|
|
SourceLocation const& _location = SourceLocation(), bool _move = false) const override; |
|
|
Type const& _sourceType, |
|
|
|
|
|
SourceLocation const& _location = SourceLocation(), |
|
|
|
|
|
bool _move = false |
|
|
|
|
|
) const override; |
|
|
virtual void setToZero( |
|
|
virtual void setToZero( |
|
|
SourceLocation const& _location = SourceLocation(), bool _removeReference = true) const override; |
|
|
SourceLocation const& _location = SourceLocation(), |
|
|
|
|
|
bool _removeReference = true |
|
|
|
|
|
) const override; |
|
|
|
|
|
|
|
|
private: |
|
|
private: |
|
|
/// Number of stack elements occupied by the value (not the reference).
|
|
|
/// Number of stack elements occupied by the value (not the reference).
|
|
@ -123,10 +135,15 @@ public: |
|
|
StorageByteArrayElement(CompilerContext& _compilerContext); |
|
|
StorageByteArrayElement(CompilerContext& _compilerContext); |
|
|
virtual unsigned sizeOnStack() const override { return 2; } |
|
|
virtual unsigned sizeOnStack() const override { return 2; } |
|
|
virtual void retrieveValue(SourceLocation const& _location, bool _remove = false) const override; |
|
|
virtual void retrieveValue(SourceLocation const& _location, bool _remove = false) const override; |
|
|
virtual void storeValue(Type const& _sourceType, |
|
|
virtual void storeValue( |
|
|
SourceLocation const& _location = SourceLocation(), bool _move = false) const override; |
|
|
Type const& _sourceType, |
|
|
|
|
|
SourceLocation const& _location = SourceLocation(), |
|
|
|
|
|
bool _move = false |
|
|
|
|
|
) const override; |
|
|
virtual void setToZero( |
|
|
virtual void setToZero( |
|
|
SourceLocation const& _location = SourceLocation(), bool _removeReference = true) const override; |
|
|
SourceLocation const& _location = SourceLocation(), |
|
|
|
|
|
bool _removeReference = true |
|
|
|
|
|
) const override; |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
/**
|
|
|
/**
|
|
@ -140,10 +157,15 @@ public: |
|
|
/// Constructs the LValue, assumes that the reference to the array head is already on the stack.
|
|
|
/// Constructs the LValue, assumes that the reference to the array head is already on the stack.
|
|
|
StorageArrayLength(CompilerContext& _compilerContext, ArrayType const& _arrayType); |
|
|
StorageArrayLength(CompilerContext& _compilerContext, ArrayType const& _arrayType); |
|
|
virtual void retrieveValue(SourceLocation const& _location, bool _remove = false) const override; |
|
|
virtual void retrieveValue(SourceLocation const& _location, bool _remove = false) const override; |
|
|
virtual void storeValue(Type const& _sourceType, |
|
|
virtual void storeValue( |
|
|
SourceLocation const& _location = SourceLocation(), bool _move = false) const override; |
|
|
Type const& _sourceType, |
|
|
|
|
|
SourceLocation const& _location = SourceLocation(), |
|
|
|
|
|
bool _move = false |
|
|
|
|
|
) const override; |
|
|
virtual void setToZero( |
|
|
virtual void setToZero( |
|
|
SourceLocation const& _location = SourceLocation(), bool _removeReference = true) const override; |
|
|
SourceLocation const& _location = SourceLocation(), |
|
|
|
|
|
bool _removeReference = true |
|
|
|
|
|
) const override; |
|
|
|
|
|
|
|
|
private: |
|
|
private: |
|
|
ArrayType const& m_arrayType; |
|
|
ArrayType const& m_arrayType; |
|
|