[cfe-dev] tooling helper

Manuel Klimek klimek at google.com
Tue Nov 20 02:15:58 PST 2012


On Sat, Nov 17, 2012 at 10:43 PM, Chandler Carruth <chandlerc at google.com>wrote:

> On Sat, Nov 17, 2012 at 1:34 PM, Dmitri Gribenko <gribozavr at gmail.com>
> wrote:
> > On Sat, Nov 17, 2012 at 11:06 PM, Laszlo Nagy
> > <rizsotto.mailinglist at gmail.com> wrote:
> >> wrote a small program which might help to use the tools, which are
> using the
> >> tooling library. My understanding was that these tools need some
> compilation
> >> database. And one format is the JSON compilation database, which comes
> for
> >> free in a cmake project. Other projects could have difficulties to
> generate
> >> such file. And that's where a tool could help.
> >>
> >>   https://github.com/rizsotto/Bear
> >>
> >> It runs the build command and intercept the 'exec' calls, filters the
> >> compiler invocations and generate the output file. (It is using
> LD_PRELOAD
> >> from GNU Libc, so it is not really portable.)
> >>
> >> I know these kind of tools are out of scope here. But wanted to mention,
> >> because it could simplify to solve some cases. At least it did to me. ;)
> >
> > This is very interesting and useful.  Even more, something like this
> > could help Clang static analyzer to work with build systems that don't
> > respect CC and CXX environment variables.
>
> I don't know what the current state of this is, but waaaay back when
> the tooling stuff was going in directly, there was a flag to Clang
> itself that would cause Clang to write out the compilation database
>

You forgot the word "plan for" somewhere in that sentence? :)


> just so that it could be used with any build system which could use
> the Clang compiler. The hope was that this would serve the needs of
> the static analyzer and other tools in interoperating with arbitrary
> build systems. Does that not work for some folks?
>
> (We are aware that not everyone is using Clang as their compiler, but
> honestly using Clang for tools but not for the compilation isn't going
> to work terribly well given that Clang can't transform code it can't
> parse....)
>
> -Chandler
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20121120/8e22675c/attachment.html>


More information about the cfe-dev mailing list