[MC] Simplify code. No functionality change intended.

llvm-svn: 238676
This commit is contained in:
Benjamin Kramer 2015-05-31 18:49:28 +00:00
parent 80b5689d91
commit 412c4dbbd9

View File

@ -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 {