I’m working on a C++ source analyzer project and it seems that clang is nice candidate for
the parsing work. The problem is that clang heavily depends on the infrastructure “llvm” project,
How do I configure it to get a clean front-end without any concrete machine oriented backend?
Just like LCC does, they provide a “null” backend for people who focus on parser parts.
Any suggestion is appreciated.
I’m working on a C++ source analyzer project and it seems that clang is
Share
I recently did this on Windows.
Download the clang and llvm source from here.
Install cmake and Python (contrary to the docs, you do need Python just to build clang; at least, cmake gives up if it can’t find a Python runtime).
You also need VS2008 or VS2010.
One thing that’s not entirely obvious is the required directory structure:
And follow the windows build instructions from step 4 onwards. Don’t attempt to use the cmake GUI, it’s a horror; just use the commands given in the build instructions.
Once the build is complete (which takes a while) you’ll have:
Index.h defines the API to access information about your source code; it contains quite a bit of documentation about the APIs.
To get started using clang you need something like: