{"id":9135,"date":"2016-06-03T10:10:39","date_gmt":"2016-06-03T17:10:39","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/vcblog\/?p=9135"},"modified":"2019-07-31T09:25:40","modified_gmt":"2019-07-31T09:25:40","slug":"clang-3-8-in-the-may-release-of-clang-with-microsoft-codegen","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/cppblog\/clang-3-8-in-the-may-release-of-clang-with-microsoft-codegen\/","title":{"rendered":"Clang 3.8 in the May release of Clang with Microsoft CodeGen"},"content":{"rendered":"<p><em>This blog post written by Dave Bartolomeo, Yuriy Solodkyy, and Andrew Pardoe<\/em><\/p>\n<p>We have just released\u00a0our fifth out-of-band update of Clang\/C2 toolset. As always, this release has been driven by your feedback. While we&#8217;ve heard a lot of feature requests the one&#8217;s we&#8217;ve heard most frequently are that you want Clang 3.8 and you want x64-hosted compilers. We&#8217;re happy to say that we&#8217;re shipping both Clang 3.8 and x64-hosted compilers in the May 2016 release.<\/p>\n<p>Clang 3.8\u00a0is\u00a0the latest official release of Clang. Moving to Clang 3.8 brings in roughly six months of features and bug fixes from the Clang community. We&#8217;ve also added x64-hosted versions of the Clang\/C2 compiler toolset. This enables you to compile\u00a0projects that require more memory than x86 can provide. The x64 Clang\/C2 toolset\u00a0also gives more compatibility with projects that\u00a0compile with the\u00a0x64-hosted MSVC toolset.<\/p>\n<p>This post focuses on changes since the last release. For a more\u00a0detailed discussion of the Clang\/C2 toolset please read &#8220;<a href=\"https:\/\/blogs.msdn.microsoft.com\/vcblog\/2016\/03\/31\/clang-with-microsoft-codegen-march-2016-released\/\">Clang with Microsoft CodeGen (March 2016) released<\/a>&#8221;\u00a0and any of the posts tagged with the keyword <a href=\"https:\/\/blogs.msdn.microsoft.com\/vcblog\/tag\/clang\/\">\u201cclang\u201d<\/a>.<\/p>\n<p>This release revises the version of C2.dll to 19.0.25317.0.<\/p>\n<h2>How to enable the x64-hosted Clang\/C2 compiler<\/h2>\n<p>To change your Visual Studio project to use the x64-hosted tools, you need to set the &#8216;PreferredToolArchitecture&#8217; MSBuild property to &#8216;x64&#8217;. This will set your project to use the x64-hosted version of the entire C++ toolset, whether you&#8217;re using Clang\/C2 or the MSVC compiler.<\/p>\n<p>There is currently no method to force the 64-bit tools in Visual Studio so you have to edit your .vcxproj file. Insert the following after the <code>&lt;Import...Microsoft.Cpp.Defaults<\/code> line:<\/p>\n<pre>  &lt;Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.Default.props\" \/&gt;\n  &lt;PropertyGroup&gt;\n    &lt;PreferredToolArchitecture&gt;x64&lt;\/PreferredToolArchitecture&gt;\n  &lt;\/PropertyGroup&gt;\n<\/pre>\n<p>The edit needs to be made after importing the properties file as it may get changed in one of the files it imports based on your host architecture. If you use -v (Enable Verbose mode in the IDE) in your compiler options, you\u2019ll see the full path to clang.exe in the output&#8211;make sure it includes the amd64 subdirectory.<\/p>\n<p>There are more details about this technique in this Stack Overflow post: <a href=\"http:\/\/stackoverflow.com\/questions\/19820718\/how-to-make-visual-studio-use-the-native-amd64-toolchain\">How to make Visual Studio use the native amd64 toolchain<\/a>.<\/p>\n<p>If you use a build system other than MSBuild, you&#8217;ll need to get your build system to pick up clang.exe from &#8216;C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\Clang 3.7\\bin\\<b>amd64<\/b>\\{x86|amd64|arm}\\clang.exe&#8217; instead of &#8216;C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\Clang 3.7\\bin\\<strong>x86<\/strong>\\{x86|amd64|arm}\\clang.exe&#8217;<\/p>\n<h2>How to get this update<\/h2>\n<h4>Through VS Notifications<\/h4>\n<p>If you already have the March 2016 update of Clang\/C2 installed you should receive a notification in the VS Notifications pane that this update is available. Click on that notification to begin the installation process.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/9\/2019\/02\/notification2.png\"><img decoding=\"async\" class=\"alignnone size-medium wp-image-9235\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/9\/2019\/02\/notification2-300x180.png\" alt=\"notification2\" width=\"300\" height=\"180\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<h4>Use the VS installer<\/h4>\n<ul>\n<li>Navigate to Control Panel-&gt;Programs-&gt;Programs and Features<\/li>\n<li>Right click on \u201cMicrosoft Visual Studio Enterprise 2015\u2033<\/li>\n<li>Click \u201cChange\u201d<\/li>\n<li>Click \u201cModify\u201d<\/li>\n<li>Select \u201cClang with Microsoft Codegen\u201d. Select the May 2016 release. The previous release is marked as \u201cDeprecated\u201d.<\/li>\n<li>Note: Because of very recent changes to the Visual Studio &#8220;15&#8221; installer, this version of Clang\/C2 is only available on Visual Studio 2015, not the next version of Visual Studio.<\/li>\n<\/ul>\n<h4>Create new project<\/h4>\n<p>When creating a new project you should see an option for two Clang projects in the Cross Platform section of the Visual C++ templates. Selecting one of these should install or update your Clang\/C2 tools to the latest version. Note that we are in the process of\u00a0removing the version number from the description due to maintenance issues.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/9\/2019\/02\/newproject.png\"><img decoding=\"async\" class=\"alignnone size-medium wp-image-9165\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/9\/2019\/02\/newproject-300x208.png\" alt=\"newproject\" width=\"300\" height=\"208\" \/><\/a><\/p>\n<h2>Bug Reporting<\/h2>\n<p>When submitting bug reports that are specific to Clang\/C2 (i.e. they are not reproducible in Clang\/LLVM), make sure to:<\/p>\n<ul>\n<li>Submit your issues at <a href=\"https:\/\/connect.microsoft.com\/VisualStudio\">https:\/\/connect.microsoft.com\/VisualStudio<\/a><\/li>\n<li>Prefix your bug report title with [Clang\/C2]<\/li>\n<li>When applicable, make sure to include preprocessed source(s) and associated run script(s) that are reported when you encounter an internal compiler error. Search for the string \u201cPLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:\u201d in your build log.<\/li>\n<\/ul>\n<p>As always, we\u2019re eager for you to try out the changes and give us feedback in the comments, by\u00a0email at <a href=\"mailto:\/\/clangc2@microsoft.com\">clangc2@microsoft.com<\/a>, or through any of the usual channels: <a href=\"http:\/\/visualstudio.uservoice.com\/forums\/121579-visual-studio-2015\">User Voice<\/a>, <a href=\"http:\/\/visualstudio.uservoice.com\/forums\/121579-visual-studio-2015\">Suggestions<\/a>, <a href=\"https:\/\/connect.microsoft.com\/visualstudio\">Connect<\/a> (for bugs), or even <a href=\"http:\/\/go.microsoft.com\/fwlink\/?LinkId=517102\">Send-A-Smile<\/a>. We love hearing from you!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This blog post written by Dave Bartolomeo, Yuriy Solodkyy, and Andrew Pardoe We have just released\u00a0our fifth out-of-band update of Clang\/C2 toolset. As always, this release has been driven by your feedback. While we&#8217;ve heard a lot of feature requests the one&#8217;s we&#8217;ve heard most frequently are that you want Clang 3.8 and you want [&hellip;]<\/p>\n","protected":false},"author":6384,"featured_media":35994,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[256],"tags":[255],"class_list":["post-9135","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-experimental","tag-clang"],"acf":[],"blog_post_summary":"<p>This blog post written by Dave Bartolomeo, Yuriy Solodkyy, and Andrew Pardoe We have just released\u00a0our fifth out-of-band update of Clang\/C2 toolset. As always, this release has been driven by your feedback. While we&#8217;ve heard a lot of feature requests the one&#8217;s we&#8217;ve heard most frequently are that you want Clang 3.8 and you want [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/posts\/9135","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/users\/6384"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/comments?post=9135"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/posts\/9135\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/media\/35994"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/media?parent=9135"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/categories?post=9135"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/tags?post=9135"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}