News for hackers. Stuff that matters.
Re:Bringing Clang to Windows by ComputerGuru on Friday May 01, 2015 @05:52PM (#9474762)
As I understand it, it's not bringing Clang/LLVM's libc++ to Windows. The memory layout of, for example, std::string isn't decided by the compiler - it's decided by the library/header files. Both Clang and MSVC would be using the same MS C++ header files, so the only thing up to the compiler would anything that isn't specified in the header files, behind the scenes.

We're already using Clang with msbuild on Windows for native C11 support (come on, Microsoft!), courtesy of pre-built Clang for Windows binaries [1] - using the Microsoft C/C++ headers and linking against the Microsoft C/C++ runtimes.

There's already a plugin for MSVC that makes the Clang toolset available. VS 2013 (or maybe it was 2012?) decoupled the MSVC build chain/toolset from the IDE, making it possible to swap out which toolchain you're using from the project properties. Actually, it may have even been VS 2010, because I was using it to compile with ICC, but then again, I remember having a hell of a hard time so perhaps it was VS2012/2013.

1: http://llvm.org/docs/GettingStartedVS.html

Re:Bringing Clang to Windows by spongo2 on Friday May 01, 2015 @06:00PM (#9474795)
correct, this will use MS libraries. If you watch Jim Radigan's Build talk (he owns C2), he talks a little bit about how the ABI is really a part of the platform and it might clarify some of this. http://channel9.msdn.com/Events/Build/2015/3-714 about 23 minutes in. Thanks, Steve (vc dev mgr)
Re:Bringing Clang to Windows by DannyBee on Friday May 01, 2015 @09:26PM (#9475487)
Clang was already planning on using MS libraries/headers.

IE this is literally not different from what was already being done, without MS :)

Re:Bringing Clang to Windows by spongo2 on Saturday May 02, 2015 @02:56AM (#9476163)
yes, we are well aware that clang and llvm is working on targeting windows. this is clang+c2 which we will fully support.
Re:Bringing Clang to Windows by Someone on Friday May 01, 2015 @06:35PM (#9474951)
"The memory layout of, for example, std::string isn't decided by the compiler - it's decided by the library/header files."

Not quite true. Different compilers can decide to do different alignment/padding. It should be fairly simple to make clang and MSVC avoid that scenario, though.

Also, they must have taken care to use the same ABI and C++ name mangling rules in both compilers. I would guess Microsoft's version of clang follows MSVC here, so that one can link clang code to existing third party libraries.