aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity/codegen/ABIFunctions.h
diff options
context:
space:
mode:
authorchriseth <chris@ethereum.org>2017-08-26 00:58:12 +0800
committerAlex Beregszaszi <alex@rtfs.hu>2017-09-16 03:46:32 +0800
commit80ce3ca66f063d8d87c2393e689f92d8608b4e0a (patch)
treeae1376cd7d128573edb235f92191dd30118d07bf /libsolidity/codegen/ABIFunctions.h
parent73771f5bb2d8aee1b71dfcc909a60aa47c591dec (diff)
downloaddexon-solidity-80ce3ca66f063d8d87c2393e689f92d8608b4e0a.tar.gz
dexon-solidity-80ce3ca66f063d8d87c2393e689f92d8608b4e0a.tar.zst
dexon-solidity-80ce3ca66f063d8d87c2393e689f92d8608b4e0a.zip
Move ABI encoder into its own function.
Diffstat (limited to 'libsolidity/codegen/ABIFunctions.h')
-rw-r--r--libsolidity/codegen/ABIFunctions.h15
1 files changed, 9 insertions, 6 deletions
diff --git a/libsolidity/codegen/ABIFunctions.h b/libsolidity/codegen/ABIFunctions.h
index e43e2323..5bbd842f 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: