Browse Source

style fixes

cl-refactor
Liana Husikyan 10 years ago
parent
commit
95e161bfc9
  1. 16
      libevmcore/Assembly.cpp
  2. 18
      libevmcore/Assembly.h

16
libevmcore/Assembly.cpp

@ -189,35 +189,35 @@ Json::Value Assembly::streamAsmJson(ostream& _out, string const& _prefix, String
{
case Operation:
currentCollection.push_back(
createJsonValue(instructionInfo(i.instruction()).name, i.getLocation().start, i.getLocation().end, i.getJumpTypeAsString()));
createJsonValue(instructionInfo(i.instruction()).name, i.getLocation().start, i.getLocation().end, i.getJumpTypeAsString()));
break;
case Push:
{
std::stringstream hexStr;
hexStr << hex << (unsigned)i.data();
hexStr << hex << i.data();
currentCollection.push_back(
createJsonValue(string("PUSH"), i.getLocation().start, i.getLocation().end, hexStr.str(), i.getJumpTypeAsString()));
createJsonValue(string("PUSH"), i.getLocation().start, i.getLocation().end, hexStr.str(), i.getJumpTypeAsString()));
}
break;
case PushString:
currentCollection.push_back(
createJsonValue(string("PUSH tag"), i.getLocation().start, i.getLocation().end, m_strings.at((h256)i.data())));
createJsonValue(string("PUSH tag"), i.getLocation().start, i.getLocation().end, m_strings.at((h256)i.data())));
break;
case PushTag:
currentCollection.push_back(
createJsonValue(string("PUSH [tag]"), i.getLocation().start, i.getLocation().end, string(i.data())));
createJsonValue(string("PUSH [tag]"), i.getLocation().start, i.getLocation().end, string(i.data())));
break;
case PushSub:
currentCollection.push_back(
createJsonValue(string("PUSH"), i.getLocation().start, i.getLocation().end, string("[$]" + string(h256(i.data()).abridged()))));
createJsonValue(string("PUSH"), i.getLocation().start, i.getLocation().end, string("[$]" + dev::toString(h256(i.data())))));
break;
case PushSubSize:
currentCollection.push_back(
createJsonValue(string("PUSH"), i.getLocation().start, i.getLocation().end, string("#[$]" + string(h256(i.data()).abridged()))));
createJsonValue(string("PUSH"), i.getLocation().start, i.getLocation().end, string("#[$]" + dev::toString(h256(i.data())))));
break;
case PushProgramSize:
currentCollection.push_back(
createJsonValue(string("PUSHSIZE"), i.getLocation().start, i.getLocation().end));
createJsonValue(string("PUSHSIZE"), i.getLocation().start, i.getLocation().end));
break;
case Tag:
{

18
libevmcore/Assembly.h

@ -92,10 +92,11 @@ public:
bytes assemble() const;
Assembly& optimise(bool _enable);
Json::Value stream(
std::ostream& _out,
std::string const& _prefix = "",
const StringMap &_sourceCodes = StringMap(),
bool _inJsonFormat = false) const;
std::ostream& _out,
std::string const& _prefix = "",
const StringMap &_sourceCodes = StringMap(),
bool _inJsonFormat = false
) const;
protected:
std::string getLocationFromSources(StringMap const& _sourceCodes, SourceLocation const& _location) const;
@ -104,10 +105,11 @@ protected:
private:
Json::Value streamAsmJson(
std::ostream& _out,
const std::string &_prefix,
const StringMap &_sourceCodes,
bool _inJsonFormat) const;
std::ostream& _out,
const std::string &_prefix,
const StringMap &_sourceCodes,
bool _inJsonFormat
) const;
std::ostream& streamAsm(std::ostream& _out, std::string const& _prefix, StringMap const& _sourceCodes) const;
Json::Value createJsonValue(std::string _name, int _locationX, int _locationY, std::string _value = std::string(), std::string _jumpType = std::string()) const;

Loading…
Cancel
Save