Skip to content

Commit 2a46f5f

Browse files
authored
Merge pull request swiftlang#36452 from artemcm/NewDriverDummyOptFirst
[Driver] Emit the `-new-driver-path` option before actual compiler arguments
2 parents fece895 + d4fae29 commit 2a46f5f

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

tools/driver/driver.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -221,15 +221,16 @@ static int run_driver(StringRef ExecName,
221221
assert(ExecName == "swift");
222222
subCommandArgs.push_back("--driver-mode=swift");
223223
}
224-
subCommandArgs.insert(subCommandArgs.end(), argv.begin() + 1, argv.end());
225-
226224
// Push these non-op frontend arguments so the build log can indicate
227225
// the new driver is used.
228226
subCommandArgs.push_back("-Xfrontend");
229227
subCommandArgs.push_back("-new-driver-path");
230228
subCommandArgs.push_back("-Xfrontend");
231229
subCommandArgs.push_back(NewDriverPath.c_str());
232230

231+
// Push on the source program arguments
232+
subCommandArgs.insert(subCommandArgs.end(), argv.begin() + 1, argv.end());
233+
233234
// Execute the subcommand.
234235
subCommandArgs.push_back(nullptr);
235236
ExecuteInPlace(NewDriverPath.c_str(), subCommandArgs.data());

0 commit comments

Comments
 (0)