about summary refs log tree commit diff
path: root/src/doc/rustc
diff options
context:
space:
mode:
authorNicholas Nethercote <nnethercote@mozilla.com>2020-04-21 10:06:13 +1000
committerNicholas Nethercote <nnethercote@mozilla.com>2020-04-22 22:44:37 +1000
commit4348f31e3bb0ee20825fd304d1638db53201750f (patch)
treec7218efa4b68e6ec41972fb72a3c9402253c5bd6 /src/doc/rustc
parent4bfd62acb12a5e628d28950f9f94c3499216f10c (diff)
downloadrust-4348f31e3bb0ee20825fd304d1638db53201750f.tar.gz
rust-4348f31e3bb0ee20825fd304d1638db53201750f.zip
Alphabetize the `-C` and `-Z` options.
In the code, test, and docs, because it makes it much easier to find
things.

Other than adding the comments about alphabetical order, this commit
only moves things around.
Diffstat (limited to 'src/doc/rustc')
-rw-r--r--src/doc/rustc/src/codegen-options/index.md430
1 files changed, 215 insertions, 215 deletions
diff --git a/src/doc/rustc/src/codegen-options/index.md b/src/doc/rustc/src/codegen-options/index.md
index eb7e34ad9ed..a503679f19b 100644
--- a/src/doc/rustc/src/codegen-options/index.md
+++ b/src/doc/rustc/src/codegen-options/index.md
@@ -7,12 +7,100 @@ a version of this list for your exact compiler by running `rustc -C help`.
 
 This option is deprecated and does nothing.
 
-## linker
+## code-model
 
-This flag controls which linker `rustc` invokes to link your code. It takes a
-path to the linker executable. If this flag is not specified, the linker will
-be inferred based on the target. See also the [linker-flavor](#linker-flavor)
-flag for another way to specify the linker.
+This option lets you choose which code model to use.
+
+To find the valid options for this flag, run `rustc --print code-models`.
+
+## codegen-units
+
+This flag controls how many code generation units the crate is split into. It
+takes an integer greater than 0.
+
+When a crate is split into multiple codegen units, LLVM is able to process
+them in parallel. Increasing parallelism may speed up compile times, but may
+also produce slower code. Setting this to 1 may improve the performance of
+generated code, but may be slower to compile.
+
+The default value, if not specified, is 16 for non-incremental builds. For
+incremental builds the default is 256 which allows caching to be more granular.
+
+## debug-assertions
+
+This flag lets you turn `cfg(debug_assertions)` [conditional
+compilation](../../reference/conditional-compilation.md#debug_assertions) on
+or off. It takes one of the following values:
+
+* `y`, `yes`, `on`, or no value: enable debug-assertions.
+* `n`, `no`, or `off`: disable debug-assertions.
+
+If not specified, debug assertions are automatically enabled only if the
+[opt-level](#opt-level) is 0.
+
+## debuginfo
+
+This flag controls the generation of debug information. It takes one of the
+following values:
+
+* `0`: no debug info at all (the default).
+* `1`: line tables only.
+* `2`: full debug info.
+
+Note: The [`-g` flag][option-g-debug] is an alias for `-C debuginfo=2`.
+
+## default-linker-libraries
+
+This flag controls whether or not the linker includes its default libraries.
+It takes one of the following values:
+
+* `y`, `yes`, `on`, or no value: include default libraries (the default).
+* `n`, `no`, or `off`: exclude default libraries.
+
+For example, for gcc flavor linkers, this issues the `-nodefaultlibs` flag to
+the linker.
+
+## extra-filename
+
+This option allows you to put extra data in each output filename. It takes a
+string to add as a suffix to the filename. See the [`--emit`
+flag][option-emit] for more information.
+
+## force-frame-pointers
+
+This flag forces the use of frame pointers. It takes one of the following
+values:
+
+* `y`, `yes`, `on`, or no value: force-enable frame pointers.
+* `n`, `no`, or `off`: do not force-enable frame pointers. This does
+  not necessarily mean frame pointers will be removed.
+
+The default behaviour, if frame pointers are not force-enabled, depends on the
+target.
+
+## incremental
+
+This flag allows you to enable incremental compilation, which allows `rustc`
+to save information after compiling a crate to be reused when recompiling the
+crate, improving re-compile times. This takes a path to a directory where
+incremental files will be stored.
+
+## inline-threshold
+
+This option lets you set the default threshold for inlining a function. It
+takes an unsigned integer as a value. Inlining is based on a cost model, where
+a higher threshold will allow more inlining.
+
+The default depends on the [opt-level](#opt-level):
+
+| opt-level | Threshold |
+|-----------|-----------|
+| 0         | N/A, only inlines always-inline functions |
+| 1         | N/A, only inlines always-inline functions and LLVM lifetime intrinsics |
+| 2         | 225 |
+| 3         | 275 |
+| s         | 75 |
+| z         | 25 |
 
 ## link-arg
 
@@ -25,6 +113,24 @@ This flag lets you append a single extra argument to the linker invocation.
 This flag lets you append multiple extra arguments to the linker invocation. The
 options should be separated by spaces.
 
+## link-dead-code
+
+This flag controls whether the linker will keep dead code. It takes one of
+the following values:
+
+* `y`, `yes`, `on`, or no value: keep dead code.
+* `n`, `no`, or `off`: remove dead code (the default).
+
+An example of when this flag might be useful is when trying to construct code coverage
+metrics.
+
+## linker
+
+This flag controls which linker `rustc` invokes to link your code. It takes a
+path to the linker executable. If this flag is not specified, the linker will
+be inferred based on the target. See also the [linker-flavor](#linker-flavor)
+flag for another way to specify the linker.
+
 ## linker-flavor
 
 This flag controls the linker flavor used by `rustc`. If a linker is given with
@@ -51,16 +157,23 @@ flavor. Valid options are:
 
 [lld-flavor]: https://lld.llvm.org/Driver.html
 
-## link-dead-code
+## linker-plugin-lto
 
-This flag controls whether the linker will keep dead code. It takes one of
+This flag defers LTO optimizations to the linker. See
+[linker-plugin-LTO](../linker-plugin-lto.md) for more details. It takes one of
 the following values:
 
-* `y`, `yes`, `on`, or no value: keep dead code.
-* `n`, `no`, or `off`: remove dead code (the default).
+* `y`, `yes`, `on`, or no value: enable linker plugin LTO.
+* `n`, `no`, or `off`: disable linker plugin LTO (the default).
+* A path to the linker plugin.
 
-An example of when this flag might be useful is when trying to construct code coverage
-metrics.
+## llvm-args
+
+This flag can be used to pass a list of arguments directly to LLVM.
+
+The list must be separated by spaces.
+
+Pass `--help` to see a list of options.
 
 ## lto
 
@@ -92,78 +205,59 @@ opt-level=0`](#opt-level)). That is:
 
 See also [linker-plugin-lto](#linker-plugin-lto) for cross-language LTO.
 
-## linker-plugin-lto
-
-This flag defers LTO optimizations to the linker. See
-[linker-plugin-LTO](../linker-plugin-lto.md) for more details. It takes one of
-the following values:
-
-* `y`, `yes`, `on`, or no value: enable linker plugin LTO.
-* `n`, `no`, or `off`: disable linker plugin LTO (the default).
-* A path to the linker plugin.
-
-## target-cpu
-
-This instructs `rustc` to generate code specifically for a particular processor.
-
-You can run `rustc --print target-cpus` to see the valid options to pass
-here. Additionally, `native` can be passed to use the processor of the host
-machine. Each target has a default base CPU.
-
-## target-feature
-
-Individual targets will support different features; this flag lets you control
-enabling or disabling a feature. Each feature should be prefixed with a `+` to
-enable it or `-` to disable it. Separate multiple features with commas.
-
-To see the valid options and an example of use, run `rustc --print
-target-features`.
+## metadata
 
-Using this flag is unsafe and might result in [undefined runtime
-behavior](../targets/known-issues.md).
+This option allows you to control the metadata used for symbol mangling. This
+takes a space-separated list of strings. Mangled symbols will incorporate a
+hash of the metadata. This may be used, for example, to differentiate symbols
+between two different versions of the same crate being linked.
 
-See also the [`target_feature`
-attribute](../../reference/attributes/codegen.md#the-target_feature-attribute)
-for controlling features per-function.
+## no-prepopulate-passes
 
-This also supports the feature `+crt-static` and `-crt-static` to control
-[static C runtime linkage](../../reference/linkage.html#static-and-dynamic-c-runtimes).
+This flag tells the pass manager to use an empty list of passes, instead of the
+usual pre-populated list of passes.
 
-Each target and [`target-cpu`](#target-cpu) has a default set of enabled
-features.
+## no-redzone
 
-## passes
+This flag allows you to disable [the
+red zone](https://en.wikipedia.org/wiki/Red_zone_\(computing\)). It takes one
+of the following values:
 
-This flag can be used to add extra [LLVM
-passes](http://llvm.org/docs/Passes.html) to the compilation.
+* `y`, `yes`, `on`, or no value: disable the red zone.
+* `n`, `no`, or `off`: enable the red zone.
 
-The list must be separated by spaces.
+The default behaviour, if the flag is not specified, depends on the target.
 
-See also the [`no-prepopulate-passes`](#no-prepopulate-passes) flag.
+## no-stack-check
 
-## llvm-args
+This option is deprecated and does nothing.
 
-This flag can be used to pass a list of arguments directly to LLVM.
+## no-vectorize-loops
 
-The list must be separated by spaces.
+This flag disables [loop
+vectorization](https://llvm.org/docs/Vectorizers.html#the-loop-vectorizer).
 
-Pass `--help` to see a list of options.
+## no-vectorize-slp
 
-## save-temps
+This flag disables vectorization using
+[superword-level
+parallelism](https://llvm.org/docs/Vectorizers.html#the-slp-vectorizer).
 
-This flag controls whether temporary files generated during compilation are
-deleted once compilation finishes. It takes one of the following values:
+## opt-level
 
-* `y`, `yes`, `on`, or no value: save temporary files.
-* `n`, `no`, or `off`: delete temporary files (the default).
+This flag controls the optimization level.
 
-## rpath
+* `0`: no optimizations, also turns on
+  [`cfg(debug_assertions)`](#debug-assertions) (the default).
+* `1`: basic optimizations.
+* `2`: some optimizations.
+* `3`: all optimizations.
+* `s`: optimize for binary size.
+* `z`: optimize for binary size, but also turn off loop vectorization.
 
-This flag controls whether [`rpath`](https://en.wikipedia.org/wiki/Rpath) is
-enabled. It takes one of the following values:
+Note: The [`-O` flag][option-o-optimize] is an alias for `-C opt-level=2`.
 
-* `y`, `yes`, `on`, or no value: enable rpath.
-* `n`, `no`, or `off`: disable rpath (the default).
+The default is `0`.
 
 ## overflow-checks
 
@@ -178,29 +272,23 @@ one of the following values:
 If not specified, overflow checks are enabled if
 [debug-assertions](#debug-assertions) are enabled, disabled otherwise.
 
-## no-prepopulate-passes
-
-This flag tells the pass manager to use an empty list of passes, instead of the
-usual pre-populated list of passes.
+## panic
 
-## no-vectorize-loops
+This option lets you control what happens when the code panics.
 
-This flag disables [loop
-vectorization](https://llvm.org/docs/Vectorizers.html#the-loop-vectorizer).
+* `abort`: terminate the process upon panic
+* `unwind`: unwind the stack upon panic
 
-## no-vectorize-slp
+If not specified, the default depends on the target.
 
-This flag disables vectorization using
-[superword-level
-parallelism](https://llvm.org/docs/Vectorizers.html#the-slp-vectorizer).
+## passes
 
-## soft-float
+This flag can be used to add extra [LLVM
+passes](http://llvm.org/docs/Passes.html) to the compilation.
 
-This option controls whether `rustc` generates code that emulates floating
-point instructions in software. It takes one of the following values:
+The list must be separated by spaces.
 
-* `y`, `yes`, `on`, or no value: use soft floats.
-* `n`, `no`, or `off`: use hardware floats (the default).
+See also the [`no-prepopulate-passes`](#no-prepopulate-passes) flag.
 
 ## prefer-dynamic
 
@@ -214,16 +302,20 @@ linkage. This flag takes one of the following values:
 * `y`, `yes`, `on`, or no value: use dynamic linking.
 * `n`, `no`, or `off`: use static linking (the default).
 
-## no-redzone
+## profile-generate
 
-This flag allows you to disable [the
-red zone](https://en.wikipedia.org/wiki/Red_zone_\(computing\)). It takes one
-of the following values:
+This flag allows for creating instrumented binaries that will collect
+profiling data for use with profile-guided optimization (PGO). The flag takes
+an optional argument which is the path to a directory into which the
+instrumented binary will emit the collected data. See the chapter on
+[profile-guided optimization] for more information.
 
-* `y`, `yes`, `on`, or no value: disable the red zone.
-* `n`, `no`, or `off`: enable the red zone.
+## profile-use
 
-The default behaviour, if the flag is not specified, depends on the target.
+This flag specifies the profiling data file to be used for profile-guided
+optimization (PGO). The flag takes a mandatory argument which is the path
+to a valid `.profdata` file. See the chapter on
+[profile-guided optimization] for more information.
 
 ## relocation-model
 
@@ -233,38 +325,6 @@ use.
 
 To find the valid options for this flag, run `rustc --print relocation-models`.
 
-## code-model
-
-This option lets you choose which code model to use.
-
-To find the valid options for this flag, run `rustc --print code-models`.
-
-## metadata
-
-This option allows you to control the metadata used for symbol mangling. This
-takes a space-separated list of strings. Mangled symbols will incorporate a
-hash of the metadata. This may be used, for example, to differentiate symbols
-between two different versions of the same crate being linked.
-
-## extra-filename
-
-This option allows you to put extra data in each output filename. It takes a
-string to add as a suffix to the filename. See the [`--emit`
-flag][option-emit] for more information.
-
-## codegen-units
-
-This flag controls how many code generation units the crate is split into. It
-takes an integer greater than 0.
-
-When a crate is split into multiple codegen units, LLVM is able to process
-them in parallel. Increasing parallelism may speed up compile times, but may
-also produce slower code. Setting this to 1 may improve the performance of
-generated code, but may be slower to compile.
-
-The default value, if not specified, is 16 for non-incremental builds. For
-incremental builds the default is 256 which allows caching to be more granular.
-
 ## remark
 
 This flag lets you print remarks for optimization passes.
@@ -273,119 +333,59 @@ The list of passes should be separated by spaces.
 
 `all` will remark on every pass.
 
-## no-stack-check
-
-This option is deprecated and does nothing.
-
-## debuginfo
-
-This flag controls the generation of debug information. It takes one of the
-following values:
-
-* `0`: no debug info at all (the default).
-* `1`: line tables only.
-* `2`: full debug info.
-
-Note: The [`-g` flag][option-g-debug] is an alias for `-C debuginfo=2`.
-
-## opt-level
-
-This flag controls the optimization level.
-
-* `0`: no optimizations, also turns on
-  [`cfg(debug_assertions)`](#debug-assertions) (the default).
-* `1`: basic optimizations.
-* `2`: some optimizations.
-* `3`: all optimizations.
-* `s`: optimize for binary size.
-* `z`: optimize for binary size, but also turn off loop vectorization.
-
-Note: The [`-O` flag][option-o-optimize] is an alias for `-C opt-level=2`.
-
-The default is `0`.
-
-## debug-assertions
-
-This flag lets you turn `cfg(debug_assertions)` [conditional
-compilation](../../reference/conditional-compilation.md#debug_assertions) on
-or off. It takes one of the following values:
-
-* `y`, `yes`, `on`, or no value: enable debug-assertions.
-* `n`, `no`, or `off`: disable debug-assertions.
-
-If not specified, debug assertions are automatically enabled only if the
-[opt-level](#opt-level) is 0.
-
-## inline-threshold
-
-This option lets you set the default threshold for inlining a function. It
-takes an unsigned integer as a value. Inlining is based on a cost model, where
-a higher threshold will allow more inlining.
-
-The default depends on the [opt-level](#opt-level):
-
-| opt-level | Threshold |
-|-----------|-----------|
-| 0         | N/A, only inlines always-inline functions |
-| 1         | N/A, only inlines always-inline functions and LLVM lifetime intrinsics |
-| 2         | 225 |
-| 3         | 275 |
-| s         | 75 |
-| z         | 25 |
+## rpath
 
-## panic
+This flag controls whether [`rpath`](https://en.wikipedia.org/wiki/Rpath) is
+enabled. It takes one of the following values:
 
-This option lets you control what happens when the code panics.
+* `y`, `yes`, `on`, or no value: enable rpath.
+* `n`, `no`, or `off`: disable rpath (the default).
 
-* `abort`: terminate the process upon panic
-* `unwind`: unwind the stack upon panic
+## save-temps
 
-If not specified, the default depends on the target.
+This flag controls whether temporary files generated during compilation are
+deleted once compilation finishes. It takes one of the following values:
 
-## incremental
+* `y`, `yes`, `on`, or no value: save temporary files.
+* `n`, `no`, or `off`: delete temporary files (the default).
 
-This flag allows you to enable incremental compilation, which allows `rustc`
-to save information after compiling a crate to be reused when recompiling the
-crate, improving re-compile times. This takes a path to a directory where
-incremental files will be stored.
+## soft-float
 
-## profile-generate
+This option controls whether `rustc` generates code that emulates floating
+point instructions in software. It takes one of the following values:
 
-This flag allows for creating instrumented binaries that will collect
-profiling data for use with profile-guided optimization (PGO). The flag takes
-an optional argument which is the path to a directory into which the
-instrumented binary will emit the collected data. See the chapter on
-[profile-guided optimization] for more information.
+* `y`, `yes`, `on`, or no value: use soft floats.
+* `n`, `no`, or `off`: use hardware floats (the default).
 
-## profile-use
+## target-cpu
 
-This flag specifies the profiling data file to be used for profile-guided
-optimization (PGO). The flag takes a mandatory argument which is the path
-to a valid `.profdata` file. See the chapter on
-[profile-guided optimization] for more information.
+This instructs `rustc` to generate code specifically for a particular processor.
 
-## force-frame-pointers
+You can run `rustc --print target-cpus` to see the valid options to pass
+here. Additionally, `native` can be passed to use the processor of the host
+machine. Each target has a default base CPU.
 
-This flag forces the use of frame pointers. It takes one of the following
-values:
+## target-feature
 
-* `y`, `yes`, `on`, or no value: force-enable frame pointers.
-* `n`, `no`, or `off`: do not force-enable frame pointers. This does
-  not necessarily mean frame pointers will be removed.
+Individual targets will support different features; this flag lets you control
+enabling or disabling a feature. Each feature should be prefixed with a `+` to
+enable it or `-` to disable it. Separate multiple features with commas.
 
-The default behaviour, if frame pointers are not force-enabled, depends on the
-target.
+To see the valid options and an example of use, run `rustc --print
+target-features`.
 
-## default-linker-libraries
+Using this flag is unsafe and might result in [undefined runtime
+behavior](../targets/known-issues.md).
 
-This flag controls whether or not the linker includes its default libraries.
-It takes one of the following values:
+See also the [`target_feature`
+attribute](../../reference/attributes/codegen.md#the-target_feature-attribute)
+for controlling features per-function.
 
-* `y`, `yes`, `on`, or no value: include default libraries (the default).
-* `n`, `no`, or `off`: exclude default libraries.
+This also supports the feature `+crt-static` and `-crt-static` to control
+[static C runtime linkage](../../reference/linkage.html#static-and-dynamic-c-runtimes).
 
-For example, for gcc flavor linkers, this issues the `-nodefaultlibs` flag to
-the linker.
+Each target and [`target-cpu`](#target-cpu) has a default set of enabled
+features.
 
 ## bitcode-in-rlib