mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Output legacyAssembly in StandardCompiler
This commit is contained in:
parent
4eaee772b3
commit
115458c50e
@ -44,6 +44,16 @@ Json::Value formatFatalError(string const& _type, string const& _description)
|
|||||||
return output;
|
return output;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
StringMap createSourceList(Json::Value const& _input)
|
||||||
|
{
|
||||||
|
StringMap sources;
|
||||||
|
Json::Value const& jsonSources = _input["sources"];
|
||||||
|
if (jsonSources.isObject())
|
||||||
|
for (auto const& sourceName: jsonSources.getMemberNames())
|
||||||
|
sources[sourceName] = jsonSources[sourceName]["content"].asString();
|
||||||
|
return sources;
|
||||||
|
}
|
||||||
|
|
||||||
Json::Value StandardCompiler::compileInternal(Json::Value const& _input)
|
Json::Value StandardCompiler::compileInternal(Json::Value const& _input)
|
||||||
{
|
{
|
||||||
m_compilerStack.reset(false);
|
m_compilerStack.reset(false);
|
||||||
@ -139,7 +149,8 @@ Json::Value StandardCompiler::compileInternal(Json::Value const& _input)
|
|||||||
Json::Value evmData(Json::objectValue);
|
Json::Value evmData(Json::objectValue);
|
||||||
// @TODO: add ir
|
// @TODO: add ir
|
||||||
// @TODO: add assembly
|
// @TODO: add assembly
|
||||||
// @TODO: add legacyAssemblyJSON
|
ostringstream unused;
|
||||||
|
evmData["legacyAssembly"] = m_compilerStack.streamAssembly(unused, contractName, createSourceList(_input), true);
|
||||||
evmData["opcodes"] = solidity::disassemble(m_compilerStack.object(contractName).bytecode);
|
evmData["opcodes"] = solidity::disassemble(m_compilerStack.object(contractName).bytecode);
|
||||||
// @TODO: add methodIdentifiers
|
// @TODO: add methodIdentifiers
|
||||||
// @TODO: add gasEstimates
|
// @TODO: add gasEstimates
|
||||||
|
Loading…
Reference in New Issue
Block a user