DebugInfo: Gut DISubprogram and DILexicalBlock*
Gut the `DIDescriptor` wrappers around `MDLocalScope` subclasses. Note
that `DILexicalBlock` wraps `MDLexicalBlockBase`, not `MDLexicalBlock`.
llvm-svn: 234850
diff --git a/llvm/lib/Linker/LinkModules.cpp b/llvm/lib/Linker/LinkModules.cpp
index 75849db..03ab9fb 100644
--- a/llvm/lib/Linker/LinkModules.cpp
+++ b/llvm/lib/Linker/LinkModules.cpp
@@ -1272,12 +1272,8 @@
DICompileUnit CU = cast<MDCompileUnit>(CompileUnits->getOperand(I));
assert(CU && "Expected valid compile unit");
- MDSubprogramArray SPs(CU.getSubprograms());
- assert(SPs && "Expected valid subprogram array");
-
- for (unsigned S = 0, SE = SPs.size(); S != SE; ++S) {
- DISubprogram SP = SPs[S];
- if (!SP || !SP.getFunction() || !Functions.count(SP.getFunction()))
+ for (MDSubprogram *SP : CU->getSubprograms()) {
+ if (!SP || !SP->getFunction() || !Functions.count(SP->getFunction()))
continue;
// Prevent DebugInfoFinder from tagging this as the canonical subprogram,