aboutsummaryrefslogtreecommitdiffstats
path: root/libevmasm/Assembly.h
diff options
context:
space:
mode:
authorAlex Beregszaszi <alex@rtfs.hu>2017-06-15 17:22:47 +0800
committerAlex Beregszaszi <alex@rtfs.hu>2017-09-11 22:48:52 +0800
commita535a8b06ed1b9c0c5fd41805a4fe39939755f05 (patch)
tree94484019deeef72cc1bab99de51b844647ec6881 /libevmasm/Assembly.h
parent55d2a459a9193024930101c79bbf48af2eb39e2d (diff)
downloaddexon-solidity-a535a8b06ed1b9c0c5fd41805a4fe39939755f05.tar
dexon-solidity-a535a8b06ed1b9c0c5fd41805a4fe39939755f05.tar.gz
dexon-solidity-a535a8b06ed1b9c0c5fd41805a4fe39939755f05.tar.bz2
dexon-solidity-a535a8b06ed1b9c0c5fd41805a4fe39939755f05.tar.lz
dexon-solidity-a535a8b06ed1b9c0c5fd41805a4fe39939755f05.tar.xz
dexon-solidity-a535a8b06ed1b9c0c5fd41805a4fe39939755f05.tar.zst
dexon-solidity-a535a8b06ed1b9c0c5fd41805a4fe39939755f05.zip
Split out the JSON functionality from assembly.stream()
Diffstat (limited to 'libevmasm/Assembly.h')
-rw-r--r--libevmasm/Assembly.h15
1 files changed, 9 insertions, 6 deletions
diff --git a/libevmasm/Assembly.h b/libevmasm/Assembly.h
index 8116c2ce..ab8f174d 100644
--- a/libevmasm/Assembly.h
+++ b/libevmasm/Assembly.h
@@ -120,11 +120,16 @@ public:
/// If @a _enable is not set, will perform some simple peephole optimizations.
Assembly& optimise(bool _enable, bool _isCreation = true, size_t _runs = 200);
- Json::Value stream(
+ /// Create a text representation of the assembly.
+ std::ostream& assemblyStream(
std::ostream& _out,
std::string const& _prefix = "",
- const StringMap &_sourceCodes = StringMap(),
- bool _inJsonFormat = false
+ StringMap const& _sourceCodes = StringMap()
+ ) const;
+
+ /// Create a JSON representation of the assembly.
+ Json::Value assemblyJSON(
+ StringMap const& _sourceCodes = StringMap()
) const;
protected:
@@ -136,8 +141,6 @@ protected:
unsigned bytesRequired(unsigned subTagSize) const;
private:
- Json::Value streamAsmJson(std::ostream& _out, StringMap const& _sourceCodes) const;
- std::ostream& streamAsm(std::ostream& _out, std::string const& _prefix, StringMap const& _sourceCodes) const;
static Json::Value createJsonValue(std::string _name, int _begin, int _end, std::string _value = std::string(), std::string _jumpType = std::string());
static std::string toStringInHex(u256 _value);
@@ -162,7 +165,7 @@ protected:
inline std::ostream& operator<<(std::ostream& _out, Assembly const& _a)
{
- _a.stream(_out);
+ _a.assemblyStream(_out);
return _out;
}