aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity/codegen/ABIFunctions.h
diff options
context:
space:
mode:
authorchriseth <chris@ethereum.org>2017-09-21 22:56:16 +0800
committerGitHub <noreply@github.com>2017-09-21 22:56:16 +0800
commitbdeb9e52a2211510644fb53df93fb98258b40a65 (patch)
treed8fb917e7dc27b937cb4505029bbc3c8c1bc1a67 /libsolidity/codegen/ABIFunctions.h
parentd7661dd97460250b4e1127b9e7ea91e116143780 (diff)
parenta14fc5ffa1f03d5aa312396a39633d720b04c90a (diff)
downloaddexon-solidity-bdeb9e52a2211510644fb53df93fb98258b40a65.tar
dexon-solidity-bdeb9e52a2211510644fb53df93fb98258b40a65.tar.gz
dexon-solidity-bdeb9e52a2211510644fb53df93fb98258b40a65.tar.bz2
dexon-solidity-bdeb9e52a2211510644fb53df93fb98258b40a65.tar.lz
dexon-solidity-bdeb9e52a2211510644fb53df93fb98258b40a65.tar.xz
dexon-solidity-bdeb9e52a2211510644fb53df93fb98258b40a65.tar.zst
dexon-solidity-bdeb9e52a2211510644fb53df93fb98258b40a65.zip
Merge pull request #2947 from ethereum/develop
Merge develop into release for 0.4.17.
Diffstat (limited to 'libsolidity/codegen/ABIFunctions.h')
-rw-r--r--libsolidity/codegen/ABIFunctions.h22
1 files changed, 16 insertions, 6 deletions
diff --git a/libsolidity/codegen/ABIFunctions.h b/libsolidity/codegen/ABIFunctions.h
index e43e2323..de2a140a 100644
--- a/libsolidity/codegen/ABIFunctions.h
+++ b/libsolidity/codegen/ABIFunctions.h
@@ -44,15 +44,18 @@ using TypePointers = std::vector<TypePointer>;
/// multiple times.
///
/// Make sure to include the result of ``requestedFunctions()`` to a block that
-/// is visible from the code that was generated here.
+/// is visible from the code that was generated here, or use named labels.
class ABIFunctions
{
public:
- ~ABIFunctions();
-
- /// @returns assembly code block to ABI-encode values of @a _givenTypes residing on the stack
+ /// @returns name of an assembly function to ABI-encode values of @a _givenTypes
/// into memory, converting the types to @a _targetTypes on the fly.
- /// Assumed variables to be present: <$value0> <$value1> ... <$value(n-1)> <$headStart>
+ /// Parameters are: <headStart> <value_n> ... <value_1>, i.e.
+ /// the layout on the stack is <value_1> ... <value_n> <headStart> with
+ /// the top of the stack on the right.
+ /// The values represent stack slots. If a type occupies more or less than one
+ /// stack slot, it takes exactly that number of values.
+ /// Returns a pointer to the end of the area written in memory.
/// Does not allocate memory (does not change the memory head pointer), but writes
/// to memory starting at $headStart and an unrestricted amount after that.
/// Assigns the end of encoded memory either to $value0 or (if that is not present)
@@ -63,7 +66,7 @@ public:
bool _encodeAsLibraryTypes = false
);
- /// @returns auxiliary functions referenced from the block generated in @a tupleEncoder
+ /// @returns concatenation of all generated functions.
std::string requestedFunctions();
private:
@@ -120,6 +123,13 @@ private:
bool _encodeAsLibraryTypes
);
+ /// Part of @a abiEncodingFunction for struct types.
+ std::string abiEncodingFunctionStruct(
+ StructType const& _givenType,
+ StructType const& _targetType,
+ bool _encodeAsLibraryTypes
+ );
+
// @returns the name of the ABI encoding function with the given type
// and queues the generation of the function to the requested functions.
// Case for _givenType being a string literal