Skip to content

Commit d570d41

Browse files
committed
s/ModuleInterfaceOptionIgnorablePrivate/ModuleInterfaceOption and formatting
1 parent 7c80976 commit d570d41

File tree

4 files changed

+11
-12
lines changed

4 files changed

+11
-12
lines changed

include/swift/AST/Module.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,8 @@ class PackageUnit: public DeclContext {
210210
/// Equality check via package name instead of pointer comparison.
211211
/// Returns false if the name is empty.
212212
bool isSamePackageAs(PackageUnit *other) {
213-
if (!other) return false;
213+
if (!other)
214+
return false;
214215
return !(getName().empty()) && getName() == other->getName();
215216
}
216217
};

include/swift/Option/Options.td

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -548,7 +548,7 @@ def module_abi_name : Separate<["-"], "module-abi-name">,
548548
Flags<[FrontendOption, ModuleInterfaceOption]>,
549549
HelpText<"ABI name to use for the contents of this module">;
550550
def package_name : Separate<["-"], "package-name">,
551-
Flags<[FrontendOption, ModuleInterfaceOptionIgnorablePrivate]>,
551+
Flags<[FrontendOption, ModuleInterfaceOption]>,
552552
HelpText<"Name of the package the module belongs to">;
553553
def export_as : Separate<["-"], "export-as">,
554554
Flags<[FrontendOption, ModuleInterfaceOption]>,

lib/AST/Decl.cpp

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4293,14 +4293,16 @@ static bool checkAccessUsingAccessScopes(const DeclContext *useDC,
42934293
AccessScope accessScope = getAccessScopeForFormalAccess(
42944294
VD, access, useDC,
42954295
/*treatUsableFromInlineAsPublic*/ includeInlineable);
4296-
if (accessScope.getDeclContext() == useDC) return true;
4297-
if (!AccessScope(useDC).isChildOf(accessScope)) return false;
4298-
4296+
if (accessScope.getDeclContext() == useDC)
4297+
return true;
4298+
if (!AccessScope(useDC).isChildOf(accessScope))
4299+
return false;
42994300
// useDC is null only when caller wants to skip non-public type checks.
4300-
if (!useDC) return true;
4301-
4301+
if (!useDC)
4302+
return true;
43024303
// Check SPI access
4303-
if (!VD->isSPI()) return true;
4304+
if (!VD->isSPI())
4305+
return true;
43044306
auto useSF = dyn_cast<SourceFile>(useDC->getModuleScopeContext());
43054307
return !useSF || useSF->isImportedAsSPI(VD) ||
43064308
VD->getDeclContext()->getParentModule() == useDC->getParentModule();

lib/Frontend/ModuleInterfaceSupport.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -92,10 +92,6 @@ static void printToolVersionAndFlagsComment(raw_ostream &out,
9292
}
9393
}
9494
}
95-
if (!M->getPackageName().empty()) {
96-
StringRef pkgName = M->getPackageName().str();
97-
out << " -package-name " << pkgName;
98-
}
9995
out << "\n";
10096

10197
if (!Opts.IgnorableFlags.empty()) {

0 commit comments

Comments
 (0)