Dec 262013
 

Terrific tool. But you still have to tame it.

Installation (Visual Studio 2013)

Clone git repositories for llvm & clang: 

Skip the SVN stuff and build with CMake:


Usage (tools)

First tests were daunting. I'm currently interested in static analysis, so I started a simple clang -H test.cpp.
The program stopped immediately, complaining about several constructs from C++ standard headers. For the time being, this is a problem with Microsoft's implementation of the C++ standard library.

A remedy lies in providing more clang-friendly standard library files. I am utilizing headers from the current mingw32 distribution. These are added to the tools with the -I command line switch (you have likely to provide multiple paths). With this, things started to work.

Usage (from code)

As a first step, I modified a pet project (https://github.com/pukkaone/find-unnecessary-includes). Including some more wisdom, creating a VS2013 solution was simple and easy (save a few manually added library dependencies).

At this point, the complete AST is accessible, and clang begins to shine. This is something incredibly expressive and rich in structure.
 

Edit:
Currently, transfering project knowledge from Visual Studio to clang is still in an unsatisfying state. This limits the application of clang on non-trivial code bases. Regarding tooling, the discussion states here: "Patches for a CompilationDatabase implementation that just reads from msbuild would be super-welcome" . I agree.