From 77f442458934d2f0d9ffde34784bb58bd177b3ef Mon Sep 17 00:00:00 2001 From: chriseth Date: Tue, 16 Aug 2016 16:27:20 +0200 Subject: Provide inline assembly to the code generator. (#840) * Directly usable inline assembly. * Add missing header. --- libsolidity/codegen/CompilerContext.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'libsolidity/codegen/CompilerContext.h') 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 const& _localVariables = std::vector(), + std::map const& _replacements = std::map{} + ); + /// Prepends "PUSH POP" void injectVersionStampIntoSub(size_t _subIndex); -- cgit