mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[SPI] Serialize SPI attributes on imports
This commit is contained in:
@@ -106,6 +106,8 @@ public:
|
||||
public:
|
||||
ModuleDecl::ImportedModule Import = {};
|
||||
const StringRef RawPath;
|
||||
const StringRef RawSPIs;
|
||||
SmallVector<Identifier, 4> spis;
|
||||
|
||||
private:
|
||||
using ImportFilterKind = ModuleDecl::ImportFilterKind;
|
||||
@@ -120,9 +122,9 @@ public:
|
||||
return static_cast<ImportFilterKind>(1 << RawImportControl);
|
||||
}
|
||||
|
||||
Dependency(StringRef path, bool isHeader, ImportFilterKind importControl,
|
||||
Dependency(StringRef path, StringRef spis, bool isHeader, ImportFilterKind importControl,
|
||||
bool isScoped)
|
||||
: RawPath(path), RawImportControl(rawControlFromKind(importControl)),
|
||||
: RawPath(path), RawSPIs(spis), RawImportControl(rawControlFromKind(importControl)),
|
||||
IsHeader(isHeader), IsScoped(isScoped) {
|
||||
assert(llvm::countPopulation(static_cast<unsigned>(importControl)) == 1 &&
|
||||
"must be a particular filter option, not a bitset");
|
||||
@@ -130,13 +132,13 @@ public:
|
||||
}
|
||||
|
||||
public:
|
||||
Dependency(StringRef path, ImportFilterKind importControl, bool isScoped)
|
||||
: Dependency(path, false, importControl, isScoped) {}
|
||||
Dependency(StringRef path, StringRef spis, ImportFilterKind importControl, bool isScoped)
|
||||
: Dependency(path, spis, false, importControl, isScoped) {}
|
||||
|
||||
static Dependency forHeader(StringRef headerPath, bool exported) {
|
||||
auto importControl = exported ? ImportFilterKind::Public
|
||||
: ImportFilterKind::Private;
|
||||
return Dependency(headerPath, true, importControl, false);
|
||||
return Dependency(headerPath, StringRef(), true, importControl, false);
|
||||
}
|
||||
|
||||
bool isLoaded() const {
|
||||
|
||||
Reference in New Issue
Block a user