mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
added asm-json flag to cl compiler
Conflicts: libsolidity/CompilerStack.cpp
This commit is contained in:
parent
c9812f7269
commit
f829dad7e3
@ -42,9 +42,10 @@ public:
|
|||||||
bytes getAssembledBytecode() { return m_context.getAssembledBytecode(m_optimize); }
|
bytes getAssembledBytecode() { return m_context.getAssembledBytecode(m_optimize); }
|
||||||
bytes getRuntimeBytecode() { return m_runtimeContext.getAssembledBytecode(m_optimize);}
|
bytes getRuntimeBytecode() { return m_runtimeContext.getAssembledBytecode(m_optimize);}
|
||||||
/// @arg _sourceCodes is the map of input files to source code strings
|
/// @arg _sourceCodes is the map of input files to source code strings
|
||||||
void streamAssembly(std::ostream& _stream, StringMap const& _sourceCodes = StringMap()) const
|
/// @arg _inJsonFromat shows weather the out should be in Json format
|
||||||
|
void streamAssembly(std::ostream& _stream, StringMap const& _sourceCodes = StringMap(), bool _inJsonFormat = false) const
|
||||||
{
|
{
|
||||||
m_context.streamAssembly(_stream, _sourceCodes);
|
m_context.streamAssembly(_stream, _sourceCodes, _inJsonFormat);
|
||||||
}
|
}
|
||||||
/// @returns Assembly items of the normal compiler context
|
/// @returns Assembly items of the normal compiler context
|
||||||
eth::AssemblyItems const& getAssemblyItems() const { return m_context.getAssembly().getItems(); }
|
eth::AssemblyItems const& getAssemblyItems() const { return m_context.getAssembly().getItems(); }
|
||||||
|
@ -122,7 +122,8 @@ public:
|
|||||||
|
|
||||||
eth::Assembly const& getAssembly() const { return m_asm; }
|
eth::Assembly const& getAssembly() const { return m_asm; }
|
||||||
/// @arg _sourceCodes is the map of input files to source code strings
|
/// @arg _sourceCodes is the map of input files to source code strings
|
||||||
void streamAssembly(std::ostream& _stream, StringMap const& _sourceCodes = StringMap()) const { m_asm.stream(_stream, "", _sourceCodes); }
|
/// @arg _inJsonFromat shows weather the out should be in Json format
|
||||||
|
void streamAssembly(std::ostream& _stream, StringMap const& _sourceCodes = StringMap(), bool _inJsonFormat = false) const { m_asm.stream(_stream, "", _sourceCodes, _inJsonFormat); }
|
||||||
|
|
||||||
bytes getAssembledBytecode(bool _optimize = false) { return m_asm.optimise(_optimize).assemble(); }
|
bytes getAssembledBytecode(bool _optimize = false) { return m_asm.optimise(_optimize).assemble(); }
|
||||||
|
|
||||||
|
@ -184,11 +184,11 @@ dev::h256 CompilerStack::getContractCodeHash(string const& _contractName) const
|
|||||||
return dev::sha3(getRuntimeBytecode(_contractName));
|
return dev::sha3(getRuntimeBytecode(_contractName));
|
||||||
}
|
}
|
||||||
|
|
||||||
void CompilerStack::streamAssembly(ostream& _outStream, string const& _contractName, StringMap _sourceCodes) const
|
void CompilerStack::streamAssembly(ostream& _outStream, string const& _contractName, StringMap _sourceCodes, bool _inJsonFormat) const
|
||||||
{
|
{
|
||||||
Contract const& contract = getContract(_contractName);
|
Contract const& contract = getContract(_contractName);
|
||||||
if (contract.compiler)
|
if (contract.compiler)
|
||||||
getContract(_contractName).compiler->streamAssembly(_outStream, _sourceCodes);
|
contract(_contractName).compiler->streamAssembly(_outStream, _sourceCodes, _inJsonFormat);
|
||||||
else
|
else
|
||||||
_outStream << "Contract not fully implemented" << endl;
|
_outStream << "Contract not fully implemented" << endl;
|
||||||
}
|
}
|
||||||
|
@ -102,8 +102,9 @@ public:
|
|||||||
|
|
||||||
/// Streams a verbose version of the assembly to @a _outStream.
|
/// Streams a verbose version of the assembly to @a _outStream.
|
||||||
/// @arg _sourceCodes is the map of input files to source code strings
|
/// @arg _sourceCodes is the map of input files to source code strings
|
||||||
|
/// @arg _inJsonFromat shows weather the out should be in Json format
|
||||||
/// Prerequisite: Successful compilation.
|
/// Prerequisite: Successful compilation.
|
||||||
void streamAssembly(std::ostream& _outStream, std::string const& _contractName = "", StringMap _sourceCodes = StringMap()) const;
|
void streamAssembly(std::ostream& _outStream, std::string const& _contractName = "", StringMap _sourceCodes = StringMap(), bool _inJsonFormat = false) const;
|
||||||
|
|
||||||
/// Returns a string representing the contract interface in JSON.
|
/// Returns a string representing the contract interface in JSON.
|
||||||
/// Prerequisite: Successful call to parse or compile.
|
/// Prerequisite: Successful call to parse or compile.
|
||||||
|
Loading…
Reference in New Issue
Block a user