[Sol->Yul] Implementing dynamic array push for arrays of structs.

This commit is contained in:
Djordje Mijovic
2021-01-11 17:49:42 +01:00
committed by chriseth
parent b06936b11c
commit 85b8325f0b
7 changed files with 104 additions and 50 deletions
+4 -2
View File
@@ -212,8 +212,10 @@ public:
std::string storageArrayPopFunction(ArrayType const& _type);
/// @returns the name of a function that pushes an element to a storage array
/// @param _fromType represents the type of the element being pushed.
/// If _fromType is ReferenceType the function will perform deep copy.
/// signature: (array, value)
std::string storageArrayPushFunction(ArrayType const& _type);
std::string storageArrayPushFunction(ArrayType const& _type, TypePointer _fromType = nullptr);
/// @returns the name of a function that pushes the base type's zero element to a storage array and returns storage slot and offset of the added element.
/// signature: (array) -> slot, offset
@@ -483,7 +485,7 @@ public:
std::string externalCodeFunction();
private:
/// @returns function that copies struct to storage
/// @returns the name of a function that copies a struct from calldata or memory to storage
/// signature: (slot, value) ->
std::string copyStructToStorageFunction(StructType const& _from, StructType const& _to);