mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
This mode is similar to `swift-symbolgraph-extract`; it takes a subset of compiler flags to configure the invocation for module loading, as well as a module name whose contents should be extracted. It does not take any other input files. The output is a single text file specified by `-o` (or `stdout` if not specified). While the most common use case for this would be viewing the synthesized Swift interface for a Clang module, since the implementation simply calls `swift::ide::printModuleInterface` under the hood, it's usable for any module that Swift can import. Thus, it could also be used to view a synthesized textual representation of, say, a compiled `.swiftmodule`. One could imagine that in the future, we might add more flags to `swift-synthesize-interface` to modify various `PrintOptions` used when generating the output, if we think those would be useful.
11 lines
361 B
Swift
11 lines
361 B
Swift
// RUN: %target-swift-synthesize-interface -module-name m1 -I %S/Inputs -o - | %FileCheck %s
|
|
|
|
// CHECK: public struct MyStruct {
|
|
// CHECK-DAG: public init()
|
|
// CHECK-DAG: public init(value: Int32)
|
|
// CHECK-DAG: public var value: Int32
|
|
// CHECK-DAG: }
|
|
// CHECK-DAG: extension MyStruct {
|
|
// CHECK-DAG: public func printValue()
|
|
// CHECK-DAG: }
|