File tree Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -177,6 +177,10 @@ def verify_incremental_dependencies :
177
177
Flags<[FrontendOption, HelpHidden]>,
178
178
HelpText<"Enable the dependency verifier for each frontend job">;
179
179
180
+ def disallow_forwarding_driver :
181
+ Flag<["-"], "disallow-use-new-driver">, Flags<[]>,
182
+ HelpText<"Disable using new swift-driver">;
183
+
180
184
def driver_emit_fine_grained_dependency_dot_file_after_every_import :
181
185
Flag<["-"], "driver-emit-fine-grained-dependency-dot-file-after-every-import">,
182
186
InternalDebugOpt,
Original file line number Diff line number Diff line change @@ -164,10 +164,12 @@ static int run_driver(StringRef ExecName,
164
164
if (auto driverNameOp = llvm::sys::Process::GetEnv (" SWIFT_USE_NEW_DRIVER" )) {
165
165
newDriverName = driverNameOp.getValue ();
166
166
}
167
-
167
+ auto disallowForwarding = llvm::find_if (argv, [](const char * arg) {
168
+ return StringRef (arg) == " -disallow-use-new-driver" ;
169
+ }) != argv.end ();
168
170
// Forwarding calls to the swift driver if the C++ driver is invoked as `swift`
169
171
// or `swiftc`, and an environment variable SWIFT_USE_NEW_DRIVER is defined.
170
- if (!newDriverName.empty () &&
172
+ if (!newDriverName.empty () && !disallowForwarding &&
171
173
(ExecName == " swift" || ExecName == " swiftc" )) {
172
174
SmallString<256 > NewDriverPath (llvm::sys::path::parent_path (Path));
173
175
llvm::sys::path::append (NewDriverPath, newDriverName);
You can’t perform that action at this time.
0 commit comments