From: Bill Wendling Date: Tue, 6 Sep 2011 18:37:11 +0000 (+0000) Subject: As a first step, emit both the compact unwind and CIE/FDEs for a function. X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=d8ab8e9707e6170218ce82516d15b36f54b4bc1c;p=oota-llvm.git As a first step, emit both the compact unwind and CIE/FDEs for a function. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139152 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/MC/MCDwarf.cpp b/lib/MC/MCDwarf.cpp index b57fd9a13bd..4658a3093fa 100644 --- a/lib/MC/MCDwarf.cpp +++ b/lib/MC/MCDwarf.cpp @@ -1013,24 +1013,18 @@ void MCDwarfFrameEmitter::Emit(MCStreamer &Streamer, MCObjectFileInfo *MOFI = const_cast(Context.getObjectFileInfo()); FrameEmitterImpl Emitter(UsingCFI, IsEH); - SmallVector RequiresFDE; - ArrayRef FrameArray; + ArrayRef FrameArray = Streamer.getFrameInfos(); - if (IsEH && MOFI->getCompactUnwindSection()) { + // Emit the compact unwind info if available. + // FIXME: This emits both the compact unwind and the old CIE/FDE + // information. Only one of those is needed. + if (IsEH && MOFI->getCompactUnwindSection()) for (unsigned i = 0, n = Streamer.getNumFrameInfos(); i < n; ++i) { const MCDwarfFrameInfo &Frame = Streamer.getFrameInfo(i); - if (!Frame.CompactUnwindEncoding || - !Emitter.EmitCompactUnwind(Streamer, Frame)) - RequiresFDE.push_back(Streamer.getFrameInfo(i)); + if (!Frame.CompactUnwindEncoding) + Emitter.EmitCompactUnwind(Streamer, Frame); } - // Early exit if we don't need to emit FDEs. - if (RequiresFDE.empty()) return; - FrameArray = RequiresFDE; - } else { - FrameArray = Streamer.getFrameInfos(); - } - const MCSection &Section = IsEH ? *MOFI->getEHFrameSection() : *MOFI->getDwarfFrameSection(); Streamer.SwitchSection(&Section);