Skip to content

Commit 1b7941e

Browse files
committed
[NFC][Utils] Eliminate DISubprogram set from BuildDebugInfoMDMap
Summary: Previously, we'd add all SPs distinct from the cloned one into a set. Then when cloning a local scope we'd check if it's from one of those 'distinct' SPs by checking if it's in the set. We don't need to do that. We can just check against the cloned SP directly and drop the set. Test Plan: ninja check-llvm-unit check-llvm stack-info: PR: #118625, branch: users/artempyanykh/fast-coro-upstream/6
1 parent 39cccf5 commit 1b7941e

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

llvm/lib/Transforms/Utils/CloneFunction.cpp

+2-5
Original file line numberDiff line numberDiff line change
@@ -171,18 +171,15 @@ bool llvm::BuildDebugInfoMDMap(MDMapT &MD, CloneFunctionChangeType Changes,
171171
};
172172

173173
// Avoid cloning types, compile units, and (other) subprograms.
174-
SmallPtrSet<const DISubprogram *, 16> MappedToSelfSPs;
175174
for (DISubprogram *ISP : DIFinder.subprograms()) {
176-
if (ISP != SPClonedWithinModule) {
175+
if (ISP != SPClonedWithinModule)
177176
mapToSelfIfNew(ISP);
178-
MappedToSelfSPs.insert(ISP);
179-
}
180177
}
181178

182179
// If a subprogram isn't going to be cloned skip its lexical blocks as well.
183180
for (DIScope *S : DIFinder.scopes()) {
184181
auto *LScope = dyn_cast<DILocalScope>(S);
185-
if (LScope && MappedToSelfSPs.count(LScope->getSubprogram()))
182+
if (LScope && LScope->getSubprogram() != SPClonedWithinModule)
186183
mapToSelfIfNew(S);
187184
}
188185

0 commit comments

Comments
 (0)