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/interface/CompilerStack.cpp | |
parent | 4cb5502faa2004d738c25e4dcdf4f6678540017e (diff) | |
parent | bd6510d99a503ddbdbfaa9bd459f020215f8a028 (diff) | |
download | dexon-solidity-513ae59bba018d865fef620c79f131b70554c042.tar.gz 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/interface/CompilerStack.cpp')
-rw-r--r-- | libsolidity/interface/CompilerStack.cpp | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/libsolidity/interface/CompilerStack.cpp b/libsolidity/interface/CompilerStack.cpp index 259694da..41bbf687 100644 --- a/libsolidity/interface/CompilerStack.cpp +++ b/libsolidity/interface/CompilerStack.cpp @@ -347,16 +347,24 @@ eth::LinkerObject const& CompilerStack::cloneObject(string const& _contractName) return contract(_contractName).cloneObject; } -Json::Value CompilerStack::streamAssembly(ostream& _outStream, string const& _contractName, StringMap _sourceCodes, bool _inJsonFormat) const +/// FIXME: cache this string +string CompilerStack::assemblyString(string const& _contractName, StringMap _sourceCodes) const { Contract const& currentContract = contract(_contractName); if (currentContract.compiler) - return currentContract.compiler->streamAssembly(_outStream, _sourceCodes, _inJsonFormat); + return currentContract.compiler->assemblyString(_sourceCodes); + else + return string(); +} + +/// FIXME: cache the JSON +Json::Value CompilerStack::assemblyJSON(string const& _contractName, StringMap _sourceCodes) const +{ + Contract const& currentContract = contract(_contractName); + if (currentContract.compiler) + return currentContract.compiler->assemblyJSON(_sourceCodes); else - { - _outStream << "Contract not fully implemented" << endl; return Json::Value(); - } } vector<string> CompilerStack::sourceNames() const |