From 0e180f254bafec81b13213b69385122fdbd8f0cd Mon Sep 17 00:00:00 2001 From: Bob Wilson Date: Tue, 7 May 2013 20:56:33 +0000 Subject: [PATCH] Remove redundant check and use cached FrameArray values. No functional change. llvm-svn: 181355 --- llvm/lib/MC/MCDwarf.cpp | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/llvm/lib/MC/MCDwarf.cpp b/llvm/lib/MC/MCDwarf.cpp index 18982e9cab46..7640a63ee33e 100644 --- a/llvm/lib/MC/MCDwarf.cpp +++ b/llvm/lib/MC/MCDwarf.cpp @@ -1480,20 +1480,16 @@ void MCDwarfFrameEmitter::Emit(MCStreamer &Streamer, // Emit the compact unwind info if available. if (IsEH && MOFI->getCompactUnwindSection()) { - unsigned NumFrameInfos = Streamer.getNumFrameInfos(); bool SectionEmitted = false; - - if (NumFrameInfos) { - for (unsigned i = 0; i < NumFrameInfos; ++i) { - const MCDwarfFrameInfo &Frame = Streamer.getFrameInfo(i); - if (Frame.CompactUnwindEncoding == 0) continue; - if (!SectionEmitted) { - Streamer.SwitchSection(MOFI->getCompactUnwindSection()); - Streamer.EmitValueToAlignment(Context.getAsmInfo().getPointerSize()); - SectionEmitted = true; - } - Emitter.EmitCompactUnwind(Streamer, Frame); + for (unsigned i = 0, n = FrameArray.size(); i < n; ++i) { + const MCDwarfFrameInfo &Frame = FrameArray[i]; + if (Frame.CompactUnwindEncoding == 0) continue; + if (!SectionEmitted) { + Streamer.SwitchSection(MOFI->getCompactUnwindSection()); + Streamer.EmitValueToAlignment(Context.getAsmInfo().getPointerSize()); + SectionEmitted = true; } + Emitter.EmitCompactUnwind(Streamer, Frame); } }