mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
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:
@@ -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;
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
// RUN: %target-swift-synthesize-interface -module-name m1 -I %S/Inputs -o - | %FileCheck %s
|
||||
// RUN: %swift-synthesize-interface -module-name m1 -I %S/Inputs -o - | %FileCheck %s
|
||||
|
||||
// CHECK: public struct MyStruct {
|
||||
// CHECK-DAG: public init()
|
||||
|
||||
@@ -755,6 +755,7 @@ config.substitutions.append( ('%swift-path', config.swift) )
|
||||
config.substitutions.append( ('%swift-plugin-server', config.swift_plugin_server) )
|
||||
config.substitutions.append( ('%swift-parse-test', config.swift_parse_test) )
|
||||
config.substitutions.append( ('%swift-scan-test', config.swift_scan_test) )
|
||||
config.substitutions.append( ('%swift-synthesize-interface', config.swift_synthesize_interface) )
|
||||
config.substitutions.append( ('%validate-json', f"{config.python} -m json.tool") )
|
||||
|
||||
config.clang_include_dir = make_path(config.llvm_obj_root, 'include')
|
||||
|
||||
Reference in New Issue
Block a user