From: Rafael Espindola Date: Fri, 6 Nov 2015 13:14:59 +0000 (+0000) Subject: Pass SectionStart directly to the one function that uses it. X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=ee3332fb71e14df81ba99dbbfaeb619d6589547b;p=oota-llvm.git Pass SectionStart directly to the one function that uses it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@252299 91177308-0d34-0410-b5e6-96231b3b80d8 --- 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); } }