From bf60fb0a37c043977c355ac68bfae04a47ac9d08 Mon Sep 17 00:00:00 2001 From: Rafael Espindola Date: Thu, 28 Apr 2011 03:26:11 +0000 Subject: [PATCH] Produce the EH_frame# symbols if needed. llvm-svn: 130378 --- llvm/lib/MC/MCDwarf.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/llvm/lib/MC/MCDwarf.cpp b/llvm/lib/MC/MCDwarf.cpp index ec2bcf85edb6..a40e3853c039 100644 --- a/llvm/lib/MC/MCDwarf.cpp +++ b/llvm/lib/MC/MCDwarf.cpp @@ -494,9 +494,10 @@ static const MachineLocation TranslateMachineLocation( namespace { class FrameEmitterImpl { int CFAOffset; + int CIENum; public: - FrameEmitterImpl() : CFAOffset(0) { + FrameEmitterImpl() : CFAOffset(0), CIENum(0) { } const MCSymbol &EmitCIE(MCStreamer &streamer, @@ -623,7 +624,15 @@ const MCSymbol &FrameEmitterImpl::EmitCIE(MCStreamer &streamer, const TargetAsmInfo &asmInfo = context.getTargetAsmInfo(); const MCSection §ion = *asmInfo.getEHFrameSection(); streamer.SwitchSection(§ion); - MCSymbol *sectionStart = context.CreateTempSymbol(); + + MCSymbol *sectionStart; + if (asmInfo.isFunctionEHFrameSymbolPrivate()) + sectionStart = context.CreateTempSymbol(); + else + sectionStart = context.GetOrCreateSymbol(Twine("EH_frame") + Twine(CIENum)); + + CIENum++; + MCSymbol *sectionEnd = streamer.getContext().CreateTempSymbol(); // Length