Skip to content

Commit 9b89c0c

Browse files
committed
[NFC] Consolidate SIL LangOpts Parsing
1 parent a8766cc commit 9b89c0c

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

lib/Frontend/CompilerInvocation.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -387,9 +387,6 @@ static bool ParseLangArgs(LangOptions &Opts, ArgList &Args,
387387
Opts.DisableAvailabilityChecking |=
388388
Args.hasArg(OPT_disable_availability_checking);
389389

390-
if (FrontendOpts.InputKind == InputFileKind::SIL)
391-
Opts.DisableAvailabilityChecking = true;
392-
393390
if (auto A = Args.getLastArg(OPT_enable_access_control,
394391
OPT_disable_access_control)) {
395392
Opts.EnableAccessControl
@@ -675,8 +672,10 @@ static bool ParseLangArgs(LangOptions &Opts, ArgList &Args,
675672
}
676673

677674
// If we're parsing SIL, access control doesn't make sense to enforce.
678-
if (FrontendOpts.InputKind == InputFileKind::SIL) {
675+
if (Args.hasArg(OPT_parse_sil) ||
676+
FrontendOpts.InputsAndOutputs.shouldTreatAsSIL()) {
679677
Opts.EnableAccessControl = false;
678+
Opts.DisableAvailabilityChecking = true;
680679
}
681680

682681
return HadError || UnsupportedOS || UnsupportedArch;

0 commit comments

Comments
 (0)