swift-symbolgraph-extract: Infer target triple.

Infer the `-target` argument to `swift-synthesize-interface` to be the host
triple when unspecified instead of emitting an error.
This commit is contained in:
Allan Shortlidge
2025-07-28 12:43:21 -07:00
parent 3ffb218e9a
commit e8ced33b81
3 changed files with 11 additions and 4 deletions

View File

@@ -83,8 +83,7 @@ int swift_symbolgraph_extract_main(ArrayRef<const char *> Args,
if (auto *A = ParsedArgs.getLastArg(OPT_target)) {
Target = llvm::Triple(A->getValue());
} else {
Diags.diagnose(SourceLoc(), diag::error_option_required, "-target");
return EXIT_FAILURE;
Target = llvm::Triple(llvm::sys::getDefaultTargetTriple());
}
std::string OutputDir;