mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Added hashFunction to Dialect. For EVMDialect, it is keccak256
In a later PR, the functions `storageLoadFunction`, `storageStoreFunctions`, etc will be refactored to return a YulString instead of a pointer to a BuiltinFunction.
This commit is contained in:
parent
dd6300a53e
commit
94f9410abe
@ -79,6 +79,7 @@ struct Dialect: boost::noncopyable
|
|||||||
virtual BuiltinFunction const* memoryLoadFunction(YulString /* _type */) const { return nullptr; }
|
virtual BuiltinFunction const* memoryLoadFunction(YulString /* _type */) const { return nullptr; }
|
||||||
virtual BuiltinFunction const* storageStoreFunction(YulString /* _type */) const { return nullptr; }
|
virtual BuiltinFunction const* storageStoreFunction(YulString /* _type */) const { return nullptr; }
|
||||||
virtual BuiltinFunction const* storageLoadFunction(YulString /* _type */) const { return nullptr; }
|
virtual BuiltinFunction const* storageLoadFunction(YulString /* _type */) const { return nullptr; }
|
||||||
|
virtual YulString hashFunction(YulString /* _type */ ) const { return YulString{}; }
|
||||||
|
|
||||||
/// Check whether the given type is legal for the given literal value.
|
/// Check whether the given type is legal for the given literal value.
|
||||||
/// Should only be called if the type exists in the dialect at all.
|
/// Should only be called if the type exists in the dialect at all.
|
||||||
|
@ -81,6 +81,7 @@ struct EVMDialect: public Dialect
|
|||||||
BuiltinFunctionForEVM const* memoryLoadFunction(YulString /*_type*/) const override { return builtin("mload"_yulstring); }
|
BuiltinFunctionForEVM const* memoryLoadFunction(YulString /*_type*/) const override { return builtin("mload"_yulstring); }
|
||||||
BuiltinFunctionForEVM const* storageStoreFunction(YulString /*_type*/) const override { return builtin("sstore"_yulstring); }
|
BuiltinFunctionForEVM const* storageStoreFunction(YulString /*_type*/) const override { return builtin("sstore"_yulstring); }
|
||||||
BuiltinFunctionForEVM const* storageLoadFunction(YulString /*_type*/) const override { return builtin("sload"_yulstring); }
|
BuiltinFunctionForEVM const* storageLoadFunction(YulString /*_type*/) const override { return builtin("sload"_yulstring); }
|
||||||
|
YulString hashFunction(YulString /*_type*/) const override { return "keccak256"_yulstring; }
|
||||||
|
|
||||||
static EVMDialect const& strictAssemblyForEVM(langutil::EVMVersion _version);
|
static EVMDialect const& strictAssemblyForEVM(langutil::EVMVersion _version);
|
||||||
static EVMDialect const& strictAssemblyForEVMObjects(langutil::EVMVersion _version);
|
static EVMDialect const& strictAssemblyForEVMObjects(langutil::EVMVersion _version);
|
||||||
|
Loading…
Reference in New Issue
Block a user