1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2025-02-01 05:01:59 +01:00

[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 ef67976879
commit bccd30ee34

View File

@ -447,13 +447,8 @@ bool MCContext::isValidDwarfFileNumber(unsigned FileNumber, unsigned CUID) {
/// Remove empty sections from SectionStartEndSyms, to avoid generating /// Remove empty sections from SectionStartEndSyms, to avoid generating
/// useless debug info for them. /// useless debug info for them.
void MCContext::finalizeDwarfSections(MCStreamer &MCOS) { void MCContext::finalizeDwarfSections(MCStreamer &MCOS) {
std::vector<MCSection *> Keep; SectionsForRanges.remove_if(
for (MCSection *Sec : SectionsForRanges) { [&](MCSection *Sec) { return !MCOS.mayHaveInstructions(*Sec); });
if (MCOS.mayHaveInstructions(*Sec))
Keep.push_back(Sec);
}
SectionsForRanges.clear();
SectionsForRanges.insert(Keep.begin(), Keep.end());
} }
void MCContext::reportFatalError(SMLoc Loc, const Twine &Msg) const { void MCContext::reportFatalError(SMLoc Loc, const Twine &Msg) const {