LDC 1.1.0 发布了。LDC 是目前性能最高的 D 语言编译工具,此次更新包含大量新特性和优化改进,性能和C/C++不相上下,并且在数学计算方面已经大幅度超越C/C++,并且内存控制非常优秀,最近的版本改进非常值得我们用起来。
主要更新
D语言和标准库升级到 2.071.2.
Link-Time Optimization (LTO) with-flto={thin|full}(LLVM ≥ 3.9). LTO requires linker support and is therefore currently only supported on Linux (ld.goldwith LLVM plugin) and OS X. For more details, please refer to LLVM's and Clang's documentation, for example Clang's ThinLTO documentation. (#1840)
Experimental cross-module inlining (#1577, enable with-enable-cross-module-inlining)
Windows: enable C-style DLL exports/imports viaexport(functions only) (#1856)
Experimental IR-to-obj caching with-cache=<cache dir>(#1572, #1753, #1812, #1893)
Accept bitcode files on commandline (#1539)
@ldc.attributes.fastmathfor aggressive math optimization (#1472, #1438)
Binary distribution now bundles DUB (v1.2.0) (#1573)
Breaking changes to command-line semantics (see http://forum.dlang.org/post/ubobkfmsspbsmjunosna@forum.dlang.org).
新特性
New traits__traits(targetCPU)and__traits(targetHasFeature, )(#1434)
Drastic reduction of large symbol name lengths with optional-hash-threshold(#1445)
@ldc.attributes.optStrategy(...)for per-function optimization setting (#1637)
Extend intrinsicllvm_memory_fencefor single-thread fences (#1837)
Add function instrumentation and profiling options via-finstrument-functions(#1845)
Add line-tables-only debuginfo via-gline-tables-only(#1861)
Implement DMD-compatible-betterC(#1872)
平台支持
支持.
ABI fixes, mainly for PowerPC targets. For bootstrapping, make sure to use source branchltsmasteror the latest 0.17.x release, as all existing LDC releases ≥ 1.0 for PowerPC are unusable. (#1905)
Added ARM assembly code for Phobosstd.bigint. (ldc-developers/phobos#31)
Added some definitions for OpenBSD. (ldc-developers/druntime@1ef8322)
Updates for Solaris (ldc-developers/druntime#71, ldc-developers/druntime#72, ldc-developers/druntime#73, ldc-developers/druntime#74, ldc-developers/druntime#75, ldc-developers/druntime#79)
Linux: changed default to fully relocatable, position independent code (PIC). Change back to non-relocatable with-relocation-model=static. (#1664)
Bug fixes
Potential crash when generating debuginfos for nested variables AND optimizing (#1933, #1963, #1984) (new)
Alignment and size of critical sections, causing crashes on ARM (#1955, #1956) (new)
-finstrument-functionsusing wrong return address (#1961) (new)
Response files expanded too late, preventing cross-compilation on Windows when using dub (#1941, #1942) (new)
Non-Windows x86_64 ABI bug wrt. returning static arrays (#1925, #1938) (new)
Some array literals wrongly promoted to constants (#1924, #1927) (new)
Misc. DUB regressions introduced by beta 3 (#1819)
Don't output static libs (with relative target filename) in-odobjects directory (for LDC, but continue to do so for LDMD, for DMD compatibility).
LDMD: avoid object file collisions (due to multiple D source files with identical name in different dirs) when creating a static lib and remove the object files on success, mimicking DMD.
Create output directories recursively.
Potential ICE when building vibe.d projects (#1741)
ICE when calling an abstract function. (#1822)
ICE for invalid__asmconstraints. (#802)
Wrong code for LLVM inline assembly returning a tuple (__asmtuple). (#1823)
Potential ICE wrt. captured variables. (#1864)
ARM: ICE when using LTO. (#1860)
Union layout and initialization, fixing the compilation of DMD (#1846, fixing most cases of #1829)
Allow custom file extension for .ll/.bc./.s output files. (#1843)
Windows: produced binaries with debuginfos are now large-address-aware too. (#442, #1876)
Fix debuginfos for parameters. (#1816)
Allow alignment of global variables < pointer size. (#1825)
Promote more immutable array literals to LLVM constants. (#506, #1821, #1838)
ICE when incrementing a complex variable. (#1806)
llvm.va_startnot matched withllvm.va_end(#1744)
ldmd2 ignores -od option for libraries. (#1724)
ICE: toConstElem(CastExp) doesn't support NewExp as cast source. (#1723)
Mark runtime intrinsic shims as pragma(inline, true). (#1715)
pragma(inline, false) is incompatible with store/loadUnaligned. (#1711)
ICE: function not fully analyzed; previous unreported errors compiling std.variant.VariantN!(16LU, int, string).VariantN.__xopEquals? (#1698)
Segfault at at ldc/ldc-1.1.0/driver/main.cpp:1351. (#1696)
Make sure MSVC Build Tools are automatically detected by LDC. (#1690)
Update Windows README.txt. (#1689)
[ldc2-1.1.0-beta2] Missing symbol with inlining enabled. (#1678)
[REG ldc-1.1.0-beta2] ICE with templated classes. (#1677)
FreeBSD: Fix shared library build, working Hello World. (#1673)
Strange compile time error. (#1638)
LDC+DUB on Windows: folder separator is ignored. (#1621)
Ubuntu 16.10 linker failures due to PIE by default (relocation R_X86_64_32S … can not be used). (#1618)
ICE on returning struct with zero-length static array. (#1611)
Debug info generation fixes for LLVM >= 3.8. (#1598)
ICE after return in the middle of a function on Win64/MSVC. (#1582)
Enums with referenced struct members result in floating point error. (#1581)
pragma(inline, {true|false})is no longer ignored (#1577)
Static array initialization with single element misdetected as direct construction via sret. (#1548)
ICE on static typeid. (#1540)
super doesn't work. (#1450)
Sub-expression evaluation order fixes. (#1327)
Add suffix to LTO linker plugin name to disambiguate with LLVM installation. (#1898)
Building LDC
LDC now requires a preinstalled D compiler. (Versions0.17.*and theltsmasterbranch can be used to 'bootstrap' a build when only a C++ compiler is available.)
On Unix-like systems we now use gcc for linking. (#1594)
Internals
optimizer: Skip adding verifier function pass if-disable-verifyis given. (#1591)
DValue refactoring. (#1562)
The vtable's of inherited interfaces are now put between the class's _monitor field and the user data fields. (https://issues.dlang.org/show_bug.cgi?id=15644)
待处理问题
LDC does not zero the padding area of arealvariable. This may lead to wrong results if the padding area is also considered. See #770. Does not apply torealmembers inside structs etc.
Phobos does not compile on MinGW platform.
查看发行说明