summaryrefslogtreecommitdiffstats
path: root/llvm/lib/MC/MCContext.cpp
diff options
context:
space:
mode:
authorBenjamin Kramer <benny.kra@googlemail.com>2015-05-31 18:49:28 +0000
committerBenjamin Kramer <benny.kra@googlemail.com>2015-05-31 18:49:28 +0000
commit412c4dbbd9f0b66a57b3a1d641da79855c04fd9b (patch)
tree598a12190729e1316c2c3f67a0698c8a69aeaa47 /llvm/lib/MC/MCContext.cpp
parent80b5689d919df2d4dfcc039e6e9e85b577372a93 (diff)
downloadbcm5719-llvm-412c4dbbd9f0b66a57b3a1d641da79855c04fd9b.tar.gz
bcm5719-llvm-412c4dbbd9f0b66a57b3a1d641da79855c04fd9b.zip
[MC] Simplify code. No functionality change intended.
llvm-svn: 238676
Diffstat (limited to 'llvm/lib/MC/MCContext.cpp')
-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