Skip to content

Instantly share code, notes, and snippets.

@palaniraja
Created January 19, 2023 21:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save palaniraja/b4de1e64e874b68bda9e5236829cd8a6 to your computer and use it in GitHub Desktop.
Save palaniraja/b4de1e64e874b68bda9e5236829cd8a6 to your computer and use it in GitHub Desktop.
Swift frontend usage reference
OVERVIEW: Swift frontend
USAGE: swift-frontend -frontend
MODES:
-compile-module-from-interface
Treat the (single) input as a swiftinterface and produce a module
-dump-ast Parse and type-check input file(s) and dump AST(s)
-dump-interface-hash Parse input file(s) and dump interface token hash(es)
-dump-parse Parse input file(s) and dump AST(s)
-dump-pcm Dump debugging information about a precompiled Clang module
-dump-scope-maps <expanded-or-list-of-line:column>
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-imported-modules Emit a list of the imported modules
-emit-irgen Emit LLVM IR file(s) before LLVM optimizations
-emit-ir Emit LLVM IR file(s) after LLVM optimizations
-emit-localized-strings-only
Emits only localization keys for strings passed to APIs needing localization and then stops compilation.
-emit-object Emit object file(s) (-c)
-emit-pch Emit PCH for imported Objective-C header file
-emit-pcm Emit a precompiled Clang module from a module map
-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)
-emit-supported-features
Emit a JSON file including all supported compiler features
-emit-syntax Parse input file(s) and emit the Syntax tree(s) as JSON
-interpret Immediate mode
-merge-modules Merge the input modules without otherwise processing them
-parse Parse input file(s)
-print-ast Parse and type-check input file(s) and pretty print AST(s)
-repl REPL mode (the default if there is no input file)
-resolve-imports Parse and resolve imports in input file(s)
-scan-dependencies Scan dependencies of the given Swift sources
-typecheck-module-from-interface
Treat the (single) input as a swiftinterface and typecheck it
-typecheck Parse and type-check input file(s)
OPTIONS:
-access-notes-path <value>
Specify YAML file to override attributes on Swift declarations in this module
-api-diff-data-dir <path>
Load platform and version specific API migration data files from <path>. Ignored if -api-diff-data-file is specified.
-api-diff-data-file <path>
API migration data is from <path>
-application-extension Restrict code to those available for App Extensions
-assert-config <value> Specify the assert_configuration replacement. Possible values are Debug, Release, Unchecked, DisableReplacement.
-assume-single-threaded Assume that code will be executed in a single-threaded environment
-autolink-force-load Force ld to link against this module even if no symbols are used
-autolink-library <value>
Add dependent library
-bad-file-descriptor-retry-count <value>
Number of retrying opening a file if previous open returns a bad file descriptor error.
-batch-scan-input-file <path>
Specify a JSON file containing modules to perform batch dependencies scanning
-bridging-header-directory-for-print <path>
Directory for bridging header to be printed in compatibility header
-bypass-batch-mode-checks
Bypass checks for batch-mode errors.
-candidate-module-file <path>
Specify Swift module may be ready to use for an interface
-check-onone-completeness
Print errors if the compile OnoneSupport module is missing symbols
-clang-target <value> Separately set the target we should use for internal Clang instance
-code-complete-call-pattern-heuristics
Use heuristics to guess whether we want call pattern completions
-code-complete-inits-in-postfix-expr
Include initializers when completing a postfix expression
-color-diagnostics Print diagnostics in color
-continue-building-after-errors
Continue building, even after errors are encountered
-coverage-prefix-map <prefix=replacement>
Remap source paths in coverage info
-cross-module-optimization
Perform cross-module optimization
-crosscheck-unqualified-lookup
Compare legacy DeclContext- to ASTScope-based unqualified name lookup (for debugging)
-debug-assert-after-parse
Force an assertion failure after parsing
-debug-assert-immediately
Force an assertion failure immediately
-debug-constraints-attempt <value>
Debug the constraint solver at a given attempt
-debug-constraints-on-line <line>
Debug the constraint solver for expressions on <line>
-debug-constraints Debug the constraint-based type checker
-debug-crash-after-parse
Force a crash after parsing
-debug-crash-immediately
Force a crash immediately
-debug-cycles Print out debug dumps when cycles are detected in evaluation
-debug-diagnostic-names Include diagnostic names when printing
-debug-emit-invalid-swiftinterface-syntax
Write an invalid declaration into swiftinterface files
-debug-forbid-typecheck-prefix <value>
Triggers llvm fatal_error if typechecker tries to typecheck a decl with the provided prefix name
-debug-generic-signatures
Debug generic signatures
-debug-info-format=<value>
Specify the debug info format type to either 'dwarf' or 'codeview'
-debug-info-store-invocation
Emit the compiler invocation in the debug info.
-debug-prefix-map <prefix=replacement>
Remap source paths in debug info
-debug-time-expression-type-checking
Dumps the time it takes to type-check each expression
-debug-time-function-bodies
Dumps the time it takes to type-check each function body
-debugger-support Process swift code as if running in the debugger
-debugger-testing-transform
Instrument the code with calls to an intrinsic that record the expected values of local variables so they can be compared against the results from the debugger.
-define-availability <macro>
Define an availability macro in the format 'macroName : iOS 13.0, macOS 10.15'
-dependency-scan-cache-path <value>
The path to output the dependency scanner's internal state.
-diagnostic-documentation-path <path>
Path to diagnostic documentation resources
-diagnostic-style <style>
The formatting style used when printing diagnostics ('swift' or 'llvm')
-diagnostics-editor-mode
Diagnostics will be used in editor
-disable-access-control Don't respect access control restrictions
-disable-actor-data-race-checks
Disable runtime checks for actor data races
-disable-arc-opts Don't run SIL ARC optimization passes.
-disable-ast-verifier Do not run the AST verifier during compilation. NOTE: This lets the user override the default behavior on whether or not the ASTVerifier is run. The default behavior is to run the verifier when asserts are enabled and not run it when asserts are disabled. NOTE: Can not be used if enable-ast-verifier is used as well
-disable-autolink-framework <value>
Disable autolinking against the provided framework
-disable-autolinking-runtime-compatibility-concurrency
Do not use autolinking for the concurrency runtime compatibility library
-disable-autolinking-runtime-compatibility-dynamic-replacements
Do not use autolinking for the dynamic replacement runtime compatibility library
-disable-autolinking-runtime-compatibility
Do not use autolinking for runtime compatibility libraries
-disable-availability-checking
Disable checking for potentially unavailable APIs
-disable-batch-mode Disable combining frontend jobs into batches
-disable-building-interface
Disallow building binary module from textual interface
-disable-clangimporter-source-import
Disable ClangImporter and forward all requests straight the DWARF importer.
-disable-concrete-type-metadata-mangled-name-accessors
Disable concrete type metadata access by mangled name
-disable-conformance-availability-errors
Diagnose conformance availability violations as warnings
-disable-constraint-solver-performance-hacks
Disable all the hacks in the constraint solver
-disable-copy-propagation
Don't run SIL copy propagation to preserve object lifetime.
-disable-cross-import-overlays
Do not automatically import declared cross-import overlays.
-disable-debugger-shadow-copies
Disable debugger shadow copies of local variables.This option is only useful for testing the compiler.
-disable-deserialization-recovery
Don't attempt to recover from missing xrefs (etc) in swiftmodules
-disable-diagnostic-passes
Don't run diagnostic passes
-disable-fuzzy-forward-scan-trailing-closure-matching
Disable fuzzy forward-scan trailing closure matching
-disable-generic-metadata-prespecialization
Do not statically specialize metadata for generic types at types that are known to be used in source.
-disable-implicit-concurrency-module-import
Disable the implicit import of the _Concurrency module.
-disable-implicit-swift-modules
Disable building Swift modules implicitly by the compiler
-disable-incremental-imports
Disable cross-module incremental build metadata and driver scheduling for Swift modules
-disable-incremental-llvm-codegen
Disable incremental llvm code generation.
-disable-infer-public-sendable
Disable inference of Sendable conformances for public structs and enums
-disable-interface-lock Don't lock interface file when building module
-disable-invalid-ephemeralness-as-error
Diagnose invalid ephemeral to non-ephemeral conversions as warnings
-disable-legacy-type-info
Completely disable legacy type layout
-disable-llvm-optzns Don't run LLVM optimization passes
-disable-llvm-slp-vectorizer
Don't run LLVM SLP vectorizer
-disable-llvm-value-names
Don't add names to local values in LLVM IR
-disable-llvm-verify Don't run the LLVM IR verifier.
-disable-migrator-fixits
Disable the Migrator phase which automatically applies fix-its
-disable-modules-validate-system-headers
Disable validating system headers in the Clang importer
-disable-named-lazy-member-loading
Disable per-name lazy member loading
-disable-new-operator-lookup
Disable the new operator decl and precedencegroup lookup behavior
-disable-nonfrozen-enum-exhaustivity-diagnostics
Allow switches over non-frozen enums without catch-all cases
-disable-nskeyedarchiver-diagnostics
Allow classes with unstable mangled names to adopt NSCoding
-disable-objc-attr-requires-foundation-module
Disable requiring uses of @objc to require importing the Foundation module
-disable-objc-interop Disable Objective-C interop code generation and config directives
-disable-ossa-opts Don't run SIL OSSA optimization passes.
-disable-playground-transform
Disable playground transformation
-disable-previous-implementation-calls-in-dynamic-replacements
Disable calling the previous implementation in dynamic replacements
-disable-reflection-metadata
Disable emission of reflection metadata for nominal types
-disable-reflection-names
Disable emission of names of stored properties and enum cases inreflection metadata
-disable-sil-ownership-verifier
Do not verify ownership invariants during SIL Verification
-disable-sil-partial-apply
Disable use of partial_apply in SIL generation
-disable-sil-perf-optzns
Don't run SIL performance optimization passes
-disable-swift-bridge-attr
Disable using the swift bridge attribute
-disable-swift-specific-llvm-optzns
Don't run Swift specific LLVM optimization passes.
-disable-swift3-objc-inference
Disable Swift 3's @objc inference rules for NSObject-derived classes and 'dynamic' members (emulates Swift 4 behavior)
-disable-target-os-checking
Disable checking the target OS of serialized modules
-disable-testable-attr-requires-testable-module
Disable checking of @testable
-disable-type-layout Disable type layout based lowering
-disable-typo-correction
Disable typo correction
-disable-verify-exclusivity
Diable verification of access markers used to enforce exclusivity.
-dump-api-path <value> The path to output swift interface files for the compiled source files
-dump-clang-diagnostics Dump Clang diagnostics to stderr
-dump-jit <value> Dump JIT contents
-dump-migration-states-dir <path>
Dump the input text, output text, and states for migration to <path>
-dump-usr Dump USR for each declaration reference
-D <value> Marks a conditional compilation flag as true
-embed-bitcode-marker Embed placeholder LLVM IR data as a marker
-embed-bitcode Embed LLVM IR bitcode as data
-embed-tbd-for-module <value>
Embed symbols from the module in the emitted tbd file
-emit-abi-descriptor-path <path>
Output the ABI descriptor of current module to <path>
-emit-dependencies-path <path>
Output basic Make-compatible dependencies file to <path>
-emit-dependencies Emit basic Make-compatible dependencies files
-emit-fine-grained-dependency-sourcefile-dot-files
Emit dot files for every source file.
-emit-fixits-path <path>
Output compiler fixits as source edits to <path>
-emit-ldadd-cfile-path <path>
Generate .c file defining symbols to add back
-emit-loaded-module-trace-path <path>
Emit the loaded module trace JSON to <path>
-emit-loaded-module-trace
Emit a JSON file containing information about what modules were loaded
-emit-localized-strings-path <path>
Emit localization keys to <path>
-emit-localized-strings Emits localization keys for strings passed to APIs needing localization
-emit-migrated-file-path <path>
Emit the migrated source file to <path>
-emit-module-doc-path <path>
Output module documentation file <path>
-emit-module-doc Emit a module documentation file based on documentation comments
-emit-module-interface-path <path>
Output module interface file to <path>
-emit-module-path <path>
Emit an importable module to <path>
-emit-module-source-info-path <path>
Output module source info file to <path>
-emit-module-source-info
Output module source info file
-emit-module-summary-path <path>
Output module summary file to <path>
-emit-module Emit an importable module
-emit-objc-header-path <path>
Emit an Objective-C header file to <path>
-emit-objc-header Emit an Objective-C header file
-emit-private-module-interface-path <path>
Output private module interface file to <path>
-emit-reference-dependencies-path <path>
Output Swift-style dependencies file to <path>
-emit-reference-dependencies
Emit a Swift-style dependencies file
-emit-remap-file-path <path>
Emit the replacement map describing Swift Migrator changes to <path>
-emit-sorted-sil When printing SIL, print out all sil entities sorted by name to ease diffing
-emit-stack-promotion-checks
Emit runtime checks for correct stack promotion of objects.
-emit-symbol-graph-dir <dir>
Emit a symbol graph to directory <dir>
-emit-symbol-graph Emit a symbol graph
-emit-tbd-path <path> Emit the TBD file to <path>
-emit-tbd Emit a TBD file
-emit-verbose-sil Emit locations during SIL emission
-enable-access-control Respect access control restrictions
-enable-actor-data-race-checks
Emit runtime checks for actor data races
-enable-anonymous-context-mangled-names
Enable emission of mangled names in anonymous context descriptors
-enable-ast-verifier Run the AST verifier during compilation. NOTE: This lets the user override the default behavior on whether or not the ASTVerifier is run. The default behavior is to run the verifier when asserts are enabled and not run it when asserts are disabled. NOTE: Can not be used if disable-ast-verifier is used as well
-enable-batch-mode Enable combining frontend jobs into batches
-enable-conformance-availability-errors
Diagnose conformance availability violations as errors
-enable-copy-propagation
Run SIL copy propagation to shorten object lifetime.
-enable-cross-import-overlays
Automatically import declared cross-import overlays.
-enable-cxx-interop Enable C++ interop code generation and config directives
-enable-deserialization-recovery
Attempt to recover from missing xrefs (etc) in swiftmodules
-enable-dynamic-replacement-chaining
Enable chaining of dynamic replacements
-enable-experimental-additive-arithmetic-derivation
Enable experimental 'AdditiveArithmetic' derived conformances
-enable-experimental-async-handler
Enable experimental @asyncHandler feature
-enable-experimental-concise-pound-file
Enable experimental concise '#file' identifier
-enable-experimental-concurrency
Enable experimental concurrency model
-enable-experimental-flow-sensitive-concurrent-captures
Enable flow-sensitive concurrent captures
-enable-experimental-forward-mode-differentiation
Enable experimental forward mode differentiation
-enable-experimental-static-assert
Enable experimental #assert
-enable-fuzzy-forward-scan-trailing-closure-matching
Enable fuzzy forward-scan trailing closure matching
-enable-implicit-dynamic
Add 'dynamic' to all declarations
-enable-incremental-imports
Enable cross-module incremental build metadata and driver scheduling for Swift modules
-enable-infer-public-sendable
Enable inference of Sendable conformances for public structs and enums
-enable-invalid-ephemeralness-as-error
Diagnose invalid ephemeral to non-ephemeral conversions as errors
-enable-library-evolution
Build the module to allow binary-compatible library evolution
-enable-llvm-value-names
Add names to local values in LLVM IR
-enable-new-operator-lookup
Enable the new operator decl and precedencegroup lookup behavior
-enable-nonfrozen-enum-exhaustivity-diagnostics
Diagnose switches over non-frozen enums without catch-all cases
-enable-nskeyedarchiver-diagnostics
Diagnose classes with unstable mangled names adopting NSCoding
-enable-objc-attr-requires-foundation-module
Enable requiring uses of @objc to require importing the Foundation module
-enable-objc-interop Enable Objective-C interop code generation and config directives
-enable-operator-designated-types
Enable operator designated types
-enable-ossa-modules Always serialize SIL in ossa form. If this flag is not passed in, when optimizing ownership will be lowered before serializing SIL
-enable-private-imports Allows this module's internal and private API to be accessed
-enable-resilience Deprecated, use -enable-library-evolution instead
-enable-sil-opaque-values
Enable SIL Opaque Values
-enable-source-import Enable importing of Swift source files
-enable-spec-devirt Enable speculative devirtualization pass.
-enable-swift3-objc-inference
Enable Swift 3's @objc inference rules for NSObject-derived classes and 'dynamic' members (emulates Swift 3 behavior)
-enable-swiftcall Enable the use of LLVM swiftcall support
-enable-target-os-checking
Enable checking the target OS of serialized modules
-enable-testable-attr-requires-testable-module
Enable checking of @testable
-enable-testing Allows this module's internal API to be accessed for testing
-enable-throw-without-try
Allow throwing function calls without 'try'
-enable-type-layout Enable type layout based lowering
-enable-verify-exclusivity
Enable verification of access markers used to enforce exclusivity.
-enable-volatile-modules
Load Swift modules in memory
-enforce-exclusivity=<enforcement>
Enforce law of exclusivity
-entry-point-function-name <string>
Name of the entry point function
-experimental-allow-module-with-compiler-errors
Attempt to output .swiftmodule, regardless of compilation errors
-experimental-one-way-closure-params
Enable experimental support for one-way closure parameters
-experimental-print-full-convention
When emitting a module interface or SIL, emit additional @convention arguments, regardless of whether they were written in the source. Also requires -use-clang-function-types to be enabled.
-experimental-skip-all-function-bodies
Skip type-checking function bodies and all SIL generation
-experimental-skip-non-inlinable-function-bodies-without-types
Skip work on non-inlinable function bodies that do not declare nested types
-experimental-skip-non-inlinable-function-bodies
Skip type-checking and SIL generation for non-inlinable function bodies
-experimental-spi-imports
Enable experimental support for SPI imports
-explicit-swift-module-map-file <path>
Specify a JSON file containing information of explict Swift modules
-external-pass-pipeline-filename <pass_pipeline_file>
Use the pass pipeline defined by <pass_pipeline_file>
-filelist <value> Specify source inputs in a file rather than on the command line
-fixit-all Apply all fixits from diagnostics without any filtering
-force-public-linkage Force public linkage for private symbols. Used by LLDB.
-framework <value> Specifies a framework which should be linked against
-frontend-parseable-output
Emit textual output in a parseable format
-Fsystem <value> Add directory to system framework search path
-function-sections Emit functions to separate sections.
-F <value> Add directory to framework search path
-gdwarf-types Emit full DWARF type info.
-gline-tables-only Emit minimal debug info for backtraces only
-gnone Don't emit debug info
-group-info-path <value>
The path to collect the group information of the compiled module
-gsil Write the SIL into a file and generate debug-info to debug on SIL level.
-g Emit debug info. This is the preferred setting for debugging with LLDB.
-help-hidden Display available options, including hidden options
-help Display available options
-ignore-always-inline Ignore @inline(__always) attributes.
-ignore-module-source-info
Avoid getting source location from .swiftsourceinfo files
-import-cf-types Recognize and import CF types as class types
-import-module <value> Implicitly import the specified module
-import-objc-header <value>
Implicitly imports an Objective-C header file
-import-prescan When performing a dependency scan, only dentify all imports of the main Swift module sources
-import-underlying-module
Implicitly imports the Objective-C half of a module
-include-spi-symbols Add symbols with SPI information to the symbol graph
-index-ignore-stdlib Avoid emitting index data for the standard library.
-index-store-path <path>
Store indexing data to <path>
-index-system-modules Emit index data for imported serialized swift system modules
-index-unit-output-path-filelist <value>
Specify index unit output paths in a file rather than on the command line
-index-unit-output-path <path>
Use <path> as the output path in the produced index data.
-irgen-always-use-indirect-relative-references
Always emit indirectable relative references as indirect
-I <value> Add directory to the import search path
-library-level <level> Library distribution level 'api', 'spi' or 'other' (the default)
-load-dependency-scan-cache
After performing a dependency scan, serialize the scanner's internal state.
-locale <locale-code> Choose a language for diagnostic messages
-localization-path <path>
Path to localized diagnostic messages directory
-lto=<value> Specify the LTO type to either 'llvm-thin' or 'llvm-full'
-L <value> Add directory to library link search path
-l<value> Specifies a library which should be linked against
-migrate-keep-objc-visibility
When migrating, add '@objc' to declarations that would've been implicitly visible in Swift 3
-migrator-update-sdk Does nothing. Temporary compatibility flag for Xcode.
-migrator-update-swift Does nothing. Temporary compatibility flag for Xcode.
-module-abi-name <value>
ABI name to use for the contents of this module
-module-cache-path <value>
Specifies the Clang module cache path
-module-interface-preserve-types-as-written
When emitting a module interface, preserve types as they were written in the source
-module-link-name <value>
Library to link against when using this module
-module-name <value> Name of the module to build
-new-driver-path <path> Path of the new driver to be used
-no-clang-module-breadcrumbs
Don't emit DWARF skeleton CUs for imported Clang modules. Use this when building a redistributable static archive.
-no-color-diagnostics Do not print diagnostics in color
-no-serialize-debugging-options
Never serialize options for debugging (default: only for apps)
-no-stack-check disable stack checking
-no-warnings-as-errors Don't treat warnings as errors
-no-whole-module-optimization
Disable optimizing input files together instead of individually
-nostdimport Don't search the standard library import path for modules
-num-threads <n> Enable multi-threading and specify number of threads
-only-use-extra-clang-opts
Options passed via -Xcc are sufficient for Clang configuration
-Onone Compile without any optimization
-Oplayground Compile with optimizations appropriate for a playground
-Osize Compile with optimizations and target small code size
-Ounchecked Compile with optimizations and remove runtime safety checks
-output-filelist <value>
Specify outputs in a file rather than on the command line
-O Compile with optimizations
-o <file> Write output to <file>
-package-description-version <vers>
The version number to be applied on the input for the PackageDescription availability kind
-parse-as-library Parse the input file(s) as libraries, not scripts
-parse-sil Parse the input file as SIL code, not Swift source
-parse-stdlib Parse the input file(s) as the Swift standard library
-pc-macro Apply the 'program counter simulation' macro
-pch-disable-validation Disable validating the persistent PCH
-pch-output-dir <value> Directory to persist automatically created precompiled bridging headers
-placeholder-dependency-module-map-file <path>
Specify a JSON file containing information of external Swift module dependencies
-playground-high-performance
Omit instrumentation that has a high runtime performance impact
-playground Apply the playground semantics and transformation
-prebuilt-module-cache-path <value>
Directory of prebuilt modules for loading module interfaces
-prespecialize-generic-metadata
Statically specialize metadata for generic types at types that are known to be used in source.
-previous-module-installname-map-file <path>
Path to a Json file indicating module name to installname map for @_originallyDefinedIn
-primary-filelist <value>
Specify primary inputs in a file rather than on the command line
-primary-file <value> Produce output for this file, not the whole module
-print-clang-stats Print Clang importer statistics
-print-educational-notes
Include educational notes in printed diagnostic output, if available
-print-inst-counts Before IRGen, count all the various SIL instructions. Must be used in conjunction with -print-stats.
-print-llvm-inline-tree Print the LLVM inline tree.
-print-stats Print various statistics
-print-target-info Print target information for the given target <triple>, such as x86_64-apple-macos10.9
-profile-coverage-mapping
Generate coverage data for use with profiled execution counts
-profile-generate Generate instrumented code to collect execution counts
-profile-stats-entities Profile changes to stats in -stats-output-dir, subdivided by source entity
-profile-stats-events Profile changes to stats in -stats-output-dir
-profile-use=<profdata> Supply a profdata file to enable profile-guided optimization
-Rcross-import Emit a remark if a cross-import of a module is triggered.
-Rdependency-scan-cache Emit remarks indicating use of the serialized module dependency scanning cache.
-read-legacy-type-info-path=<value>
Read legacy type layout from the given path instead of default path
-remove-runtime-asserts Remove runtime safety checks.
-report-errors-to-debugger
Deprecated, will be removed in future versions.
-require-explicit-availability-target <target>
Suggest fix-its adding @available(<target>, *) to public declarations without availability
-require-explicit-availability
Require explicit availability on public declarations
-resource-dir </usr/lib/swift>
The directory that holds the compiler resource files
-Rmodule-interface-rebuild
Emits a remark if an imported module needs to be re-compiled from its module interface
-Rmodule-loading Emit a remark and file path of each loaded module
-Rpass-missed=<value> Report missed transformations by optimization passes whose name matches the given POSIX regular expression
-Rpass=<value> Report performed transformations by optimization passes whose name matches the given POSIX regular expression
-runtime-compatibility-version <value>
Link compatibility library for Swift runtime version, or 'none'
-sanitize-address-use-odr-indicator
When using AddressSanitizer enable ODR indicator globals to avoid false ODR violation reports in partially sanitized programs at the cost of an increase in binary size
-sanitize-coverage=<type>
Specify the type of coverage instrumentation for Sanitizers and additional options separated by commas
-sanitize-recover=<check>
Specify which sanitizer runtime checks (see -sanitize=) will generate instrumentation that allows error recovery. Listed checks should be comma separated. Default behavior is to not allow error recovery.
-sanitize=<check> Turn on runtime checks for erroneous behavior.
-save-optimization-record-passes <regex>
Only include passes which match a specified regular expression inthe generated optimization record (by default, include all passes)
-save-optimization-record-path <value>
Specify the file name of any generated optimization record
-save-optimization-record=<format>
Generate an optimization record file in a specific format (default: YAML)
-save-optimization-record
Generate a YAML optimization record file
-sdk <sdk> Compile against <sdk>
-serialize-debugging-options
Always serialize options for debugging (default: only for apps)
-serialize-dependency-scan-cache
After performing a dependency scan, serialize the scanner's internal state.
-serialize-diagnostics-path <path>
Emit a serialized diagnostics file to <path>
-serialize-diagnostics Serialize diagnostics in a binary format
-show-diagnostics-after-fatal
Keep emitting subsequent diagnostics after a fatal error
-sil-debug-serialization
Do not eliminate functions in Mandatory Inlining/SILCombine dead functions. (for debugging only)
-sil-inline-caller-benefit-reduction-factor <2>
Controls the aggressiveness of performance inlining in -Osize mode by reducing the base benefits of a caller (lower value permits more inlining!)
-sil-inline-threshold <50>
Controls the aggressiveness of performance inlining
-sil-stop-optzns-before-lowering-ownership
Stop optimizing at SIL time before we lower ownership from SIL. Intended only for SIL ossa tests
-sil-unroll-threshold <250>
Controls the aggressiveness of loop unrolling
-sil-verify-all Verify SIL after each transform
-sil-verify-none Completely disable SIL verification
-skip-inherited-docs Skip emitting doc comments for members inherited through classes or default implementations
-solver-disable-shrink Disable the shrink phase of expression type checking
-solver-memory-threshold <value>
Set the upper bound for memory consumption, in bytes, by the constraint solver
-solver-shrink-unsolved-threshold <value>
Set The upper bound to number of sub-expressions unsolved before termination of the shrink phrase
-stack-check enable stack checking
-stack-promotion-limit <value>
Limit the size of stack promoted objects to the provided number of bytes.
-static Make this module statically linkable and make the output of -emit-library a static library.
-stats-output-dir <value>
Directory to write unified compilation-statistics files to
-supplementary-output-file-map <value>
Specify supplementary outputs in a file rather than on the command line
-suppress-static-exclusivity-swap
Suppress static violations of exclusive access with swap()
-suppress-warnings Suppress all warnings
-swift-async-frame-pointer=<value>
One of 'auto', 'always' or 'never'
-swift-isa-ptrauth-mode <mode>
Mode for staging isa/super signing. Supported modes are LegacyAndStrip, NewAndStrip and NewAndAuth.
-swift-module-file <path>
Specify Swift module explicitly built from textual interface
-swift-ptrauth-mode <mode>
Mode for staging pointer authentication. Supported modes are LegacyAndStrip, NewAndStrip and NewAndAuth.
-swift-version <vers> Interpret input according to a specific Swift language version number
-target-cpu <value> Generate code for a particular CPU variant
-target-sdk-version <value>
The version of target SDK used for compilation
-target-variant-sdk-version <value>
The version of target variant SDK used for compilation
-target-variant <value> Generate 'zippered' code for macCatalyst that can run on the specified variant target triple in addition to the main -target triple
-target <triple> Generate code for the given target <triple>, such as x86_64-apple-macos10.9
-tbd-compatibility-version <version>
The compatibility_version to use in an emitted TBD file
-tbd-current-version <version>
The current_version to use in an emitted TBD file
-tbd-install_name <path>
The install_name to use in an emitted TBD file
-tbd-is-installapi If the TBD file should indicate it's being generated during InstallAPI
-test-dependency-scan-cache-serialization
After performing a dependency scan, serialize and then deserialize the scanner's internal state.
-testable-import-module <value>
Implicitly import the specified module with @testable
-tools-directory <directory>
Look for external executables (ld, clang, binutils) in <directory>
-trace-stats-events Trace changes to stats in -stats-output-dir
-track-system-dependencies
Track system dependencies while emitting Make-style dependencies
-type-info-dump-filter=<value>
One of 'all', 'resilient' or 'fragile'
-typo-correction-limit <n>
Limit the number of times the compiler will attempt typo correction to <n>
-update-code Update Swift code
-use-clang-function-types
Use stored Clang function types for computing canonical types.
-use-jit Register Objective-C classes as if the JIT were in use
-use-malloc Allocate internal data structures using malloc (for memory debugging)
-use-static-resource-dir
Use resources in the static resource directory
-validate-tbd-against-ir=<level>
Compare the symbols in the IR against the TBD file that would be generated.
-value-recursion-threshold <value>
Set the maximum depth for direct recursion in value types
-verify-additional-file <value>
Verify diagnostics in this file in addition to source files
-verify-all-substitution-maps
Verify all SubstitutionMaps on construction
-verify-apply-fixes Like -verify, but updates the original source file
-verify-generic-signatures <module-name>
Verify the generic signatures in the given module
-verify-ignore-unknown Allow diagnostics for '<unknown>' location in verify mode
-verify-incremental-dependencies
Enable the dependency verifier for each frontend job
-verify-syntax-tree Verify that no unknown nodes exist in the libSyntax tree
-verify-type-layout <type>
Verify compile-time and runtime type layout information for type
-verify Verify diagnostics against expected-{error|warning|note} annotations
-version Print version information and exit
-vfsoverlay <value> Add directory to VFS overlay file
-warn-concurrency Warn about code that is unsafe according to the Swift Concurrency model and will become ill-formed in a future language version
-warn-implicit-overrides
Warn about implicit overrides of protocol members
-warn-long-expression-type-checking <n>
Warns when type-checking a function takes longer than <n> ms
-warn-long-function-bodies <n>
Warns when type-checking a function takes longer than <n> ms
-warn-on-editor-placeholder
Downgrade the editor placeholder error to a warning
-warn-on-potentially-unavailable-enum-case
Downgrade potential unavailability of enum case to a warning
-warn-swift3-objc-inference-complete
Warn about deprecated @objc inference in Swift 3 for every declaration that will no longer be inferred as @objc in Swift 4
-warn-swift3-objc-inference-minimal
Warn about deprecated @objc inference in Swift 3 based on direct uses of the Objective-C entrypoint
-warnings-as-errors Treat warnings as errors
-whole-module-optimization
Optimize input files together instead of individually
-Xcc <arg> Pass <arg> to the C/C++/Objective-C compiler
-Xllvm <arg> Pass <arg> to LLVM.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment