swift-synthesize-interface: Infer target triple.

Infer the `-target` argument to `swift-synthesize-interface` to be the host
triple when unspecified instead of emitting an error.

Resolves rdar://156353450.
This commit is contained in:
Allan Shortlidge
2025-07-28 11:44:54 -07:00
parent c447f5893c
commit 3ffb218e9a
3 changed files with 3 additions and 2 deletions

View File

@@ -84,8 +84,7 @@ int swift_synthesize_interface_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 OutputFile;