“-c”选项对 Swift 编译器 (swiftc) 有什么作用?
What does "-c" option do for Swift compiler (swiftc)?
我注意到 swiftc
中有“-c”选项,这个选项有什么作用?
swiftc ... -c ....
有官方文档吗?我无法从 man
、--help
或网上找到它:(
-c
是 -emit-object
:
$ swiftc --help
OVERVIEW: Swift compiler
USAGE: swiftc [options]
MODES:
-dump-ast Parse and type-check input file(s) and dump AST(s)
-dump-parse Parse input file(s) and dump AST(s)
-dump-scope-maps
Parse and type-check input file(s) and dump the scope map(s)
-dump-type-info Output YAML dump of fixed-size types from all imported modules
-dump-type-refinement-contexts
Type-check input file(s) and dump type refinement contexts(s)
-emit-assembly Emit assembly file(s) (-S)
-emit-bc Emit LLVM BC file(s)
-emit-executable Emit a linked executable
-emit-imported-modules Emit a list of the imported modules
-emit-ir Emit LLVM IR file(s)
-emit-library Emit a linked library
-emit-object Emit object file(s) (-c)
-emit-sibgen Emit serialized AST + raw SIL file(s)
-emit-sib Emit serialized AST + canonical SIL file(s)
-emit-silgen Emit raw SIL file(s)
-emit-sil Emit canonical SIL file(s)
-index-file Produce index data for a source file
-parse Parse input file(s)
-print-ast Parse and type-check input file(s) and pretty print AST(s)
-resolve-imports Parse and resolve imports in input file(s)
-typecheck Parse and type-check input file(s)
我注意到 swiftc
中有“-c”选项,这个选项有什么作用?
swiftc ... -c ....
有官方文档吗?我无法从 man
、--help
或网上找到它:(
-c
是 -emit-object
:
$ swiftc --help OVERVIEW: Swift compiler USAGE: swiftc [options] MODES: -dump-ast Parse and type-check input file(s) and dump AST(s) -dump-parse Parse input file(s) and dump AST(s) -dump-scope-maps Parse and type-check input file(s) and dump the scope map(s) -dump-type-info Output YAML dump of fixed-size types from all imported modules -dump-type-refinement-contexts Type-check input file(s) and dump type refinement contexts(s) -emit-assembly Emit assembly file(s) (-S) -emit-bc Emit LLVM BC file(s) -emit-executable Emit a linked executable -emit-imported-modules Emit a list of the imported modules -emit-ir Emit LLVM IR file(s) -emit-library Emit a linked library -emit-object Emit object file(s) (-c) -emit-sibgen Emit serialized AST + raw SIL file(s) -emit-sib Emit serialized AST + canonical SIL file(s) -emit-silgen Emit raw SIL file(s) -emit-sil Emit canonical SIL file(s) -index-file Produce index data for a source file -parse Parse input file(s) -print-ast Parse and type-check input file(s) and pretty print AST(s) -resolve-imports Parse and resolve imports in input file(s) -typecheck Parse and type-check input file(s)