Loading llvm/include/llvm/MC/MCExpr.h +10 −2 Original line number Diff line number Diff line Loading @@ -134,15 +134,21 @@ inline raw_ostream &operator<<(raw_ostream &OS, const MCExpr &E) { //// Represent a constant integer expression. class MCConstantExpr : public MCExpr { int64_t Value; bool PrintInHex = false; explicit MCConstantExpr(int64_t Value) MCConstantExpr(int64_t Value) : MCExpr(MCExpr::Constant, SMLoc()), Value(Value) {} MCConstantExpr(int64_t Value, bool PrintInHex) : MCExpr(MCExpr::Constant, SMLoc()), Value(Value), PrintInHex(PrintInHex) {} public: /// \name Construction /// @{ static const MCConstantExpr *create(int64_t Value, MCContext &Ctx); static const MCConstantExpr *create(int64_t Value, MCContext &Ctx, bool PrintInHex = false); /// @} /// \name Accessors Loading @@ -150,6 +156,8 @@ public: int64_t getValue() const { return Value; } bool useHexFormat() const { return PrintInHex; } /// @} static bool classof(const MCExpr *E) { Loading llvm/include/llvm/MC/MCStreamer.h +7 −0 Original line number Diff line number Diff line Loading @@ -626,6 +626,13 @@ public: /// to pass in a MCExpr for constant integers. virtual void EmitIntValue(uint64_t Value, unsigned Size); /// Special case of EmitValue that avoids the client having to pass /// in a MCExpr for constant integers & prints in Hex format for certain /// modes. virtual void EmitIntValueInHex(uint64_t Value, unsigned Size) { EmitIntValue(Value, Size); } virtual void EmitULEB128Value(const MCExpr *Value); virtual void EmitSLEB128Value(const MCExpr *Value); Loading llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -103,7 +103,7 @@ public: void EmitBytes(StringRef Data) { OS->EmitBytes(Data); } void EmitIntValue(uint64_t Value, unsigned Size) { OS->EmitIntValue(Value, Size); OS->EmitIntValueInHex(Value, Size); } void EmitBinaryData(StringRef Data) { OS->EmitBinaryData(Data); } Loading llvm/lib/DebugInfo/CodeView/TypeRecordMapping.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -306,7 +306,7 @@ Error TypeRecordMapping::visitKnownRecord(CVType &CVR, VFTableRecord &Record) { for (auto Name : Record.MethodNames) NamesLen += Name.size() + 1; } error(IO.mapInteger(NamesLen, "")); error(IO.mapInteger(NamesLen)); error(IO.mapVectorTail( Record.MethodNames, [](CodeViewRecordIO &IO, StringRef &S) { Loading llvm/lib/MC/MCAsmStreamer.cpp +5 −0 Original line number Diff line number Diff line Loading @@ -188,6 +188,7 @@ public: void EmitValueImpl(const MCExpr *Value, unsigned Size, SMLoc Loc = SMLoc()) override; void EmitIntValue(uint64_t Value, unsigned Size) override; void EmitIntValueInHex(uint64_t Value, unsigned Size) override; void EmitULEB128Value(const MCExpr *Value) override; Loading Loading @@ -923,6 +924,10 @@ void MCAsmStreamer::EmitIntValue(uint64_t Value, unsigned Size) { EmitValue(MCConstantExpr::create(Value, getContext()), Size); } void MCAsmStreamer::EmitIntValueInHex(uint64_t Value, unsigned Size) { EmitValue(MCConstantExpr::create(Value, getContext(), true), Size); } void MCAsmStreamer::EmitValueImpl(const MCExpr *Value, unsigned Size, SMLoc Loc) { assert(Size <= 8 && "Invalid size"); Loading Loading
llvm/include/llvm/MC/MCExpr.h +10 −2 Original line number Diff line number Diff line Loading @@ -134,15 +134,21 @@ inline raw_ostream &operator<<(raw_ostream &OS, const MCExpr &E) { //// Represent a constant integer expression. class MCConstantExpr : public MCExpr { int64_t Value; bool PrintInHex = false; explicit MCConstantExpr(int64_t Value) MCConstantExpr(int64_t Value) : MCExpr(MCExpr::Constant, SMLoc()), Value(Value) {} MCConstantExpr(int64_t Value, bool PrintInHex) : MCExpr(MCExpr::Constant, SMLoc()), Value(Value), PrintInHex(PrintInHex) {} public: /// \name Construction /// @{ static const MCConstantExpr *create(int64_t Value, MCContext &Ctx); static const MCConstantExpr *create(int64_t Value, MCContext &Ctx, bool PrintInHex = false); /// @} /// \name Accessors Loading @@ -150,6 +156,8 @@ public: int64_t getValue() const { return Value; } bool useHexFormat() const { return PrintInHex; } /// @} static bool classof(const MCExpr *E) { Loading
llvm/include/llvm/MC/MCStreamer.h +7 −0 Original line number Diff line number Diff line Loading @@ -626,6 +626,13 @@ public: /// to pass in a MCExpr for constant integers. virtual void EmitIntValue(uint64_t Value, unsigned Size); /// Special case of EmitValue that avoids the client having to pass /// in a MCExpr for constant integers & prints in Hex format for certain /// modes. virtual void EmitIntValueInHex(uint64_t Value, unsigned Size) { EmitIntValue(Value, Size); } virtual void EmitULEB128Value(const MCExpr *Value); virtual void EmitSLEB128Value(const MCExpr *Value); Loading
llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -103,7 +103,7 @@ public: void EmitBytes(StringRef Data) { OS->EmitBytes(Data); } void EmitIntValue(uint64_t Value, unsigned Size) { OS->EmitIntValue(Value, Size); OS->EmitIntValueInHex(Value, Size); } void EmitBinaryData(StringRef Data) { OS->EmitBinaryData(Data); } Loading
llvm/lib/DebugInfo/CodeView/TypeRecordMapping.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -306,7 +306,7 @@ Error TypeRecordMapping::visitKnownRecord(CVType &CVR, VFTableRecord &Record) { for (auto Name : Record.MethodNames) NamesLen += Name.size() + 1; } error(IO.mapInteger(NamesLen, "")); error(IO.mapInteger(NamesLen)); error(IO.mapVectorTail( Record.MethodNames, [](CodeViewRecordIO &IO, StringRef &S) { Loading
llvm/lib/MC/MCAsmStreamer.cpp +5 −0 Original line number Diff line number Diff line Loading @@ -188,6 +188,7 @@ public: void EmitValueImpl(const MCExpr *Value, unsigned Size, SMLoc Loc = SMLoc()) override; void EmitIntValue(uint64_t Value, unsigned Size) override; void EmitIntValueInHex(uint64_t Value, unsigned Size) override; void EmitULEB128Value(const MCExpr *Value) override; Loading Loading @@ -923,6 +924,10 @@ void MCAsmStreamer::EmitIntValue(uint64_t Value, unsigned Size) { EmitValue(MCConstantExpr::create(Value, getContext()), Size); } void MCAsmStreamer::EmitIntValueInHex(uint64_t Value, unsigned Size) { EmitValue(MCConstantExpr::create(Value, getContext(), true), Size); } void MCAsmStreamer::EmitValueImpl(const MCExpr *Value, unsigned Size, SMLoc Loc) { assert(Size <= 8 && "Invalid size"); Loading