
Microsoft will add support for the Clang compiler in the November update of Visual Studio 2015 - this was announced at the CPPCon 2015 conference, now taking place in Bellevue, USA.
Clang is a compiler for C, C ++ and Objective-C code, which, in conjunction with LLVM, allows you to build programs for various platforms. Visual Studio 2015 already supports Clang for developing Android and iOS applications. When developing for Android, you can choose between GCC and Clang, and for iOS you have to use an external Mac as a build server.
')
The planned update will bring support for Clang at a qualitatively new level - now they will be able to build regular Windows applications.
The Visual C ++ compiler consists of several parts: the frontend part responsible for generating an AST (abstract syntax tree) corresponding to the program code and a backend part that reads the AST and generates executable code. The frontend part calls C1, the backend part is called C2, and different teams work on them.
Clang is planned to be added as a replacement for C1, while C2 will continue to be used for its intended purpose. As Jim Redigan’s temlid backend told us, Clang will create an intermediate representation of the code, which will then be converted into a format compatible with C2, which Jim called a set of tuples. Further, C2 will generate the executable code using the Universal Tuple Compiler.
The main task of creating a Clang / C2 bundle is to facilitate cross-platform application development for both Microsoft itself and third-party developers. Many applications could render their non-visual parts into separate components, which would be assembled uniformly, by the same Clang compiler under different operating systems.
The example was Microsoft Office, the mobile version of which is currently available for Android, iOS and Windows 10 Universal Windows Platform. When using Clang as a front-end compiler, the common code of all these applications could be built in the same way, eliminating the occurrence of bugs due to differences in Clang and C1.
Developers should accept Clang support well because of its better compliance with the latest C ++ standards. However, Microsoft does not stop supporting C1, its development will continue, because in the version of the C ++ standard from Microsft there are some specific additions and for those programs that use them, you still need C1 for assembly. In addition, the speed of the assembly of the code in the long-time running combination C1 \ C2 is somewhat higher.
Jim Redigan noted that Microsoft will not fork Clang, but will focus on adding code for the Windows platform to its main branch. At the same time, Clang will not be required to do anything special to support C2, Microsoft will do everything necessary for compatibility on its side.
The planned update in November with the support of Clang will have the status of "preview", and the main release is planned for February 2016.
In addition to Clang support, other innovations are planned, for example, support for “await” in accordance with the current proposal from Microsoft.
A new version of the compiler will also be released, allowing you to use the Clang / C2 bundle from the command line (without the need to buy and install the Visual Studio IDE).