[cfe-dev] [RFC] Embedding compilation database info in object files.

James Dennett james.dennett at gmail.com
Wed Jul 17 22:49:17 PDT 2013


On Wed, Jul 17, 2013 at 10:15 PM, Daniel Albuschat
<d.albuschat at gmail.com> wrote:
> 2013/7/18 Manuel Klimek <klimek at google.com>
>>
>> On Thu, Jul 18, 2013 at 6:36 AM, Sean Silva <silvas at purdue.edu> wrote:
>>>
>>> tl;dr: compiler embeds compilation db info in object files; you can then
>>> collect it afterwards with simple tools. Good idea?
>>>
> [snip]
>>>
>>> The basic idea is that instead of generating the compilation database
>>> "before compilation, by something that knows about the build a priori", have
>>> the compilation database info come out "the back of the compiler a
>>> posteriori" and follow the natural flow of information through the build
>>> pipeline, and eventually be recovered from build products.
>
> [snip]
>>
>>
>> We have done similar things before internally, but considered it more to
>> be a hack ;)
>>
>> I think the direction that we want to go to is to have an option in clang
>> to append to a compilation database while running - that way, no
>> post-processing step is required, which again needs to be somehow put into
>> the build flow. The only part missing is somebody with enough time on their
>> hands for whom this is high enough priority.
>
>
> Hello,
>
> by "Compilation Database", do you mean namespace, function, enum, class,
> struct definitions, etc.?

In this context Compilation Database is (roughly) a description of the
compilation commands that are used to build a project.

One supported format for this is JSON, see
http://clang.llvm.org/docs/JSONCompilationDatabase.html.

-- James



More information about the cfe-dev mailing list