Other Compiler Flags (v0.2.1)

Diagnostic, cleanup, export, and discovery flags.

Latest

Overview

These flags help with inspection, cleanup, diagnostic exports, and general compiler discovery tasks.

Reference source: thrustc/thrustc_cli/src/help.rs

Back to command line reference

--copy-output-to-clipboard

Copy the printable compiler output to the system clipboard.

Accepts value: no

Details

This only makes sense when a `-print` flag is also active and the platform clipboard integration is available.

Examples

thrustc main.thrust -print ast --copy-output-to-clipboard

Notes

No extra notes for this flag.

--debug-clang-command

Display the generated Clang command used during linking.

Accepts value: no

Details

This helps inspect or debug the external command the compiler is about to run.

Examples

thrustc main.thrust --debug-clang-command

Notes

No extra notes for this flag.

--debug-gcc-command

Display the generated GCC command used during linking.

Accepts value: no

Details

This is the GCC counterpart of `--debug-clang-command`.

Examples

thrustc main.thrust --debug-gcc-command

Notes

No extra notes for this flag.

--export-compiler-errors

Export compiler error diagnostics to files.

Accepts value: no

Details

Use this when you want diagnostics persisted instead of only printed to the terminal.

Examples

thrustc main.thrust --export-compiler-errors

Notes

No extra notes for this flag.

--export-compiler-warnings

Export compiler warning diagnostics to files.

Accepts value: no

Details

This is useful for build automation or post-processing warning results.

Examples

thrustc main.thrust --export-compiler-warnings

Notes

No extra notes for this flag.

--export-diagnostics-path

Set the directory used for exported diagnostics.

Accepts value: yes

Value syntax: diagnostics/

Details

Use this with diagnostic export flags to control where the compiler writes its files.

Examples

thrustc main.thrust --export-compiler-errors --export-diagnostics-path diagnostics/

Notes

--clean-exported-diagnostics

Clean the exported diagnostics directory.

Accepts value: no

Details

This removes or resets previously exported diagnostic files before or after a compilation workflow.

Examples

thrustc main.thrust --clean-exported-diagnostics

Notes

No extra notes for this flag.

--clean-build

Clean the compiler build directory.

Accepts value: no

Details

Use this to remove accumulated compilation artifacts.

Examples

thrustc main.thrust --clean-build

Notes

No extra notes for this flag.

--clean-tokens

Clean the directory that stores lexical token outputs.

Accepts value: no

Details

This is mostly useful when using token emission or token printing workflows.

Examples

thrustc main.thrust --clean-tokens

Notes

No extra notes for this flag.

--clean-assembler

Clean the directory that stores emitted assembler files.

Accepts value: no

Details

This helps keep emitted assembler output tidy between builds.

Examples

thrustc main.thrust --clean-assembler

Notes

No extra notes for this flag.

--clean-llvm-ir

Clean the directory that stores emitted LLVM IR files.

Accepts value: no

Details

Use this when repeatedly emitting IR and you want a clean output directory.

Examples

thrustc main.thrust --clean-llvm-ir

Notes

No extra notes for this flag.

--clean-llvm-bitcode

Clean the directory that stores emitted LLVM bitcode files.

Accepts value: no

Details

This is the bitcode-specific cleanup flag.

Examples

thrustc main.thrust --clean-llvm-bitcode

Notes

No extra notes for this flag.

--clean-objects

Clean the directory that stores emitted object files.

Accepts value: no

Details

Use this when object file output should be reset before a new build.

Examples

thrustc main.thrust --clean-objects

Notes

No extra notes for this flag.

--dump-compiler-version

Write the compiler version into `COMPILER_VERSION.txt`.

Accepts value: no

Details

This exports the version string to a flat text file in the working directory.

Examples

thrustc --dump-compiler-version

Notes

No extra notes for this flag.

--no-obfuscate-archive-names

Disable file-name obfuscation for archive names.

Accepts value: no

Details

The original help text notes that this does not apply to the final build output.

Examples

thrustc main.thrust --no-obfuscate-archive-names

Notes

No extra notes for this flag.

--no-obfuscate-ir

Disable name obfuscation in emitted IR output.

Accepts value: no

Details

This is useful when emitted IR should stay easier to read or diff.

Examples

thrustc main.thrust -emit llvm-ir --no-obfuscate-ir

Notes

No extra notes for this flag.

--print-targets

Print the supported targets.

Accepts value: no

Details

Use this to inspect which targets are currently known by the compiler build.

Examples

thrustc --print-targets

Notes

No extra notes for this flag.

--print-supported-cpus

Print the supported CPUs for the current target.

Accepts value: no

Details

This helps choose a valid value for `-cpu`.

Examples

thrustc --print-supported-cpus

Notes

No extra notes for this flag.

--print-host-target-triple

Print the host target triple.

Accepts value: no

Details

This reports the native triple of the machine running the compiler.

Examples

thrustc --print-host-target-triple

Notes

No extra notes for this flag.

--print-opt-passes

Print the optimization passes available through `--opt-passes`.

Accepts value: no

Details

This is a discovery flag for users who want to build a custom pass list.

Examples

thrustc --print-opt-passes

Notes

No extra notes for this flag.