aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLiana Husikyan <liana@ethdev.com>2015-04-17 23:41:41 +0800
committerLiana Husikyan <liana@ethdev.com>2015-04-17 23:41:41 +0800
commitf829dad7e385aa9578d56fe926a4741f9f90c105 (patch)
tree1fb021476ff61aeebaa016d9178210150fd38c1f
parentc9812f7269704fcfa708d9b352b8344a5754a223 (diff)
downloaddexon-solidity-f829dad7e385aa9578d56fe926a4741f9f90c105.tar
dexon-solidity-f829dad7e385aa9578d56fe926a4741f9f90c105.tar.gz
dexon-solidity-f829dad7e385aa9578d56fe926a4741f9f90c105.tar.bz2
dexon-solidity-f829dad7e385aa9578d56fe926a4741f9f90c105.tar.lz
dexon-solidity-f829dad7e385aa9578d56fe926a4741f9f90c105.tar.xz
dexon-solidity-f829dad7e385aa9578d56fe926a4741f9f90c105.tar.zst
dexon-solidity-f829dad7e385aa9578d56fe926a4741f9f90c105.zip
added asm-json flag to cl compiler
Conflicts: libsolidity/CompilerStack.cpp
-rw-r--r--Compiler.h5
-rw-r--r--CompilerContext.h3
-rw-r--r--CompilerStack.cpp4
-rw-r--r--CompilerStack.h3
4 files changed, 9 insertions, 6 deletions
diff --git a/Compiler.h b/Compiler.h
index 4b1e1b4d..260aebd3 100644
--- a/Compiler.h
+++ b/Compiler.h
@@ -42,9 +42,10 @@ public:
bytes getAssembledBytecode() { return m_context.getAssembledBytecode(m_optimize); }
bytes getRuntimeBytecode() { return m_runtimeContext.getAssembledBytecode(m_optimize);}
/// @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
eth::AssemblyItems const& getAssemblyItems() const { return m_context.getAssembly().getItems(); }
diff --git a/CompilerContext.h b/CompilerContext.h
index e752d59b..3fcf0706 100644
--- a/CompilerContext.h
+++ b/CompilerContext.h
@@ -122,7 +122,8 @@ public:
eth::Assembly const& getAssembly() const { return m_asm; }
/// @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(); }
diff --git a/CompilerStack.cpp b/CompilerStack.cpp
index c35d9324..592f6127 100644
--- a/CompilerStack.cpp
+++ b/CompilerStack.cpp
@@ -184,11 +184,11 @@ dev::h256 CompilerStack::getContractCodeHash(string const& _contractName) const
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);
if (contract.compiler)
- getContract(_contractName).compiler->streamAssembly(_outStream, _sourceCodes);
+ contract(_contractName).compiler->streamAssembly(_outStream, _sourceCodes, _inJsonFormat);
else
_outStream << "Contract not fully implemented" << endl;
}
diff --git a/CompilerStack.h b/CompilerStack.h
index 19c1ba4e..ef3d0966 100644
--- a/CompilerStack.h
+++ b/CompilerStack.h
@@ -102,8 +102,9 @@ public:
/// Streams a verbose version of the assembly to @a _outStream.
/// @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.
- 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.
/// Prerequisite: Successful call to parse or compile.