Mappings.

This commit is contained in:
chriseth
2019-05-08 15:54:52 +02:00
parent 4037da9575
commit 595544645e
7 changed files with 153 additions and 0 deletions
+6
View File
@@ -35,6 +35,7 @@ namespace solidity
class Type;
class ArrayType;
class MappingType;
/**
* Component that can generate various useful Yul functions.
@@ -98,6 +99,11 @@ public:
/// Only works for memory arrays, calldata arrays and storage arrays that store one item per slot.
std::string nextArrayElementFunction(ArrayType const& _type);
/// @returns the name of a function that performs index access for mappings.
/// @param _mappingType the type of the mapping
/// @param _keyType the type of the value provided
std::string mappingIndexAccessFunction(MappingType const& _mappingType, Type const& _keyType);
/// @returns a function that reads a value type from storage.
/// Performs bit mask/sign extend cleanup and appropriate left / right shift, but not validation.
/// @param _splitFunctionTypes if false, returns the address and function signature in a