From d79915c6fe9a9b31ba7882dd1b6311cbb9627395 Mon Sep 17 00:00:00 2001 From: Benjamin Kramer Date: Sun, 31 May 2015 18:49:28 +0000 Subject: [PATCH] [MC] Simplify code. No functionality change intended. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238676 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/MC/MCContext.cpp | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/lib/MC/MCContext.cpp b/lib/MC/MCContext.cpp index 1f2f034a3ac..5756da3c6a2 100644 --- a/lib/MC/MCContext.cpp +++ b/lib/MC/MCContext.cpp @@ -447,13 +447,8 @@ bool MCContext::isValidDwarfFileNumber(unsigned FileNumber, unsigned CUID) { /// Remove empty sections from SectionStartEndSyms, to avoid generating /// useless debug info for them. void MCContext::finalizeDwarfSections(MCStreamer &MCOS) { - std::vector Keep; - for (MCSection *Sec : SectionsForRanges) { - if (MCOS.mayHaveInstructions(*Sec)) - Keep.push_back(Sec); - } - SectionsForRanges.clear(); - SectionsForRanges.insert(Keep.begin(), Keep.end()); + SectionsForRanges.remove_if( + [&](MCSection *Sec) { return !MCOS.mayHaveInstructions(*Sec); }); } void MCContext::reportFatalError(SMLoc Loc, const Twine &Msg) const { -- 2.34.1