diff options
author | Christian <c@ethdev.com> | 2014-12-11 06:01:40 +0800 |
---|---|---|
committer | Christian <c@ethdev.com> | 2014-12-13 00:26:19 +0800 |
commit | c0bba438b1d93b3ebba46e03935dbdf8b1ba6bd5 (patch) | |
tree | b3fa2b6b006b6d1b9799abe9e2ed25ddc685d370 /ExpressionCompiler.h | |
parent | 6893d4d4557e9968feaa162c8fc5ea3859aa0565 (diff) | |
download | dexon-solidity-c0bba438b1d93b3ebba46e03935dbdf8b1ba6bd5.tar.gz dexon-solidity-c0bba438b1d93b3ebba46e03935dbdf8b1ba6bd5.tar.zst dexon-solidity-c0bba438b1d93b3ebba46e03935dbdf8b1ba6bd5.zip |
Calls to bare contracts.
Diffstat (limited to 'ExpressionCompiler.h')
-rw-r--r-- | ExpressionCompiler.h | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/ExpressionCompiler.h b/ExpressionCompiler.h index c0b173d4..0bba211c 100644 --- a/ExpressionCompiler.h +++ b/ExpressionCompiler.h @@ -20,6 +20,7 @@ * Solidity AST to EVM bytecode compiler for expressions. */ +#include <functional> #include <boost/noncopyable.hpp> #include <libdevcore/Common.h> #include <libsolidity/ASTVisitor.h> @@ -83,6 +84,25 @@ private: //// Appends code that cleans higher-order bits for integer types. void appendHighBitsCleanup(IntegerType const& _typeOnStack); + /// Additional options used in appendExternalFunctionCall. + struct FunctionCallOptions + { + FunctionCallOptions() {} + /// Invoked to copy the address to the stack + std::function<void()> obtainAddress; + /// Invoked to copy the ethe value to the stack (if not specified, value is 0). + std::function<void()> obtainValue; + /// If true, do not prepend function index to call data + bool bare = false; + /// If false, use calling convention that all arguments and return values are packed as + /// 32 byte values with padding. + bool packDensely = true; + }; + + /// Appends code to call a function of the given type with the given arguments. + void appendExternalFunctionCall(FunctionType const& _functionType, std::vector<ASTPointer<Expression const>> const& _arguments, + FunctionCallOptions const& _options = FunctionCallOptions()); + /** * Helper class to store and retrieve lvalues to and from various locations. * All types except STACK store a reference in a slot on the stack, STACK just |