File tree Expand file tree Collapse file tree 2 files changed +10
-4
lines changed Expand file tree Collapse file tree 2 files changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -3625,14 +3625,16 @@ ClangImporter::Implementation::loadNamedMembers(
3625
3625
return None;
3626
3626
}
3627
3627
3628
- // Also bail out if there are any global-as-member mappings for this type; we
3629
- // can support some of them lazily but the full set of idioms seems
3628
+ // Also bail out if there are any global-as-member mappings for this context;
3629
+ // we can support some of them lazily but the full set of idioms seems
3630
3630
// prohibitively complex (also they're not stored in by-name lookup, for
3631
3631
// reasons unclear).
3632
- if (forEachLookupTable ([&](SwiftLookupTable &table) -> bool {
3632
+ if (isa<ExtensionDecl>(D) && !checkedGlobalsAsMembers.insert (IDC).second ) {
3633
+ if (forEachLookupTable ([&](SwiftLookupTable &table) -> bool {
3633
3634
return (!table.lookupGlobalsAsMembers (effectiveClangContext).empty ());
3634
3635
}))
3635
- return None;
3636
+ return None;
3637
+ }
3636
3638
3637
3639
// There are 3 cases:
3638
3640
//
Original file line number Diff line number Diff line change @@ -564,6 +564,10 @@ class LLVM_LIBRARY_VISIBILITY ClangImporter::Implementation
564
564
llvm::DenseMap<const Decl *, ArrayRef<ProtocolDecl *>>
565
565
ImportedProtocols;
566
566
567
+ // / The set of declaration context for which we've already ruled out the
568
+ // / presence of globals-as-members.
569
+ llvm::DenseSet<const IterableDeclContext *> checkedGlobalsAsMembers;
570
+
567
571
void startedImportingEntity ();
568
572
569
573
public:
You can’t perform that action at this time.
0 commit comments