News

Clang with Microsoft CodeGen: A VS 2015 Update 1 Gem

It's just one facet of the recent Visual Studio 2015 Update 1 release, but it's one that Visual C++ developers are excited to deploy. The update also includes numerous fixes to the standard library.

The Visual C++ team has introduced a new toolset in preview aimed at allowing code written with Visual C++ to be compiled and parsed for a number of differing platforms and targets. Clang with Microsoft CodeGen is a compiler that pairs up an open source version of the Clang parser with Visual C++'s code generator, optimizer and compiler.

Dave Bartolomeo with the Visual C++ team writes in a blog post that the goal is to allow developers using Visual C++ to use "the same Clang parser that you use for other targets, while still taking advantage of the advanced optimizations from the Visual C++ optimizer when you build for Windows."

"Because the new toolset uses the same Clang parser used for non-Windows targets, you won't need to have annoying #ifdefs throughout the code just to account for differences between the compilers," explains Bartolomeo, in the post. "Also, your code can take advantage of language features that are not currently available in the Visual C++ compiler, including C99 complex types and C++14 extended constexpr support. And because the Clang-based compiler generates the same debug information format as the Visual C++ compiler, you'll still be able to debug your code with the same great Visual Studio debugger experience."

Related to Bartolomeo's post, a few days earlier Visual C++ team member Cody Miller blogged about support for C++ 11-variety constant expressions that are part of the Visual Studio 2015 Update 1 release. An issue that reared up its head during development, wrote Miller, was that the compiler was having a problem with emitting static initializers. "Although the compiler had enough information to emit fully instantiated types that could be loaded from the compiled executable, it didn't emit the fully instantiated types," he explained. "These types were instantiated and constructed at runtime, as most C++ objects traditionally have been." Update 1 ships with the issue resolved.

Visual Studio 2015 Update 1 also includes a vast list of fixes to the Visual C++ Standard Library, noted here and in several links embedded in that link.

About the Author

You Tell 'Em, Readers: If you've read this far, know that Michael Domingo, Visual Studio Magazine Editor in Chief, is here to serve you, dear readers, and wants to get you the information you so richly deserve. What news, content, topics, issues do you want to see covered in Visual Studio Magazine? He's listening at [email protected].

comments powered by Disqus

Featured

  • Compare New GitHub Copilot Free Plan for Visual Studio/VS Code to Paid Plans

    The free plan restricts the number of completions, chat requests and access to AI models, being suitable for occasional users and small projects.

  • Diving Deep into .NET MAUI

    Ever since someone figured out that fiddling bits results in source code, developers have sought one codebase for all types of apps on all platforms, with Microsoft's latest attempt to further that effort being .NET MAUI.

  • Copilot AI Boosts Abound in New VS Code v1.96

    Microsoft improved on its new "Copilot Edit" functionality in the latest release of Visual Studio Code, v1.96, its open-source based code editor that has become the most popular in the world according to many surveys.

  • AdaBoost Regression Using C#

    Dr. James McCaffrey from Microsoft Research presents a complete end-to-end demonstration of the AdaBoost.R2 algorithm for regression problems (where the goal is to predict a single numeric value). The implementation follows the original source research paper closely, so you can use it as a guide for customization for specific scenarios.

  • Versioning and Documenting ASP.NET Core Services

    Building an API with ASP.NET Core is only half the job. If your API is going to live more than one release cycle, you're going to need to version it. If you have other people building clients for it, you're going to need to document it.

Subscribe on YouTube