Skip to content

Commit 85976b2

Browse files
author
Joe Shajrawi
committed
SIL Parser: Use a Set instead of a Vector for zombie functions to avoid duplicates
1 parent 9af789d commit 85976b2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/Parse/ParseSIL.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ namespace swift {
4646
llvm::DenseMap<Identifier,
4747
std::pair<SILFunction*, SourceLoc>> ForwardRefFns;
4848
/// A list of all functions forward-declared by a sil_scope.
49-
std::vector<SILFunction *> PotentialZombieFns;
49+
llvm::DenseSet<SILFunction *> PotentialZombieFns;
5050

5151
/// A map from textual .sil scope number to SILDebugScopes.
5252
llvm::DenseMap<unsigned, SILDebugScope *> ScopeSlots;
@@ -4972,7 +4972,7 @@ bool Parser::parseSILScope() {
49724972
return true;
49734973
}
49744974
ParentFn = ScopeState.getGlobalNameForReference(FnName, FnTy, FnLoc, true);
4975-
ScopeState.TUState.PotentialZombieFns.push_back(ParentFn);
4975+
ScopeState.TUState.PotentialZombieFns.insert(ParentFn);
49764976
}
49774977

49784978
SILDebugScope *InlinedAt = nullptr;

0 commit comments

Comments
 (0)