The development team for the compiler infrastructure LLVM and Clang has released version 17.0.1 for both every six months. 17.0.0 was omitted because a small error correction was required compared to 17.0.0-rc. The innovations and corrections in version 17 particularly affect details, but these are at the core of both systems as well as in almost all platforms and connected languages.
After switching to C++17 in the spring, Clang has further expanded the successors C++20, C++23 and C++2c (C++26). With C++20, the frontend fully supports the announced co-routines on all platforms, apart from Windows, where problems arise in stability and the ABI (Application Binary Interface). For C++23, Clang now knows the option -std=c++23 and for C++26 -std=c++2c and -std=gnu++2c. For all C++ variants, the frontend has improved code generation for -O0 calls to std::forward_like, similar to std::move,std::forward and similar. Clang treats these as compiler internals rather than instantiating the definition from the standard library.
A large number of switches that the programmers use to control the compiler process have been added or eliminated. In addition to replacing -std=c++2b, for example -fdouble-square-bracket-attributes is obsolete. With the new switch -fcaret-diagnostics-max-lines=, developers control the maximum number of lines of code output for a caret diagnosis. When it comes to the keyword diagnoses – there are also innovations there: For example, the Clang team in C++20 warns against using capture of this with =, as it is officially obsolete.
There are changes for the following platforms that programmers and developers should familiarize themselves with if necessary: Aarch64, Aix, Amdgpu, ARM, AVR, Cuda/Hip, Loongarch, Risc-V, Webassembly, PowerPC and x86. There is also a wealth of Buxfixes in all areas.
The LLVM team specifically points out changes that can lead to problems compared to previous versions and that developers and programmers should keep an eye on. In C++, for example, Clang no longer looks for coroutine_traits in the std::experimental namespace for co-routines, but only for std::coroutine_traits. The team formulates further explicit warnings for C and ABIs.
A lot has also happened on the backend: With LLVM 17, the maintainers are increasing the requirement for building the backend itself to at least CMake 3.20.0. On the IR layer, LLVM 17 now ignores typed and opaqued pointers. Instructions that are supposed to know the addressed type in memory must contain the type argument itself. LLVMContextSetOpaquePointers in the C API is also omitted.
However, the compiler team has added the nofpclass attribute, which enables more optimizations for special floating point comparisons. In the compiler backend infrastructure, the development team has replaced the outdated optimization pipeline (PassManagerBuilder.h) with the new Passmanager API. Also new is a FatLTO pipeline that developers can use to create object files consisting of machine and LTO bitcode. Details can be found in the FatLTO documentation.
The maintainers have also made significant changes to the LLVM tools, for example the Json output of llvm-readobj and llvm-readelf is now more correct and clear. Platform news in the backend is available for Aarch64, Amdgpu, ARM, Loongarch, PowerPC, Risc-V, Webassembly, x86. The Python bindings are no longer required for all platforms.
Those interested can read more information about all the details and bug fixes in the change logs from LLVM and Clang.
To the home page
#Compiler #Duo #improvements #Clang #LLVM