Skip to content

Commit 77e2b63

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 8402a0f commit 77e2b63

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
@@ -172,18 +172,15 @@ bool llvm::BuildDebugInfoMDMap(DenseMap<const Metadata *, TrackingMDRef> &MD,
172172
};
173173

174174
// Avoid cloning types, compile units, and (other) subprograms.
175-
SmallPtrSet<const DISubprogram *, 16> MappedToSelfSPs;
176175
for (DISubprogram *ISP : DIFinder.subprograms()) {
177-
if (ISP != SPClonedWithinModule) {
176+
if (ISP != SPClonedWithinModule)
178177
mapToSelfIfNew(ISP);
179-
MappedToSelfSPs.insert(ISP);
180-
}
181178
}
182179

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

0 commit comments

Comments
 (0)