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
This commit is contained in:
Rafael Espindola 2015-11-06 13:14:59 +00:00
parent 169bb7dc81
commit ee3332fb71

View File

@ -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<MCCFIInstruction> 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<CIEKey, const MCSymbol *> 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);
}
}