aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity/codegen/CompilerContext.h
diff options
context:
space:
mode:
authorchriseth <chris@ethereum.org>2016-08-16 22:27:20 +0800
committerGitHub <noreply@github.com>2016-08-16 22:27:20 +0800
commit77f442458934d2f0d9ffde34784bb58bd177b3ef (patch)
tree5443b8b9414fc21c0551dd57ee30b8c3a2ac4762 /libsolidity/codegen/CompilerContext.h
parentc547f9c24b5bd57840ddd5543ab6e5288ddc5563 (diff)
downloaddexon-solidity-77f442458934d2f0d9ffde34784bb58bd177b3ef.tar.gz
dexon-solidity-77f442458934d2f0d9ffde34784bb58bd177b3ef.tar.zst
dexon-solidity-77f442458934d2f0d9ffde34784bb58bd177b3ef.zip
Provide inline assembly to the code generator. (#840)
* Directly usable inline assembly. * Add missing header.
Diffstat (limited to 'libsolidity/codegen/CompilerContext.h')
-rw-r--r--libsolidity/codegen/CompilerContext.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/libsolidity/codegen/CompilerContext.h b/libsolidity/codegen/CompilerContext.h
index a56335ce..0c1500b0 100644
--- a/libsolidity/codegen/CompilerContext.h
+++ b/libsolidity/codegen/CompilerContext.h
@@ -132,6 +132,15 @@ public:
CompilerContext& operator<<(u256 const& _value) { m_asm.append(_value); return *this; }
CompilerContext& operator<<(bytes const& _data) { m_asm.append(_data); return *this; }
+ /// Appends inline assembly. @a _replacements are string-matching replacements that are performed
+ /// prior to parsing the inline assembly.
+ /// @param _localVariables assigns stack positions to variables with the last one being the stack top
+ void appendInlineAssembly(
+ std::string const& _assembly,
+ std::vector<std::string> const& _localVariables = std::vector<std::string>(),
+ std::map<std::string, std::string> const& _replacements = std::map<std::string, std::string>{}
+ );
+
/// Prepends "PUSH <compiler version number> POP"
void injectVersionStampIntoSub(size_t _subIndex);