- DITypedArray<DISubprogram> SPs(CU.getSubprograms());
- assert(SPs && "Expected valid subprogram array");
-
- SmallVector<Metadata *, 16> NewSPs;
- NewSPs.reserve(SPs.getNumElements());
- for (unsigned S = 0, SE = SPs.getNumElements(); S != SE; ++S) {
- DISubprogram SP = SPs.getElement(S);
- if (SP && SP.getFunction() && Functions.count(SP.getFunction()))
+ for (DISubprogram *SP : CU->getSubprograms()) {
+ if (!SP || !SP->getFunction() || !Functions.count(SP->getFunction()))