[Serialization] Support Swift only system module

Previously 'isSystemModule()' returns true only if the module is:
- Standard library
- Clang module and that is `IsSystem`
- Swift overlay for clang `IsSystem` module

Now:
- Clang module and that is `IsSystem`; or
- Swift overlay for clang `IsSystem` module
- Swift module found in either of these directories:
  - Runtime library directoris (including stdlib)
  - Frameworks in `-Fsystem` directories
  - Frameworks in `$SDKROOT/System/Library/Frameworks/` (Darwin)
  - Frameworks in `$SDKROOT/Library/Frameworks/` (Darwin)

rdar://problem/50516314
This commit is contained in:
Rintaro Ishizaki
2019-05-07 16:32:23 -07:00
parent 558cc6382e
commit d3d30ee246
16 changed files with 297 additions and 32 deletions

View File

@@ -325,6 +325,15 @@ public:
Bits.ModuleDecl.RawResilienceStrategy = unsigned(strategy);
}
/// \returns true if this module is a system module; note that the StdLib is
/// considered a system module.
bool isSystemModule() const {
return Bits.ModuleDecl.IsSystemModule;
}
void setIsSystemModule(bool flag = true) {
Bits.ModuleDecl.IsSystemModule = flag;
}
bool isResilient() const {
return getResilienceStrategy() != ResilienceStrategy::Default;
}
@@ -553,10 +562,6 @@ public:
/// \returns true if this module is the "SwiftOnoneSupport" module;
bool isOnoneSupportModule() const;
/// \returns true if this module is a system module; note that the StdLib is
/// considered a system module.
bool isSystemModule() const;
/// \returns true if traversal was aborted, false otherwise.
bool walk(ASTWalker &Walker);