Skip to content

Commit 64a3a25

Browse files
committed
driver: use a non-op front-end argument to indicate new driver is getting used
This could help avoiding emitting remarks. rdar://73710910
1 parent f0d361a commit 64a3a25

File tree

3 files changed

+10
-5
lines changed

3 files changed

+10
-5
lines changed

include/swift/AST/DiagnosticsDriver.def

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -173,8 +173,5 @@ WARNING(warn_drv_darwin_sdk_invalid_settings, none,
173173
"SDK settings were ignored because 'SDKSettings.json' could not be parsed",
174174
())
175175

176-
REMARK(remark_forwarding_to_new_driver, none,
177-
"new Swift driver at '%0' will be used", (StringRef))
178-
179176
#define UNDEFINE_DIAGNOSTIC_MACROS
180177
#include "DefineDiagnosticMacros.h"

include/swift/Option/FrontendOptions.td

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -793,4 +793,7 @@ def disable_ast_verifier : Flag<["-"], "disable-ast-verifier">,
793793
"disabled. NOTE: Can not be used if enable-ast-verifier is used "
794794
"as well">;
795795

796+
def new_driver_path
797+
: Separate<["-"], "new-driver-path">, MetaVarName<"<path>">,
798+
HelpText<"Path of the new driver to be used">;
796799
} // end let Flags = [FrontendOption, NoDriverOption, HelpHidden]

tools/driver/driver.cpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -199,10 +199,15 @@ static int run_driver(StringRef ExecName,
199199
}
200200
subCommandArgs.insert(subCommandArgs.end(), argv.begin() + 1, argv.end());
201201

202+
// Push these non-op frontend arguments so the build log can indicate
203+
// the new driver is used.
204+
subCommandArgs.push_back("-Xfrontend");
205+
subCommandArgs.push_back("-new-driver-path");
206+
subCommandArgs.push_back("-Xfrontend");
207+
subCommandArgs.push_back(NewDriverPath.c_str());
208+
202209
// Execute the subcommand.
203210
subCommandArgs.push_back(nullptr);
204-
Diags.diagnose(SourceLoc(), diag::remark_forwarding_to_new_driver,
205-
NewDriverPath);
206211
ExecuteInPlace(NewDriverPath.c_str(), subCommandArgs.data());
207212

208213
// If we reach here then an error occurred (typically a missing path).

0 commit comments

Comments
 (0)