[cfe-dev] CompilationDatabase support added to libclang and python binding

David Röthlisberger david at rothlis.net
Tue Jun 12 01:13:46 PDT 2012

First of all, thanks Arnaud for this work, I'm going to be making use of it soon!

Second, and this isn't directly related to your patch, but: Could we please have some documentation on the format of the compile_commands.json? (Manuel?). I couldn't find anything in the cmake docs. In particular, what is the "directory" supposed to be -- the root of your source directory? If you have a "recursive make" build system, would "directory" be the directory of the innermost invocation of make? Or simply the $PWD for the invocation of "command"? (this can differ from make's $PWD if the recipe explicitly contained a "cd"). Can "file" be a relative path from that directory?

Finally, what is the meaning of having multiple compilation commands for a single file?


On 12 Jun 2012, at 08:28, Arnaud de Grandmaison wrote:
> Hi Manuel and Gregory,
> Here are the patches for a second round of review. I took into account
> most of
> your suggestions, if not all.
> Here are the changes with respect to the previous set of patches.
> Regarding cindex:
> - Index.h : declaration order changed to be more reader friendly
> - CompilationDb moved to CompilationDatabase
> - the clang_tooling_ prefix is kept for now, expressing this
> functionality comes
>   from a different module. We may want to move it into another header
> then Index.h
>   to even better express this. Which name should it have ? Tooling.h is
> already
>   in use. Beside the logical isolation, do we want a physical one, i.e.
> have a
>   separate library for tooling C interface ?
> - the naming convention is now using consistently
> clang_tooling_<thing>_<action>
> - i have not yet added the other available ways of loading a database.
> This can
>   probably be done later on, on demand
> - i have not yet added higher level helpers like
>   clang_tooling_CompileCommand_getCmdLine. This should come latter,
> depending
>   on actual needs and uses.
> Regarding the python binding:
> - space added after comma for the arguments of function calls
> - method summary now on one line, when it is small enough to fit in 80
> columns.
> - properties name have been changed to noun
> - yield used instead of iterator for CompileCommand
> - CompileCommands is no longer a hidden object.
> - CompilationDb moved to CompilationDatabase
> - from_result method used for checking CompilationDatabase &
> CompileCommands
> - test_cdb.py : comparisons are now done using lists
> Cheers,
> -- 
> Arnaud de Grandmaison
> <0001-cindex-cdb.patch><0002-cindex-cdb-python.patch>_______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev

More information about the cfe-dev mailing list