[Frontend] Add some paths to the output of -print-target-info.

Add various target-specific and compiler-determined paths to the output
of `-print-target-info`, such as the runtime resource path, SDK path, and
runtime library paths.
This commit is contained in:
Doug Gregor
2019-12-08 21:10:30 -08:00
parent 61c83d2415
commit c92600b38b
3 changed files with 49 additions and 2 deletions

View File

@@ -2126,9 +2126,18 @@ bool Driver::handleImmediateArgs(const ArgList &Args, const ToolChain &TC) {
SmallVector<const char *, 5> commandLine;
commandLine.push_back("-frontend");
commandLine.push_back("-print-target-info");
if (const Arg *TargetArg = Args.getLastArg(options::OPT_target)) {
if (const Arg *targetArg = Args.getLastArg(options::OPT_target)) {
commandLine.push_back("-target");
commandLine.push_back(TargetArg->getValue());
commandLine.push_back(targetArg->getValue());
}
if (const Arg *sdkArg = Args.getLastArg(options::OPT_sdk)) {
commandLine.push_back("-sdk");
commandLine.push_back(sdkArg->getValue());
}
if (const Arg *resourceDirArg = Args.getLastArg(options::OPT_resource_dir)) {
commandLine.push_back("-resource-dir");
commandLine.push_back(resourceDirArg->getValue());
}
std::string executable = getSwiftProgramPath();