@@ -1558,6 +1558,7 @@ static bool ParseLangArgs(LangOptions &Opts, ArgList &Args,
1558
1558
1559
1559
static bool ParseTypeCheckerArgs (TypeCheckerOptions &Opts, ArgList &Args,
1560
1560
DiagnosticEngine &Diags,
1561
+ const LangOptions &LangOpts,
1561
1562
const FrontendOptions &FrontendOpts) {
1562
1563
using namespace options ;
1563
1564
@@ -1598,17 +1599,43 @@ static bool ParseTypeCheckerArgs(TypeCheckerOptions &Opts, ArgList &Args,
1598
1599
// Check for SkipFunctionBodies arguments in order from skipping less to
1599
1600
// skipping more.
1600
1601
if (Args.hasArg (
1601
- OPT_experimental_skip_non_inlinable_function_bodies_without_types))
1602
- Opts.SkipFunctionBodies = FunctionBodySkipping::NonInlinableWithoutTypes;
1602
+ OPT_experimental_skip_non_inlinable_function_bodies_without_types)) {
1603
+ if (LangOpts.AllowNonResilientAccess )
1604
+ Diags.diagnose (SourceLoc (), diag::warn_ignore_option_overriden_by,
1605
+ " -experimental-skip-non-inlinable-function-bodies-without-types" ,
1606
+ " -experimental-allow-non-resilient-access" );
1607
+ else
1608
+ Opts.SkipFunctionBodies = FunctionBodySkipping::NonInlinableWithoutTypes;
1609
+ }
1603
1610
1604
1611
// If asked to perform InstallAPI, go ahead and enable non-inlinable function
1605
1612
// body skipping.
1606
- if (Args.hasArg (OPT_experimental_skip_non_inlinable_function_bodies) ||
1607
- Args.hasArg (OPT_tbd_is_installapi))
1608
- Opts.SkipFunctionBodies = FunctionBodySkipping::NonInlinable;
1613
+ if (Args.hasArg (OPT_experimental_skip_non_inlinable_function_bodies)) {
1614
+ if (LangOpts.AllowNonResilientAccess )
1615
+ Diags.diagnose (SourceLoc (), diag::warn_ignore_option_overriden_by,
1616
+ " -experimental-skip-non-inlinable-function-bodies" ,
1617
+ " -experimental-allow-non-resilient-access" );
1618
+ else
1619
+ Opts.SkipFunctionBodies = FunctionBodySkipping::NonInlinable;
1620
+ }
1621
+
1622
+ if (Args.hasArg (OPT_tbd_is_installapi) {
1623
+ if (LangOpts.AllowNonResilientAccess )
1624
+ Diags.diagnose (SourceLoc (), diag::warn_ignore_option_overriden_by,
1625
+ " -experimental-tbd-is-installapi" ,
1626
+ " -experimental-allow-non-resilient-access" );
1627
+ else
1628
+ Opts.SkipFunctionBodies = FunctionBodySkipping::NonInlinable;
1629
+ }
1609
1630
1610
- if (Args.hasArg (OPT_experimental_skip_all_function_bodies))
1611
- Opts.SkipFunctionBodies = FunctionBodySkipping::All;
1631
+ if (Args.hasArg (OPT_experimental_skip_all_function_bodies)) {
1632
+ if (LangOpts.AllowNonResilientAccess )
1633
+ Diags.diagnose (SourceLoc (), diag::warn_ignore_option_overriden_by,
1634
+ " -experimental-skip-all-function-bodies" ,
1635
+ " -experimental-allow-non-resilient-access" );
1636
+ else
1637
+ Opts.SkipFunctionBodies = FunctionBodySkipping::All;
1638
+ }
1612
1639
1613
1640
if (Opts.SkipFunctionBodies != FunctionBodySkipping::None &&
1614
1641
FrontendOpts.ModuleName == SWIFT_ONONE_SUPPORT) {
@@ -1680,6 +1707,14 @@ static bool ParseTypeCheckerArgs(TypeCheckerOptions &Opts, ArgList &Args,
1680
1707
" -enable-library-evolution" );
1681
1708
}
1682
1709
1710
+ if (LangOpts.AllowNonResilientAccess &&
1711
+ Opts.EnableLazyTypecheck ) {
1712
+ Diags.diagnose (SourceLoc (), diag::warn_ignore_option_overriden_by,
1713
+ " -experimental-lazy-typecheck" ,
1714
+ " -experimental-allow-non-resilient-access" );
1715
+ Opts.EnableLazyTypecheck = false ;
1716
+ }
1717
+
1683
1718
// HACK: The driver currently erroneously passes all flags to module interface
1684
1719
// verification jobs. -experimental-skip-non-exportable-decls is not
1685
1720
// appropriate for verification tasks and should be ignored, though.
@@ -3396,7 +3431,7 @@ bool CompilerInvocation::parseArgs(
3396
3431
return true ;
3397
3432
}
3398
3433
3399
- if (ParseTypeCheckerArgs (TypeCheckerOpts, ParsedArgs, Diags, FrontendOpts)) {
3434
+ if (ParseTypeCheckerArgs (TypeCheckerOpts, ParsedArgs, Diags, LangOpts, FrontendOpts)) {
3400
3435
return true ;
3401
3436
}
3402
3437
0 commit comments