summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--llvm/lib/MC/MCContext.cpp9
1 files changed, 2 insertions, 7 deletions
diff --git a/llvm/lib/MC/MCContext.cpp b/llvm/lib/MC/MCContext.cpp
index 1f2f034a3ac..5756da3c6a2 100644
--- a/llvm/lib/MC/MCContext.cpp
+++ b/llvm/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<MCSection *> 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 {
OpenPOWER on IntegriCloud