Scroll to navigation

LDC(1) User Commands LDC(1)

NAME

LDC - manual page for LDC LLVM D compiler (1.39.0):

DESCRIPTION

LDC - the LLVM D compiler (1.39.0):

based on DMD v2.109.1 and LLVM 18.1.8 built with LDC - the LLVM D compiler (1.39.0) Default target: x86_64-suse-linux Host CPU: (unknown) http://dlang.org - http://wiki.dlang.org/LDC
Registered Targets:
- AArch64 (little endian)
- AArch64 (little endian ILP32)
- AArch64 (big endian)
- AMD GCN GPUs
- ARM
- ARM64 (little endian)
- ARM64 (little endian ILP32)
- ARM (big endian)
- Atmel AVR Microcontroller
- BPF (host endian)
- BPF (big endian)
- BPF (little endian)
- Hexagon
- Lanai
loongarch32 - 32-bit LoongArch loongarch64 - 64-bit LoongArch m68k - Motorola 68000 family mips - MIPS (32-bit big endian) mips64 - MIPS (64-bit big endian) mips64el - MIPS (64-bit little endian) mipsel - MIPS (32-bit little endian) msp430 - MSP430 [experimental] nvptx - NVIDIA PTX 32-bit nvptx64 - NVIDIA PTX 64-bit ppc32 - PowerPC 32 ppc32le - PowerPC 32 LE ppc64 - PowerPC 64 ppc64le - PowerPC 64 LE r600 - AMD GPUs HD2XXX-HD6XXX riscv32 - 32-bit RISC-V riscv64 - 64-bit RISC-V sparc - Sparc sparcel - Sparc LE sparcv9 - Sparc V9 systemz - SystemZ thumb - Thumb thumbeb - Thumb (big endian) ve - VE wasm32 - WebAssembly 32-bit wasm64 - WebAssembly 64-bit x86 - 32-bit X86: Pentium-Pro and above x86-64 - 64-bit X86: EM64T and AMD64 xcore - XCore

Usage:

/home/abuild/rpmbuild/BUILDROOT/ldc-1.39.0-1.1.x86_64/usr/bin/ldmd2 [<option>...] <file>... /home/abuild/rpmbuild/BUILDROOT/ldc-1.39.0-1.1.x86_64/usr/bin/ldmd2 [<option>...] -run <file> [<arg>...]

Where:

<file>
D source file
<arg>
Argument to pass when running the resulting program

<option>:

@<cmdfile>
read arguments from cmdfile
generate code for all template instantiations
omit generating some runtime information and helper functions
bounds checks on, in @safe only, or off
compile only, do not link
enable or disable specific checks
behavior on assert/boundscheck/finalswitch failure
turn colored console output on
force colored console output on or off, or only when not redirected (default)
use config file at filename
do code coverage analysis
include code executed during CTFE in coverage report
require at least nnn% code coverage
generate documentation
write documentation file to directory
write documentation file to filename
silently allow deprecated features and symbols
issue an error when deprecated features or symbols are used (halt compilation)
issue a message when deprecated features or symbols are used (default)
compile in debug code
compile in debug code <= level
compile in debug code identified by ident
set symbolic debug library to name
set default library to name
print module dependencies (imports/file/version/debug/lib)
write module dependencies to filename (only imports)
Windows only: select symbols to dllimport (none/defaultLibsOnly/all)
set C++ name mangling compatibility with <standard>
generate Indirect Branch Tracking code
generate position independent code
add symbolic debug info

-gdwarf=<version> add DWARF symbolic debug info

emit debug info for all referenced types
always emit stack frame
generate 'header' file
write 'header' file to directory
write 'header' file to filename
write C++ 'header' equivalent to stdout
write C++ 'header' file to directory
write C++ 'header' file to filename instead of stdout
print help and exit
look for imports also in directory
include imported modules in the compilation
specify the non-ASCII tables for D identifiers
specify the non-ASCII tables for ImportC identifiers
deprecated flag, unsupported pragmas are always ignored now
do function inlining
look for string imports also in directory
pass linkerflag to link
generate library rather than object files
enable garbage collection for the compiler
generate 32 bit code
generate 64 bit code
add default main() if not present already (e.g. for unittesting)
print dependencies in Makefile compatible format to filename or stdout
open web browser on manual page
generate instructions for architecture identified by 'id'
list all architecture options

-mixin=<filename> expand and save mixins to file specified by <filename>

MS C runtime library to reference from main/WinMain/DllMain
use <filespec> as source file for <package.module>
no array bounds checking (deprecated, use -boundscheck=off)
assume no Exceptions will be thrown
optimize
do not write object file
write object & library files to directory
name output file to filename
preserve source path for output files
pass preprocessorflag to C preprocessor
enable an upcoming language change identified by 'name'
list all upcoming language changes
profile runtime performance of generated code
contracts and asserts are not emitted, and bounds checking is performed only in @safe functions
revert language change identified by 'name'
list all revertable language changes
compile, link, and run the program srcfile
generate shared library (DLL)
use <triple> as <arch>-[<vendor>-]<os>[-<cenv>[-<cppenv]]
help with language change identified by 'name'
list all language changes
compile in unit tests
verbose
generate additional textual assembly files (*.s)
print character (column) numbers in diagnostics
print the underlying LDC command line
set the style for file/line number annotations on compiler messages
limit the number of supplemental messages for each error (0 means unlimited)
limit the number of error messages (0 means unlimited)
show error messages with the context of the erroring source line
show errors from speculative compiles such as __traits(compiles,...)
print compiler version and exit
compile in version code >= level
compile in version code identified by ident
list all gc allocations including hidden ones
default visibility of symbols (default/hidden/public)
list statistics on template instantiations
list all variables going into thread local storage
warnings as errors (compilation will halt)
warnings as messages (compilation will continue)
generate JSON file
write JSON file to filename

-Xcc=<driverflag> pass driverflag to linker driver (cc)

based on DMD v2.109.1 and LLVM 18.1.8 built with LDC - the LLVM D compiler (1.39.0) Default target: x86_64-suse-linux Host CPU: (unknown) http://dlang.org - http://wiki.dlang.org/LDC
Registered Targets:
- AArch64 (little endian)
- AArch64 (little endian ILP32)
- AArch64 (big endian)
- AMD GCN GPUs
- ARM
- ARM64 (little endian)
- ARM64 (little endian ILP32)
- ARM (big endian)
- Atmel AVR Microcontroller
- BPF (host endian)
- BPF (big endian)
- BPF (little endian)
- Hexagon
- Lanai
loongarch32 - 32-bit LoongArch loongarch64 - 64-bit LoongArch m68k - Motorola 68000 family mips - MIPS (32-bit big endian) mips64 - MIPS (64-bit big endian) mips64el - MIPS (64-bit little endian) mipsel - MIPS (32-bit little endian) msp430 - MSP430 [experimental] nvptx - NVIDIA PTX 32-bit nvptx64 - NVIDIA PTX 64-bit ppc32 - PowerPC 32 ppc32le - PowerPC 32 LE ppc64 - PowerPC 64 ppc64le - PowerPC 64 LE r600 - AMD GPUs HD2XXX-HD6XXX riscv32 - 32-bit RISC-V riscv64 - 64-bit RISC-V sparc - Sparc sparcel - Sparc LE sparcv9 - Sparc V9 systemz - SystemZ thumb - Thumb thumbeb - Thumb (big endian) ve - VE wasm32 - WebAssembly 32-bit wasm64 - WebAssembly 64-bit x86 - 32-bit X86: Pentium-Pro and above x86-64 - 64-bit X86: EM64T and AMD64 xcore - XCore

SEE ALSO

The full documentation for LDC is maintained as a Texinfo manual. If the info and LDC programs are properly installed at your site, the command

info LDC

should give you access to the complete manual.

September 2024 the LLVM D compiler (1.39.0):