From a535a8b06ed1b9c0c5fd41805a4fe39939755f05 Mon Sep 17 00:00:00 2001 From: Alex Beregszaszi Date: Thu, 15 Jun 2017 10:22:47 +0100 Subject: Split out the JSON functionality from assembly.stream() --- libsolidity/codegen/Compiler.h | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'libsolidity/codegen/Compiler.h') diff --git a/libsolidity/codegen/Compiler.h b/libsolidity/codegen/Compiler.h index c6ee93fb..1224ff60 100644 --- a/libsolidity/codegen/Compiler.h +++ b/libsolidity/codegen/Compiler.h @@ -60,10 +60,14 @@ public: /// @returns Only the runtime object (without constructor). eth::LinkerObject runtimeObject() const { return m_context.assembledRuntimeObject(m_runtimeSub); } /// @arg _sourceCodes is the map of input files to source code strings - /// @arg _inJsonFromat shows whether the out should be in Json format - Json::Value streamAssembly(std::ostream& _stream, StringMap const& _sourceCodes = StringMap(), bool _inJsonFormat = false) const + std::ostream& assemblyStream(std::ostream& _stream, StringMap const& _sourceCodes = StringMap()) const { - return m_context.streamAssembly(_stream, _sourceCodes, _inJsonFormat); + return m_context.assemblyStream(_stream, _sourceCodes); + } + /// @arg _sourceCodes is the map of input files to source code strings + Json::Value assemblyJSON(StringMap const& _sourceCodes = StringMap()) const + { + return m_context.assemblyJSON(_sourceCodes); } /// @returns Assembly items of the normal compiler context eth::AssemblyItems const& assemblyItems() const { return m_context.assembly().items(); } -- cgit From 50570c6c794eee01af64751c884fb6cb68f8dffc Mon Sep 17 00:00:00 2001 From: Alex Beregszaszi Date: Wed, 30 Aug 2017 01:58:19 +0100 Subject: Do not return the stream in asssemblyStream --- libsolidity/codegen/Compiler.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'libsolidity/codegen/Compiler.h') diff --git a/libsolidity/codegen/Compiler.h b/libsolidity/codegen/Compiler.h index 1224ff60..5233cc91 100644 --- a/libsolidity/codegen/Compiler.h +++ b/libsolidity/codegen/Compiler.h @@ -60,9 +60,9 @@ public: /// @returns Only the runtime object (without constructor). eth::LinkerObject runtimeObject() const { return m_context.assembledRuntimeObject(m_runtimeSub); } /// @arg _sourceCodes is the map of input files to source code strings - std::ostream& assemblyStream(std::ostream& _stream, StringMap const& _sourceCodes = StringMap()) const + void assemblyStream(std::ostream& _stream, StringMap const& _sourceCodes = StringMap()) const { - return m_context.assemblyStream(_stream, _sourceCodes); + m_context.assemblyStream(_stream, _sourceCodes); } /// @arg _sourceCodes is the map of input files to source code strings Json::Value assemblyJSON(StringMap const& _sourceCodes = StringMap()) const -- cgit From bbfb16cf5ce903150bc3a141ac50553d8bf6d346 Mon Sep 17 00:00:00 2001 From: Alex Beregszaszi Date: Wed, 30 Aug 2017 02:17:15 +0100 Subject: Introduce assemblyString --- libsolidity/codegen/Compiler.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'libsolidity/codegen/Compiler.h') diff --git a/libsolidity/codegen/Compiler.h b/libsolidity/codegen/Compiler.h index 5233cc91..06654486 100644 --- a/libsolidity/codegen/Compiler.h +++ b/libsolidity/codegen/Compiler.h @@ -60,9 +60,9 @@ public: /// @returns Only the runtime object (without constructor). eth::LinkerObject runtimeObject() const { return m_context.assembledRuntimeObject(m_runtimeSub); } /// @arg _sourceCodes is the map of input files to source code strings - void assemblyStream(std::ostream& _stream, StringMap const& _sourceCodes = StringMap()) const + std::string assemblyString(StringMap const& _sourceCodes = StringMap()) const { - m_context.assemblyStream(_stream, _sourceCodes); + return m_context.assemblyString(_sourceCodes); } /// @arg _sourceCodes is the map of input files to source code strings Json::Value assemblyJSON(StringMap const& _sourceCodes = StringMap()) const -- cgit