mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Serialization: Support '@_usableFromInline import'
Progress on <rdar://problem/39338239>; we still need to infer this attribute though.
This commit is contained in:
@@ -1140,10 +1140,12 @@ ModuleFile::ModuleFile(
|
||||
unsigned kind = cursor.readRecord(next.ID, scratch, &blobData);
|
||||
switch (kind) {
|
||||
case input_block::IMPORTED_MODULE: {
|
||||
bool exported, scoped;
|
||||
bool exported, usableFromInline, scoped;
|
||||
input_block::ImportedModuleLayout::readRecord(scratch,
|
||||
exported, scoped);
|
||||
Dependencies.push_back({blobData, exported, scoped});
|
||||
exported,
|
||||
usableFromInline,
|
||||
scoped);
|
||||
Dependencies.push_back({blobData, exported, usableFromInline, scoped});
|
||||
break;
|
||||
}
|
||||
case input_block::LINK_LIBRARY: {
|
||||
@@ -1600,8 +1602,8 @@ void ModuleFile::getImportedModules(
|
||||
break;
|
||||
|
||||
case ModuleDecl::ImportFilter::ForLinking:
|
||||
// FIXME
|
||||
if (!dep.isExported())
|
||||
// Only include @_exported and @usableFromInline imports.
|
||||
if (!dep.isExported() && !dep.isUsableFromInline())
|
||||
continue;
|
||||
|
||||
break;
|
||||
@@ -1673,6 +1675,9 @@ void ModuleFile::getImportDecls(SmallVectorImpl<Decl *> &Results) {
|
||||
if (Dep.isExported())
|
||||
ID->getAttrs().add(
|
||||
new (Ctx) ExportedAttr(/*IsImplicit=*/false));
|
||||
if (Dep.isUsableFromInline())
|
||||
ID->getAttrs().add(
|
||||
new (Ctx) UsableFromInlineImportAttr(/*IsImplicit=*/true));
|
||||
ImportDecls.push_back(ID);
|
||||
}
|
||||
Bits.ComputedImportDecls = true;
|
||||
|
||||
Reference in New Issue
Block a user