[cfe-dev] LibTooling in the absence of a compilation database

Russell Wallace via cfe-dev cfe-dev at lists.llvm.org
Wed Dec 2 01:35:47 PST 2015


Tools built with LibTooling default to using a compilation database if one
is available, which is good.

In the case where a compilation database is not available, there is a
problem: the default behavior is to exit with an error message, whereas in
some cases the tool would be required to do the best it can anyway. This
can be achieved by adding -- to the end of the command line, but this
wouldn't be obvious to someone unfamiliar with Clang tools.

One solution would be for the program to append -- to argv if it's not
already present, but would this disable the default useful behavior of
reading the compilation database if it is available?

If so, is there a way for the program to say 'okay, check for a compilation
database as normal, but if it's not present, let me know and I'll fill in
some best-guess default options'?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20151202/45527bbe/attachment.html>


More information about the cfe-dev mailing list