@@ -45,19 +45,21 @@ using TypedNameList = std::vector<TypedName>;
4545enum class LiteralKind { Number, Boolean, String };
4646struct LiteralValue {
4747 using Data = u256;
48- using RepresentationHint = std::optional <std::string>;
48+ using RepresentationHint = std::shared_ptr <std::string>;
4949
50- LiteralValue& operator =(u256 const & _v) { data = _v; return *this ; }
51- bool operator <(LiteralValue const & _rhs) const { return data < _rhs.data ; }
50+ LiteralValue () = default ;
51+ LiteralValue (Data const & _data, std::optional<std::string> const & _s = std::nullopt ):
52+ data (_data), representationHint(_s ? std::make_shared<std::string>(*_s) : nullptr ) {}
53+
54+ LiteralValue& operator =(Data const & _v) { data = _v; return *this ; }
5255 bool operator ==(LiteralValue const & _rhs) const { return data == _rhs.data ; }
53- bool operator <(Data const & _rhs) const { return data < _rhs; }
5456 bool operator ==(Data const & _rhs) const { return data == _rhs; }
5557 bool operator !=(Data const & _rhs) const { return data != _rhs; }
5658
57- Data data;
58- RepresentationHint representationHint {std:: nullopt };
59+ Data data { 0 } ;
60+ RepresentationHint representationHint {nullptr };
5961};
60- struct Literal { langutil::DebugData::ConstPtr debugData; LiteralKind kind{} ; LiteralValue value; Type type; };
62+ struct Literal { langutil::DebugData::ConstPtr debugData; LiteralKind kind; LiteralValue value; Type type; };
6163// / External / internal identifier or label reference
6264struct Identifier { langutil::DebugData::ConstPtr debugData; YulString name; };
6365// / Assignment ("x := mload(20:u256)", expects push-1-expression on the right hand
0 commit comments