Skip to content

Commit b0b7166

Browse files
committed
Driver: Pass -disable-upcoming-feature and -disable-experimental-feature to the frontend.
The legacy driver is still used to build the compiler on Windows, so we need it to handle these new flags correctly in order to adopt them in the stdlib.
1 parent 004ef74 commit b0b7166

File tree

2 files changed

+22
-2
lines changed

2 files changed

+22
-2
lines changed

lib/Driver/ToolChains.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -270,8 +270,10 @@ void ToolChain::addCommonFrontendArgs(const OutputInfo &OI,
270270
inputArgs.AddLastArg(arguments, options::OPT_disable_dynamic_actor_isolation);
271271
inputArgs.AddLastArg(arguments, options::OPT_warn_concurrency);
272272
inputArgs.AddLastArg(arguments, options::OPT_strict_concurrency);
273-
inputArgs.AddAllArgs(arguments, options::OPT_enable_experimental_feature);
274-
inputArgs.AddAllArgs(arguments, options::OPT_enable_upcoming_feature);
273+
inputArgs.addAllArgs(arguments, {options::OPT_enable_experimental_feature,
274+
options::OPT_disable_experimental_feature,
275+
options::OPT_enable_upcoming_feature,
276+
options::OPT_disable_upcoming_feature});
275277
inputArgs.AddLastArg(arguments, options::OPT_warn_implicit_overrides);
276278
inputArgs.AddLastArg(arguments, options::OPT_typo_correction_limit);
277279
inputArgs.AddLastArg(arguments, options::OPT_enable_app_extension);

test/Driver/features.swift

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
// RUN: %swiftc_driver -emit-executable -o %t.exe %s \
2+
// RUN: -enable-upcoming-feature MemberImportVisibility \
3+
// RUN: -enable-experimental-feature ParserValidation \
4+
// RUN: -disable-upcoming-feature MemberImportVisibility \
5+
// RUN: -disable-experimental-feature ParserValidation \
6+
// RUN: -disallow-use-new-driver -driver-print-jobs 2>&1 | %FileCheck %s
7+
8+
// The new driver has its own test for this
9+
10+
// REQUIRES: cplusplus_driver
11+
// REQUIRES: swift_feature_ParserValidation
12+
// REQUIRES: swift_feature_MemberImportVisibility
13+
14+
// CHECK: {{.*}}swift{{c|-frontend}}{{(.exe)?"?}} -frontend
15+
// CHECK-SAME: -enable-upcoming-feature MemberImportVisibility
16+
// CHECK-SAME: -enable-experimental-feature ParserValidation
17+
// CHECK-SAME: -disable-upcoming-feature MemberImportVisibility
18+
// CHECK-SAME: -disable-experimental-feature ParserValidation

0 commit comments

Comments
 (0)