diff options
Diffstat (limited to 'lib/MC')
-rw-r--r-- | lib/MC/MCDwarf.cpp | 11 | ||||
-rw-r--r-- | lib/MC/MCStreamer.cpp | 6 |
2 files changed, 8 insertions, 9 deletions
diff --git a/lib/MC/MCDwarf.cpp b/lib/MC/MCDwarf.cpp index 53731dca7e..5d36ee3e62 100644 --- a/lib/MC/MCDwarf.cpp +++ b/lib/MC/MCDwarf.cpp @@ -213,15 +213,8 @@ 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). - // FIXME: We create the dummy TotalLength variable because LineEndSym points - // to the end of the section and the darwin assembler doesn't consider that - // difference an assembly time constant. It might be better for this to be - // proected by a flag. - MCSymbol *TotalLength = MCOS->getContext().CreateTempSymbol(); - MCOS->EmitAssignment(TotalLength, - MakeStartMinusEndExpr(MCOS, LineStartSym, LineEndSym, - 4)); - MCOS->EmitSymbolValue(TotalLength, 4, 0); + MCOS->EmitAbsValue(MakeStartMinusEndExpr(MCOS, LineStartSym, LineEndSym,4), + 4); // Next 2 bytes is the Version, which is Dwarf 2. MCOS->EmitIntValue(2, 2); diff --git a/lib/MC/MCStreamer.cpp b/lib/MC/MCStreamer.cpp index 6df4ae44e4..b9d59056f3 100644 --- a/lib/MC/MCStreamer.cpp +++ b/lib/MC/MCStreamer.cpp @@ -72,6 +72,12 @@ void MCStreamer::EmitSLEB128IntValue(int64_t Value, unsigned AddrSpace) { EmitBytes(OSE.str(), AddrSpace); } +void MCStreamer::EmitAbsValue(const MCExpr *Value, unsigned Size) { + MCSymbol *ABS = getContext().CreateTempSymbol(); + EmitAssignment(ABS, Value); + EmitSymbolValue(ABS, Size, 0); +} + void MCStreamer::EmitSymbolValue(const MCSymbol *Sym, unsigned Size, unsigned AddrSpace) { EmitValue(MCSymbolRefExpr::Create(Sym, getContext()), Size, AddrSpace); |