diff options
author | Christian <c@ethdev.com> | 2015-02-11 21:32:46 +0800 |
---|---|---|
committer | Christian <c@ethdev.com> | 2015-02-12 18:33:10 +0800 |
commit | 9b8cf4af1db58f3b38ca3172faf53dc5deab84ce (patch) | |
tree | 92b63ed6a3993e6ce7277db71c077bba199981f8 /CompilerUtils.h | |
parent | 8a2879a603b256dbff9c4592943c48e68fba1aea (diff) | |
download | dexon-solidity-9b8cf4af1db58f3b38ca3172faf53dc5deab84ce.tar.gz dexon-solidity-9b8cf4af1db58f3b38ca3172faf53dc5deab84ce.tar.zst dexon-solidity-9b8cf4af1db58f3b38ca3172faf53dc5deab84ce.zip |
Moved copy code to CompilerUtils.
Diffstat (limited to 'CompilerUtils.h')
-rw-r--r-- | CompilerUtils.h | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/CompilerUtils.h b/CompilerUtils.h index 49375047..7ac3cc29 100644 --- a/CompilerUtils.h +++ b/CompilerUtils.h @@ -75,12 +75,23 @@ public: /// @note Only works for types of fixed size. void computeHashStatic(Type const& _type = IntegerType(256), bool _padToWordBoundaries = false); + /// Copies a byte array to a byte array in storage, where the target is assumed to be on the + /// to top of the stay. Leaves a reference to the target on the stack. + void copyByteArrayToStorage(ByteArrayType const& _targetType, ByteArrayType const& _sourceType) const; + /// Clears the length and data elements of the byte array referenced on the stack. + /// Removes the reference from the stack. + void clearByteArray(ByteArrayType const& _type) const; + /// Bytes we need to the start of call data. /// - The size in bytes of the function (hash) identifier. static const unsigned int dataStartOffset; private: - unsigned prepareMemoryStore(Type const& _type, bool _padToWordBoundaries); + unsigned prepareMemoryStore(Type const& _type, bool _padToWordBoundaries) const; + /// Appends a loop that clears all storage between the storage reference at the stack top + /// and the one below it (excluding). + /// Will leave the single value of the end pointer on the stack. + void clearStorageLoop() const; CompilerContext& m_context; }; |