[cfe-dev] Clang AddIn for Visual Studio 2010
Francois Pichet
pichet2000 at gmail.com
Sat Jun 18 13:24:51 PDT 2011
On Sat, Jun 18, 2011 at 3:17 PM, ishani <harry.denholm at gmail.com> wrote:
> Hello all,
>
> For anyone hacking with Clang on Windows alongside the MSVC toolchain (like
> me!), I've put together a 'compiler bridge' that will let you build
> executables from inside Visual Studio using Clang as a drop-in replacement
> for the MSVC compiler.
>
> It emulates (most of) the VS build pipeline and translates VC project
> settings into arguments that Clang understands. Still early days, but so far
> it can compile a modest range of test projects successfully (including some
> DirectX bits and pieces). I've also added entries to the code window context
> menu for doing static analysis on single files. Works a treat.
>
> Source and built executables are available on GitHub:
> https://github.com/ishani/ClangVSx https://github.com/ishani/ClangVSx
>
> As the readme states, there are a few things you might need to patch in
> Clang (has links to bug #s) to get Win32 apps building cleanly. Your mileage
> will vary!
>
> -h
That's really great. Writing such a plugin was on my todo list but I
am glad you did it before me.
I'll try your tool very soon.
You mention that a IUnknown hack is required to parse a DirectX
project. I suppose your hack is to add a "class IUnknown;" forward
declaration at the beginning. You can use the clang option
-fdelayed-template-parsing instead. The problem is that IUnknown is
used in template code before it is defined.
As for clang not be able to parse the MFC/ATL projects. Just to let
you know I am working on this problem now. At the pace I am going, I
estimate we are 2-3 months away from that goal.
More information about the cfe-dev
mailing list