From 53d16282cf139cc441e111fd8a0f861eeb0f15d0 Mon Sep 17 00:00:00 2001 From: Rafael Espindola Date: Fri, 6 Nov 2015 13:14:59 +0000 Subject: [PATCH] Pass SectionStart directly to the one function that uses it. llvm-svn: 252299 --- lib/MC/MCDwarf.cpp | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/lib/MC/MCDwarf.cpp b/lib/MC/MCDwarf.cpp index 85680c01644..2715408aab2 100644 --- a/lib/MC/MCDwarf.cpp +++ b/lib/MC/MCDwarf.cpp @@ -999,15 +999,12 @@ class FrameEmitterImpl { int CFAOffset = 0; int InitialCFAOffset = 0; bool IsEH; - const MCSymbol *SectionStart = nullptr; MCObjectStreamer &Streamer; public: FrameEmitterImpl(bool IsEH, MCObjectStreamer &Streamer) : IsEH(IsEH), Streamer(Streamer) {} - void setSectionStart(const MCSymbol *Label) { SectionStart = Label; } - /// Emit the unwind information in a compact way. void EmitCompactUnwind(const MCDwarfFrameInfo &frame); @@ -1016,7 +1013,7 @@ public: bool IsSignalFrame, unsigned lsdaEncoding, bool IsSimple); void EmitFDE(const MCSymbol &cieStart, const MCDwarfFrameInfo &frame, - bool LastInSection); + bool LastInSection, const MCSymbol &SectionStart); void EmitCFIInstructions(ArrayRef Instrs, MCSymbol *BaseLabel); void EmitCFIInstruction(const MCCFIInstruction &Instr); @@ -1371,7 +1368,8 @@ const MCSymbol &FrameEmitterImpl::EmitCIE(const MCSymbol *personality, void FrameEmitterImpl::EmitFDE(const MCSymbol &cieStart, const MCDwarfFrameInfo &frame, - bool LastInSection) { + bool LastInSection, + const MCSymbol &SectionStart) { MCContext &context = Streamer.getContext(); MCSymbol *fdeStart = context.createTempSymbol(); MCSymbol *fdeEnd = context.createTempSymbol(); @@ -1393,7 +1391,7 @@ void FrameEmitterImpl::EmitFDE(const MCSymbol &cieStart, emitAbsValue(Streamer, offset, 4); } else if (!asmInfo->doesDwarfUseRelocationsAcrossSections()) { const MCExpr *offset = - MakeStartMinusEndExpr(Streamer, *SectionStart, cieStart, 0); + MakeStartMinusEndExpr(Streamer, SectionStart, cieStart, 0); emitAbsValue(Streamer, offset, 4); } else { Streamer.EmitSymbolValue(&cieStart, 4); @@ -1523,7 +1521,6 @@ void MCDwarfFrameEmitter::Emit(MCObjectStreamer &Streamer, MCAsmBackend *MAB, Streamer.SwitchSection(&Section); MCSymbol *SectionStart = Context.createTempSymbol(); Streamer.EmitLabel(SectionStart); - Emitter.setSectionStart(SectionStart); DenseMap CIEStarts; @@ -1546,7 +1543,7 @@ void MCDwarfFrameEmitter::Emit(MCObjectStreamer &Streamer, MCAsmBackend *MAB, Frame.Lsda, Frame.IsSignalFrame, Frame.LsdaEncoding, Frame.IsSimple); - Emitter.EmitFDE(*CIEStart, Frame, I == E); + Emitter.EmitFDE(*CIEStart, Frame, I == E, *SectionStart); } }