ICF is performed after EhInputSections and MergeInputSections were
eliminated from inputSections. Every element of inputSections is an
InputSection.
llvm-svn: 371744
// The main function of ICF.
template <class ELFT> void ICF<ELFT>::run() {
// Collect sections to merge.
- for (InputSectionBase *sec : inputSections)
- if (auto *s = dyn_cast<InputSection>(sec))
- if (isEligible(s))
- sections.push_back(s);
+ for (InputSectionBase *sec : inputSections) {
+ auto *s = cast<InputSection>(sec);
+ if (isEligible(s))
+ sections.push_back(s);
+ }
// Initially, we use hash values to partition sections.
parallelForEach(sections, [&](InputSection *s) {