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

comments powered by Disqus


  • How to Create a Machine Learning Decision Tree Classifier Using C#

    After earlier explaining how to compute disorder and split data in his exploration of machine learning decision tree classifiers, resident data scientist Dr. James McCaffrey of Microsoft Research now shows how to use the splitting and disorder code to create a working decision tree classifier.

  • Microsoft: Move from Traditional ASP.NET to 'Core' Requires 'Heavy Lifting'

    There are plenty of reasons to move traditional ASP.NET web apps -- part of the old .NET Framework -- to the new cross-platform direction, ASP.NET Core, but beware it will require some "heavy lifting," Microsoft says.

  • Purple Blue Nebula Graphic

    How to Compute Disorder for Machine Learning Decision Trees Using C#

    Using a decision tree classifier from a machine learning library is often awkward because it usually must be customized and library decision trees have many complex supporting functions, says resident data scientist Dr. James McCaffrey, so when he needs a decision tree classifier, he always creates one from scratch. Here's how.

  • Blazor's Future: gRPC Is Key

    Blazor guru Steve Sanderson detailed what Microsoft is thinking about the future of the revolutionary project that enables .NET-based web development using C# instead of JavaScript, explaining how gRPC is key, along with a new way of testing and a scheme for installable desktop apps.

  • Don't Do It All Yourself: Exploiting gRPC Well Known Types in .NET Core

    If you're creating business services that send dates and decimal data then you may be concerned that gRPC services don't support the relevant data types. Don't Panic! There are solutions. Here's how to use them.

.NET Insight

Sign up for our newsletter.

Terms and Privacy Policy consent

I agree to this site's Privacy Policy.

Upcoming Events