aboutsummaryrefslogtreecommitdiffstats
path: root/solc
diff options
context:
space:
mode:
Diffstat (limited to 'solc')
-rw-r--r--solc/CommandLineInterface.cpp20
-rw-r--r--solc/jsonCompiler.cpp7
2 files changed, 25 insertions, 2 deletions
diff --git a/solc/CommandLineInterface.cpp b/solc/CommandLineInterface.cpp
index 4fbd3384..e37922c6 100644
--- a/solc/CommandLineInterface.cpp
+++ b/solc/CommandLineInterface.cpp
@@ -1106,9 +1106,14 @@ bool CommandLineInterface::assemble(
"eWasm";
cout << endl << "======= " << src.first << " (" << machine << ") =======" << endl;
AssemblyStack& stack = assemblyStacks[src.first];
+
+ cout << endl << "Pretty printed source:" << endl;
+ cout << stack.print() << endl;
+
+ MachineAssemblyObject object;
try
{
- cout << stack.assemble(_targetMachine).toHex() << endl;
+ object = stack.assemble(_targetMachine);
}
catch (Exception const& _exception)
{
@@ -1120,7 +1125,18 @@ bool CommandLineInterface::assemble(
cerr << "Unknown exception while assembling." << endl;
return false;
}
- cout << stack.print() << endl;
+
+ cout << endl << "Binary representation:" << endl;
+ if (object.bytecode)
+ cout << object.bytecode->toHex() << endl;
+ else
+ cerr << "No binary representation found." << endl;
+
+ cout << endl << "Text representation:" << endl;
+ if (!object.assembly.empty())
+ cout << object.assembly << endl;
+ else
+ cerr << "No text representation found." << endl;
}
return true;
diff --git a/solc/jsonCompiler.cpp b/solc/jsonCompiler.cpp
index 87b97efb..c01c8061 100644
--- a/solc/jsonCompiler.cpp
+++ b/solc/jsonCompiler.cpp
@@ -41,6 +41,8 @@
#include <libsolidity/ast/ASTJsonConverter.h>
#include <libsolidity/interface/Version.h>
+#include "license.h"
+
using namespace std;
using namespace dev;
using namespace solidity;
@@ -297,6 +299,11 @@ static string s_outputBuffer;
extern "C"
{
+extern char const* license()
+{
+ /// TOOD: include the copyright information on the top.
+ return licenseText;
+}
extern char const* version()
{
return VersionString.c_str();