diff options
author | chriseth <chris@ethereum.org> | 2017-09-12 19:23:59 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-09-12 19:23:59 +0800 |
commit | 513ae59bba018d865fef620c79f131b70554c042 (patch) | |
tree | fc40ae93202787313e1c43822500c9126a1eedf4 /libsolidity/codegen | |
parent | 4cb5502faa2004d738c25e4dcdf4f6678540017e (diff) | |
parent | bd6510d99a503ddbdbfaa9bd459f020215f8a028 (diff) | |
download | dexon-solidity-513ae59bba018d865fef620c79f131b70554c042.tar dexon-solidity-513ae59bba018d865fef620c79f131b70554c042.tar.gz dexon-solidity-513ae59bba018d865fef620c79f131b70554c042.tar.bz2 dexon-solidity-513ae59bba018d865fef620c79f131b70554c042.tar.lz dexon-solidity-513ae59bba018d865fef620c79f131b70554c042.tar.xz dexon-solidity-513ae59bba018d865fef620c79f131b70554c042.tar.zst dexon-solidity-513ae59bba018d865fef620c79f131b70554c042.zip |
Merge pull request #2853 from ethereum/cleanup-asm-stream
Split out the JSON functionality from assembly.stream()
Diffstat (limited to 'libsolidity/codegen')
-rw-r--r-- | libsolidity/codegen/Compiler.h | 10 | ||||
-rw-r--r-- | libsolidity/codegen/CompilerContext.h | 11 |
2 files changed, 15 insertions, 6 deletions
diff --git a/libsolidity/codegen/Compiler.h b/libsolidity/codegen/Compiler.h index c6ee93fb..06654486 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::string assemblyString(StringMap const& _sourceCodes = StringMap()) const { - return m_context.streamAssembly(_stream, _sourceCodes, _inJsonFormat); + 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 + { + return m_context.assemblyJSON(_sourceCodes); } /// @returns Assembly items of the normal compiler context eth::AssemblyItems const& assemblyItems() const { return m_context.assembly().items(); } diff --git a/libsolidity/codegen/CompilerContext.h b/libsolidity/codegen/CompilerContext.h index 3994b010..5116585e 100644 --- a/libsolidity/codegen/CompilerContext.h +++ b/libsolidity/codegen/CompilerContext.h @@ -209,10 +209,15 @@ public: eth::Assembly& nonConstAssembly() { return *m_asm; } /// @arg _sourceCodes is the map of input files to source code strings - /// @arg _inJsonFormat shows whether the out should be in Json format - Json::Value streamAssembly(std::ostream& _stream, StringMap const& _sourceCodes = StringMap(), bool _inJsonFormat = false) const + std::string assemblyString(StringMap const& _sourceCodes = StringMap()) const { - return m_asm->stream(_stream, "", _sourceCodes, _inJsonFormat); + return m_asm->assemblyString(_sourceCodes); + } + + /// @arg _sourceCodes is the map of input files to source code strings + Json::Value assemblyJSON(StringMap const& _sourceCodes = StringMap()) const + { + return m_asm->assemblyJSON(_sourceCodes); } eth::LinkerObject const& assembledObject() const { return m_asm->assemble(); } |