Big news
- Frontend, druntime and Phobos are at version 2.078.3, incl. new switches
-dip1008
and-transition=<intpromote|16997>
as well aspragma(crt_{con,de}structor)
. (#2486) - New switch
-link-defaultlib-shared
to link against shared druntime/Phobos. It defaults to true for shared libraries (-shared
), so it's primarily useful for executables. (#2443) - Support for plugins via
-plugin=...
(see this example). The mechanism is identical to Clang's LLVM-IR pass plugins and thus supports those as well, e.g., the AFLfuzz LLVM-mode plugin, Easy::Jit. (#2554) - Support for LLVM IR-based Profile-Guided Optimization via
-fprofile-{generate,use}
(not working on Windows yet). (#2474) - Basic support for LLVM XRay instrumentation via
-fxray-{instrument,instruction-threshold}
. (#2465) - DMD-style function trace profiling via
-profile
(LDMD) /-fdmd-trace-functions
(LDC). (#2477) - New UDA
ldc.attributes.assumeUsed
to prevent a symbol from being optimized away. (#2457) - The PGO helper library
ldc-profile-rt
was replaced by LLVM's vanilla profiling library. Our subset of LLVM compiler-rt libraries is now also shipped on Windows (excl. fuzzer). (#2527, #2544)
Platform support
- Supports LLVM 3.7 - 5.0.
- Windows: Supports Visual Studio/C++ Build Tools 2015 and 2017.
- Android: A native 32-bit ARM package for the Termux app is included, install it with
dpkg -i ldc-beta_1.8.0_android-arm.deb
. To cross-compile from a desktop OS, see the wiki.
Bug fixes
- Strict left-to-right evaluation/load order of function arguments. (#2450, #2502)
- Inline asm silently ignores opcodes db, ds, di, dl, df, dd, de. (#2548)
- Missed optimization for
scope
allocated classes. (#2515, #2516) - Don't eliminate frame pointer by default at
-O0
. (#2480, #2483) - LLVM complaining about invalid IR pointer arithmetics. (#2537)
llvm_expect()
doesn't work with CTFE. (#2458, #2506).{so,dylib}
file command line arguments should be forwarded to linker. (#2445, #2485)
Known issues
- LDC does not zero the padding area of a
real
variable. This may lead to wrong results if the padding area is also considered. See #770. Does not apply toreal
members inside structs etc. - Phobos does not compile on MinGW platform.
- ThinLTO may not work well with the
ld.bfd
linker, useld.gold
instead (-linker=gold
).