From e6fee257e68e7b145a47eee8c5937db7a7a99849 Mon Sep 17 00:00:00 2001 From: chriseth Date: Thu, 10 Jan 2019 16:44:31 +0100 Subject: Code generation for access to contract code. --- libsolidity/codegen/Compiler.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'libsolidity/codegen/Compiler.h') diff --git a/libsolidity/codegen/Compiler.h b/libsolidity/codegen/Compiler.h index 784d7f8c..953267a4 100644 --- a/libsolidity/codegen/Compiler.h +++ b/libsolidity/codegen/Compiler.h @@ -45,11 +45,13 @@ public: /// @arg _metadata contains the to be injected metadata CBOR void compileContract( ContractDefinition const& _contract, - std::map const& _contracts, + std::map> const& _otherCompilers, bytes const& _metadata ); /// @returns Entire assembly. eth::Assembly const& assembly() const { return m_context.assembly(); } + /// @returns Runtime assembly. + eth::Assembly const& runtimeAssembly() const { return m_context.assembly().sub(m_runtimeSub); } /// @returns The entire assembled object (with constructor). eth::LinkerObject assembledObject() const { return m_context.assembledObject(); } /// @returns Only the runtime object (without constructor). -- cgit v1.2.3 From 29f6aa7d560a7d82a9088489e663a079a3b41f73 Mon Sep 17 00:00:00 2001 From: chriseth Date: Wed, 16 Jan 2019 11:44:11 +0100 Subject: Do not create a copy of the assembly. --- libsolidity/codegen/Compiler.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'libsolidity/codegen/Compiler.h') diff --git a/libsolidity/codegen/Compiler.h b/libsolidity/codegen/Compiler.h index 953267a4..c21de96d 100644 --- a/libsolidity/codegen/Compiler.h +++ b/libsolidity/codegen/Compiler.h @@ -50,8 +50,10 @@ public: ); /// @returns Entire assembly. eth::Assembly const& assembly() const { return m_context.assembly(); } + /// @returns Entire assembly as a shared pointer to non-const. + std::shared_ptr assemblyPtr() const { return m_context.assemblyPtr(); } /// @returns Runtime assembly. - eth::Assembly const& runtimeAssembly() const { return m_context.assembly().sub(m_runtimeSub); } + std::shared_ptr runtimeAssemblyPtr() const; /// @returns The entire assembled object (with constructor). eth::LinkerObject assembledObject() const { return m_context.assembledObject(); } /// @returns Only the runtime object (without constructor). -- cgit v1.2.3