Scroll to navigation

LDC(1) User Commands LDC(1)

NAME

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

DESCRIPTION

LDC - the LLVM D compiler (1.32.0):

based on DMD v2.102.2 and LLVM 15.0.7 built with LDC - the LLVM D compiler (1.32.0) Default target: x86_64-suse-linux Host CPU: (unknown) http://dlang.org - http://wiki.dlang.org/LDC
Registered Targets:
- AArch64 (little endian)
aarch64_32 - AArch64 (little endian ILP32) aarch64_be - AArch64 (big endian) amdgcn - AMD GCN GPUs arm - ARM arm64 - ARM64 (little endian) arm64_32 - ARM64 (little endian ILP32) armeb - ARM (big endian) avr - Atmel AVR Microcontroller bpf - BPF (host endian) bpfeb - BPF (big endian) bpfel - BPF (little endian) hexagon - Hexagon lanai - Lanai 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.32.2-2.5.x86_64/usr/bin/ldmd2 [<option>...] <file>... /home/abuild/rpmbuild/BUILDROOT/ldc-1.32.2-2.5.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)
set C++ name mangling compatibility with <standard>
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
generate C++ 'header' file
write C++ 'header' file to directory
write C++ 'header' file to filename
print help and exit
look for imports also in directory
include imported modules in the compilation
ignore unsupported pragmas
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)
optimize
do not write object file
write object & library files to directory
name output file to filename
preserve source path for output files
enable an upcoming language change identified by 'name'
list all upcoming language changes
profile runtime performance of generated code
compile release version
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 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
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.102.2 and LLVM 15.0.7 built with LDC - the LLVM D compiler (1.32.0) Default target: x86_64-suse-linux Host CPU: (unknown) http://dlang.org - http://wiki.dlang.org/LDC
Registered Targets:
- AArch64 (little endian)
aarch64_32 - AArch64 (little endian ILP32) aarch64_be - AArch64 (big endian) amdgcn - AMD GCN GPUs arm - ARM arm64 - ARM64 (little endian) arm64_32 - ARM64 (little endian ILP32) armeb - ARM (big endian) avr - Atmel AVR Microcontroller bpf - BPF (host endian) bpfeb - BPF (big endian) bpfel - BPF (little endian) hexagon - Hexagon lanai - Lanai 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.

December 2023 the LLVM D compiler (1.32.0):