forked from swiftlang/swift
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Clean up handling of external declarations, NFC
This is the first in a series of patches that fixes some resilience-related issues with synthesized accessors and materializeForSet. Previously we maintained two lists of external declarations encountered while type checking: - ASTContext::ExternalDefinitions - TypeChecker::implicitlyDefinedFunctions The former contained the following: - Imported nominal types from Clang, so that SILGen can emit witness tables - Functions and variables with Clang decls, so that IRGen can instruct Clang to emit them - Synthesized accessors The latter contained synthesized functions for derived conformances. Since the second list was not visible outside Sema, we relied on the Clang importer to add the type that contained the declaration to the ExternalDefinitions list. In practice, we only synthesized members of enums in this manner. Because of this, SILGenModule::emitExternalDefinitions() had special logic to skip members of enums, since it would visit them when visiting the enum itself. Instead, it appears that we can remove implicitlyDefinedFunctions completely, changing usage sites to add the decl to ExternalDefinitions instead, and simplify SILGenModule::emitExternalDefinition() a bit in the process. Also, it looks like we never had Modules appear in ExternalDefinitions, so assert if those come up instead of skipping them.
- Loading branch information
1 parent
ff4ea54
commit 9bdb7d3
Showing
9 changed files
with
22 additions
and
64 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters