diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/MC/MCAsmStreamer.cpp | 13 | ||||
-rw-r--r-- | lib/MC/MCDwarf.cpp | 4 | ||||
-rw-r--r-- | lib/MC/MCLoggingStreamer.cpp | 3 | ||||
-rw-r--r-- | lib/MC/MCNullStreamer.cpp | 2 | ||||
-rw-r--r-- | lib/MC/MCObjectStreamer.cpp | 2 | ||||
-rw-r--r-- | lib/Target/PTX/PTXMCAsmStreamer.cpp | 5 |
6 files changed, 20 insertions, 9 deletions
diff --git a/lib/MC/MCAsmStreamer.cpp b/lib/MC/MCAsmStreamer.cpp index 02b6662..30a3105 100644 --- a/lib/MC/MCAsmStreamer.cpp +++ b/lib/MC/MCAsmStreamer.cpp @@ -147,7 +147,8 @@ public: virtual void EmitBytes(StringRef Data, unsigned AddrSpace); - virtual void EmitValue(const MCExpr *Value, unsigned Size,unsigned AddrSpace); + virtual void EmitValue(const MCExpr *Value, unsigned Size,unsigned AddrSpace, + bool UseSet = false); virtual void EmitULEB128Value(const MCExpr *Value, unsigned AddrSpace = 0); @@ -495,7 +496,7 @@ void MCAsmStreamer::EmitBytes(StringRef Data, unsigned AddrSpace) { } void MCAsmStreamer::EmitValue(const MCExpr *Value, unsigned Size, - unsigned AddrSpace) { + unsigned AddrSpace, bool UseSet) { assert(CurSection && "Cannot emit contents before setting section!"); const char *Directive = 0; switch (Size) { @@ -521,6 +522,14 @@ void MCAsmStreamer::EmitValue(const MCExpr *Value, unsigned Size, } assert(Directive && "Invalid size for machine code value!"); + if (UseSet && MAI.hasSetDirective()) { + MCSymbol *SetLabel = getContext().CreateTempSymbol(); + EmitAssignment(SetLabel, Value); + OS << Directive << *SetLabel; + EmitEOL(); + return; + } + OS << Directive << *Value; EmitEOL(); } diff --git a/lib/MC/MCDwarf.cpp b/lib/MC/MCDwarf.cpp index adefa5d..0daf295 100644 --- a/lib/MC/MCDwarf.cpp +++ b/lib/MC/MCDwarf.cpp @@ -256,7 +256,7 @@ void MCDwarfFileTable::Emit(MCStreamer *MCOS, // The first 4 bytes is the total length of the information for this // compilation unit (not including these 4 bytes for the length). MCOS->EmitValue(MakeStartMinusEndExpr(MCOS, LineStartSym, LineEndSym, 4), - 4, 0); + 4, 0, true /*UseSet*/); // Next 2 bytes is the Version, which is Dwarf 2. MCOS->EmitIntValue(2, 2); @@ -270,7 +270,7 @@ void MCDwarfFileTable::Emit(MCStreamer *MCOS, // length of the prologue. MCOS->EmitValue(MakeStartMinusEndExpr(MCOS, LineStartSym, ProEndSym, (4 + 2 + 4)), - 4, 0); + 4, 0, true /*UseSet*/); // Parameters of the state machine, are next. MCOS->EmitIntValue(DWARF2_LINE_MIN_INSN_LENGTH, 1); diff --git a/lib/MC/MCLoggingStreamer.cpp b/lib/MC/MCLoggingStreamer.cpp index 38cb5c7..5191ac4 100644 --- a/lib/MC/MCLoggingStreamer.cpp +++ b/lib/MC/MCLoggingStreamer.cpp @@ -147,7 +147,8 @@ public: return Child->EmitBytes(Data, AddrSpace); } - virtual void EmitValue(const MCExpr *Value, unsigned Size,unsigned AddrSpace){ + virtual void EmitValue(const MCExpr *Value, unsigned Size,unsigned AddrSpace, + bool UseSet = false){ LogCall("EmitValue"); return Child->EmitValue(Value, Size, AddrSpace); } diff --git a/lib/MC/MCNullStreamer.cpp b/lib/MC/MCNullStreamer.cpp index c781fe6..c79793c 100644 --- a/lib/MC/MCNullStreamer.cpp +++ b/lib/MC/MCNullStreamer.cpp @@ -66,7 +66,7 @@ namespace { virtual void EmitBytes(StringRef Data, unsigned AddrSpace) {} virtual void EmitValue(const MCExpr *Value, unsigned Size, - unsigned AddrSpace) {} + unsigned AddrSpace, bool UseSet = false) {} virtual void EmitULEB128Value(const MCExpr *Value, unsigned AddrSpace = 0) {} virtual void EmitSLEB128Value(const MCExpr *Value, diff --git a/lib/MC/MCObjectStreamer.cpp b/lib/MC/MCObjectStreamer.cpp index 331f726..a514858 100644 --- a/lib/MC/MCObjectStreamer.cpp +++ b/lib/MC/MCObjectStreamer.cpp @@ -77,7 +77,7 @@ const MCExpr *MCObjectStreamer::AddValueSymbols(const MCExpr *Value) { } void MCObjectStreamer::EmitValue(const MCExpr *Value, unsigned Size, - unsigned AddrSpace) { + unsigned AddrSpace, bool UseSet) { assert(AddrSpace == 0 && "Address space must be 0!"); MCDataFragment *DF = getOrCreateDataFragment(); diff --git a/lib/Target/PTX/PTXMCAsmStreamer.cpp b/lib/Target/PTX/PTXMCAsmStreamer.cpp index 8647811..0b49bcc 100644 --- a/lib/Target/PTX/PTXMCAsmStreamer.cpp +++ b/lib/Target/PTX/PTXMCAsmStreamer.cpp @@ -143,7 +143,8 @@ public: virtual void EmitBytes(StringRef Data, unsigned AddrSpace); - virtual void EmitValue(const MCExpr *Value, unsigned Size,unsigned AddrSpace); + virtual void EmitValue(const MCExpr *Value, unsigned Size,unsigned AddrSpace, + bool UseSet = false); virtual void EmitULEB128Value(const MCExpr *Value, unsigned AddrSpace = 0); virtual void EmitSLEB128Value(const MCExpr *Value, unsigned AddrSpace = 0); virtual void EmitGPRel32Value(const MCExpr *Value); @@ -350,7 +351,7 @@ void PTXMCAsmStreamer::EmitBytes(StringRef Data, unsigned AddrSpace) { } void PTXMCAsmStreamer::EmitValue(const MCExpr *Value, unsigned Size, - unsigned AddrSpace) { + unsigned AddrSpace, bool UseSet) { assert(CurSection && "Cannot emit contents before setting section!"); const char *Directive = 0; switch (Size) { |