aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity/codegen/CompilerContext.h
diff options
context:
space:
mode:
authorchriseth <c@ethdev.com>2017-01-26 23:35:51 +0800
committerchriseth <c@ethdev.com>2017-01-26 23:39:07 +0800
commitd9fbb83861153499b4aec5525db85ec59445abd1 (patch)
treeeae595b95caf1b280ed99f74b5c4f18ec5317de3 /libsolidity/codegen/CompilerContext.h
parent390bebaaf9e2af51c7e2f72337d1e7b23f51486a (diff)
downloaddexon-solidity-d9fbb83861153499b4aec5525db85ec59445abd1.tar.gz
dexon-solidity-d9fbb83861153499b4aec5525db85ec59445abd1.tar.zst
dexon-solidity-d9fbb83861153499b4aec5525db85ec59445abd1.zip
Allow inserting low-level functions without calling them.
Diffstat (limited to 'libsolidity/codegen/CompilerContext.h')
-rw-r--r--libsolidity/codegen/CompilerContext.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/libsolidity/codegen/CompilerContext.h b/libsolidity/codegen/CompilerContext.h
index 58d6cb2a..c37142c9 100644
--- a/libsolidity/codegen/CompilerContext.h
+++ b/libsolidity/codegen/CompilerContext.h
@@ -104,6 +104,16 @@ public:
unsigned _outArgs,
std::function<void(CompilerContext&)> const& _generator
);
+ /// Returns the tag of the named low-level function and inserts the generator into the
+ /// list of low-level-functions to be generated, unless it already exists.
+ /// Note that the generator should not assume that objects are still alive when it is called,
+ /// unless they are guaranteed to be alive for the whole run of the compiler (AST nodes, for example).
+ eth::AssemblyItem lowLevelFunctionTag(
+ std::string const& _name,
+ unsigned _inArgs,
+ unsigned _outArgs,
+ std::function<void(CompilerContext&)> const& _generator
+ );
/// Generates the code for missing low-level functions, i.e. calls the generators passed above.
void appendMissingLowLevelFunctions();