aboutsummaryrefslogtreecommitdiffstats
path: root/libevmasm
diff options
context:
space:
mode:
authorAlex Beregszaszi <alex@rtfs.hu>2017-08-30 09:17:15 +0800
committerAlex Beregszaszi <alex@rtfs.hu>2017-09-11 22:53:20 +0800
commitbbfb16cf5ce903150bc3a141ac50553d8bf6d346 (patch)
treea79144b2c970f097f3bd1c8a6b3cdc27d0670ce8 /libevmasm
parent50570c6c794eee01af64751c884fb6cb68f8dffc (diff)
downloaddexon-solidity-bbfb16cf5ce903150bc3a141ac50553d8bf6d346.tar
dexon-solidity-bbfb16cf5ce903150bc3a141ac50553d8bf6d346.tar.gz
dexon-solidity-bbfb16cf5ce903150bc3a141ac50553d8bf6d346.tar.bz2
dexon-solidity-bbfb16cf5ce903150bc3a141ac50553d8bf6d346.tar.lz
dexon-solidity-bbfb16cf5ce903150bc3a141ac50553d8bf6d346.tar.xz
dexon-solidity-bbfb16cf5ce903150bc3a141ac50553d8bf6d346.tar.zst
dexon-solidity-bbfb16cf5ce903150bc3a141ac50553d8bf6d346.zip
Introduce assemblyString
Diffstat (limited to 'libevmasm')
-rw-r--r--libevmasm/Assembly.cpp7
-rw-r--r--libevmasm/Assembly.h3
2 files changed, 10 insertions, 0 deletions
diff --git a/libevmasm/Assembly.cpp b/libevmasm/Assembly.cpp
index 2203cadf..6b4bb52b 100644
--- a/libevmasm/Assembly.cpp
+++ b/libevmasm/Assembly.cpp
@@ -208,6 +208,13 @@ void Assembly::assemblyStream(ostream& _out, string const& _prefix, StringMap co
_out << endl << _prefix << "auxdata: 0x" << toHex(m_auxiliaryData) << endl;
}
+string Assembly::assemblyString(StringMap const& _sourceCodes) const
+{
+ ostringstream tmp;
+ assemblyStream(tmp, "", _sourceCodes);
+ return tmp.str();
+}
+
Json::Value Assembly::createJsonValue(string _name, int _begin, int _end, string _value, string _jumpType)
{
Json::Value value;
diff --git a/libevmasm/Assembly.h b/libevmasm/Assembly.h
index b7e9b354..cbdd71bc 100644
--- a/libevmasm/Assembly.h
+++ b/libevmasm/Assembly.h
@@ -121,6 +121,9 @@ public:
Assembly& optimise(bool _enable, bool _isCreation = true, size_t _runs = 200);
/// Create a text representation of the assembly.
+ std::string assemblyString(
+ StringMap const& _sourceCodes = StringMap()
+ ) const;
void assemblyStream(
std::ostream& _out,
std::string const& _prefix = "",