Skip to content

Commit 45126a8

Browse files
committed
Formatting
1 parent 951e2ab commit 45126a8

File tree

2 files changed

+24
-20
lines changed

2 files changed

+24
-20
lines changed

lib/Frontend/CompilerInvocation.cpp

Lines changed: 22 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -681,8 +681,9 @@ static bool ParseLangArgs(LangOptions &Opts, ArgList &Args,
681681
Opts.EnablePackageInterfaceLoad = Args.hasArg(OPT_experimental_package_interface_load) ||
682682
::getenv("SWIFT_ENABLE_PACKAGE_INTERFACE_LOAD");
683683

684-
Opts.EnableBypassResilienceInPackage = Args.hasArg(OPT_experimental_package_bypass_resilience) ||
685-
Opts.hasFeature(Feature::ClientBypassResilientAccessInPackage);
684+
Opts.EnableBypassResilienceInPackage =
685+
Args.hasArg(OPT_experimental_package_bypass_resilience) ||
686+
Opts.hasFeature(Feature::ClientBypassResilientAccessInPackage);
686687

687688
Opts.DisableAvailabilityChecking |=
688689
Args.hasArg(OPT_disable_availability_checking);
@@ -1115,20 +1116,22 @@ static bool ParseLangArgs(LangOptions &Opts, ArgList &Args,
11151116

11161117
if (Args.hasArg(OPT_enable_library_evolution)) {
11171118
Opts.SkipNonExportableDecls |=
1118-
Args.hasArg(OPT_experimental_skip_non_exportable_decls);
1119+
Args.hasArg(OPT_experimental_skip_non_exportable_decls);
11191120

11201121
Opts.SkipNonExportableDecls |=
1121-
Args.hasArg(OPT_experimental_skip_non_inlinable_function_bodies) &&
1122-
Args.hasArg(OPT_experimental_skip_non_inlinable_function_bodies_is_lazy);
1122+
Args.hasArg(OPT_experimental_skip_non_inlinable_function_bodies) &&
1123+
Args.hasArg(
1124+
OPT_experimental_skip_non_inlinable_function_bodies_is_lazy);
11231125
} else {
11241126
if (Args.hasArg(OPT_experimental_skip_non_exportable_decls))
11251127
Diags.diagnose(SourceLoc(), diag::ignoring_option_requires_option,
11261128
"-experimental-skip-non-exportable-decls",
11271129
"-enable-library-evolution");
11281130
}
11291131

1130-
Opts.AllowNonResilientAccess = Args.hasArg(OPT_experimental_allow_non_resilient_access) ||
1131-
Opts.hasFeature(Feature::AllowNonResilientAccessInPackage);
1132+
Opts.AllowNonResilientAccess =
1133+
Args.hasArg(OPT_experimental_allow_non_resilient_access) ||
1134+
Opts.hasFeature(Feature::AllowNonResilientAccessInPackage);
11321135
if (Opts.AllowNonResilientAccess) {
11331136
// Override the option to skip non-exportable decls.
11341137
if (Opts.SkipNonExportableDecls) {
@@ -1139,11 +1142,14 @@ static bool ParseLangArgs(LangOptions &Opts, ArgList &Args,
11391142
}
11401143
// If built from interface, non-resilient access should not be allowed.
11411144
if (Opts.AllowNonResilientAccess &&
1142-
(FrontendOpts.RequestedAction == FrontendOptions::ActionType::CompileModuleFromInterface ||
1143-
FrontendOpts.RequestedAction == FrontendOptions::ActionType::TypecheckModuleFromInterface)) {
1144-
Diags.diagnose(SourceLoc(), diag::warn_ignore_option_overriden_by,
1145-
"-experimental-allow-non-resilient-access",
1146-
"-compile-module-from-interface or -typecheck-module-from-interface");
1145+
(FrontendOpts.RequestedAction ==
1146+
FrontendOptions::ActionType::CompileModuleFromInterface ||
1147+
FrontendOpts.RequestedAction ==
1148+
FrontendOptions::ActionType::TypecheckModuleFromInterface)) {
1149+
Diags.diagnose(
1150+
SourceLoc(), diag::warn_ignore_option_overriden_by,
1151+
"-experimental-allow-non-resilient-access",
1152+
"-compile-module-from-interface or -typecheck-module-from-interface");
11471153
Opts.AllowNonResilientAccess = false;
11481154
}
11491155
}
@@ -2140,11 +2146,9 @@ void parseExclusivityEnforcementOptions(const llvm::opt::Arg *A,
21402146
}
21412147

21422148
static bool ParseSILArgs(SILOptions &Opts, ArgList &Args,
2143-
IRGenOptions &IRGenOpts,
2144-
const FrontendOptions &FEOpts,
2149+
IRGenOptions &IRGenOpts, const FrontendOptions &FEOpts,
21452150
const TypeCheckerOptions &TCOpts,
2146-
DiagnosticEngine &Diags,
2147-
LangOptions &LangOpts,
2151+
DiagnosticEngine &Diags, LangOptions &LangOpts,
21482152
ClangImporterOptions &ClangOpts) {
21492153
using namespace options;
21502154

@@ -2484,7 +2488,7 @@ static bool ParseSILArgs(SILOptions &Opts, ArgList &Args,
24842488
if (const Arg *A = Args.getLastArg(options::OPT_sanitize_EQ)) {
24852489
Opts.Sanitizers = parseSanitizerArgValues(
24862490
Args, A, LangOpts.Target, Diags,
2487-
/* sanitizerRuntimeLibExists= */[](StringRef libName, bool shared) {
2491+
/* sanitizerRuntimeLibExists= */ [](StringRef libName, bool shared) {
24882492

24892493
// The driver has checked the existence of the library
24902494
// already.
@@ -3332,8 +3336,7 @@ bool CompilerInvocation::parseArgs(
33323336
}
33333337

33343338
if (ParseSILArgs(SILOpts, ParsedArgs, IRGenOpts, FrontendOpts,
3335-
TypeCheckerOpts, Diags,
3336-
LangOpts, ClangImporterOpts)) {
3339+
TypeCheckerOpts, Diags, LangOpts, ClangImporterOpts)) {
33373340
return true;
33383341
}
33393342

lib/Frontend/Frontend.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,8 @@ SerializationOptions CompilerInvocation::computeSerializationOptions(
249249

250250
serializationOpts.IsOSSA = getSILOptions().EnableOSSAModules;
251251

252-
serializationOpts.SkipNonExportableDecls = opts.SkipNonExportableDecls;
252+
serializationOpts.SkipNonExportableDecls =
253+
getLangOptions().SkipNonExportableDecls;
253254

254255
serializationOpts.ExplicitModuleBuild = FrontendOpts.DisableImplicitModules;
255256

0 commit comments

Comments
 (0)