aboutsummaryrefslogtreecommitdiffstats
path: root/CompilerContext.h
diff options
context:
space:
mode:
authorChristian <c@ethdev.com>2014-10-31 05:52:15 +0800
committerChristian <c@ethdev.com>2014-10-31 21:37:23 +0800
commita36db1f2412d700cc8b32f8331be103c73ea90cb (patch)
treeccbf14d061fcbae162d361eaeaeffb036e50d743 /CompilerContext.h
parentcb9cb48dc78240717cd4842e75c9314778ebcb10 (diff)
downloaddexon-solidity-a36db1f2412d700cc8b32f8331be103c73ea90cb.tar.gz
dexon-solidity-a36db1f2412d700cc8b32f8331be103c73ea90cb.tar.zst
dexon-solidity-a36db1f2412d700cc8b32f8331be103c73ea90cb.zip
Actual contract creator and add solidity to AlethZero interface.
Diffstat (limited to 'CompilerContext.h')
-rw-r--r--CompilerContext.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/CompilerContext.h b/CompilerContext.h
index cce5838e..46c4c72a 100644
--- a/CompilerContext.h
+++ b/CompilerContext.h
@@ -63,6 +63,9 @@ public:
eth::AssemblyItem pushNewTag() { return m_asm.append(m_asm.newPushTag()).tag(); }
/// @returns a new tag without pushing any opcodes or data
eth::AssemblyItem newTag() { return m_asm.newTag(); }
+ /// Adds a subroutine to the code (in the data section) and pushes its size (via a tag)
+ /// on the stack. @returns the assembly item corresponding to the pushed subroutine, i.e. its offset.
+ eth::AssemblyItem addSubroutine(eth::Assembly const& _assembly) { return m_asm.appendSubSize(_assembly); }
/// Append elements to the current instruction list and adjust @a m_stackOffset.
CompilerContext& operator<<(eth::AssemblyItem const& _item) { m_asm.append(_item); return *this; }
@@ -70,6 +73,7 @@ public:
CompilerContext& operator<<(u256 const& _value) { m_asm.append(_value); return *this; }
CompilerContext& operator<<(bytes const& _data) { m_asm.append(_data); return *this; }
+ eth::Assembly const& getAssembly() const { return m_asm; }
void streamAssembly(std::ostream& _stream) const { _stream << m_asm; }
bytes getAssembledBytecode() const { return m_asm.assemble(); }
private: