Skip to content

[6.0] [ClangImporter] Switch lookupGlobalsAsMembers to take a non-optional EffectiveClangContext #74788

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions lib/ClangImporter/SwiftLookupTable.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -684,14 +684,13 @@ SwiftLookupTable::allGlobalsAsMembersInContext(StoredContext context) {
}

SmallVector<SwiftLookupTable::SingleEntry, 4>
SwiftLookupTable::lookupGlobalsAsMembers(
SerializedSwiftName baseName,
std::optional<EffectiveClangContext> searchContext) {
SwiftLookupTable::lookupGlobalsAsMembers(SerializedSwiftName baseName,
EffectiveClangContext searchContext) {
// Propagate the null search context.
if (!searchContext)
return lookupGlobalsAsMembersImpl(baseName, std::nullopt);

std::optional<StoredContext> storedContext = translateContext(*searchContext);
std::optional<StoredContext> storedContext = translateContext(searchContext);
if (!storedContext) return { };

return lookupGlobalsAsMembersImpl(baseName, *storedContext);
Expand Down
2 changes: 1 addition & 1 deletion lib/ClangImporter/SwiftLookupTable.h
Original file line number Diff line number Diff line change
Expand Up @@ -549,7 +549,7 @@ class SwiftLookupTable {
/// entities should reside.
SmallVector<SingleEntry, 4>
lookupGlobalsAsMembers(SerializedSwiftName baseName,
std::optional<EffectiveClangContext> searchContext);
EffectiveClangContext searchContext);

SmallVector<SingleEntry, 4>
allGlobalsAsMembersInContext(EffectiveClangContext context);
Expand Down