[cfe-dev] How clang is seen outside the community (Was: Re: david's integer overflow stuff)

Chandler Carruth chandlerc at google.com
Fri Sep 17 18:09:00 PDT 2010


As I am also rather surprised by this perception, here is my perspective
leading a team external to Apple doing exactly this -- building user-facing
tools on top of Clang:

On Fri, Sep 17, 2010 at 5:49 PM, Douglas Gregor <dgregor at apple.com> wrote:

> I have no idea where this came from, but there are several ways to
> accomplish the task that the author alludes to (extending Clang to build
> their own tool) that are better than what s/he's describing:
>
>        (1) Use Clang's Frontend library with their own driver or UI, so
> s/he has total control over the interface, whether it be different
> command-line arguments or something with checkboxes. Toggling bits in
> ClangInvocation would work perfectly fine.
>

Yep. We have tools that do this, many of them in fact. The APIs have rough
edges, but they work well. We've had great success here.

Ironically, a large enabler for us was the ability to re-use the exact
aspect of Clang that is being complained about -- GCC flag compatible
parsing. Our tools work hard to co-exist with GCC flags and usages which are
very prevalent, and being able to at a moments notice drop down and ask
Clang to parse a set of GCC or Clang flags was incredibly useful.


>        (2) Teach Clang's driver to pass -load and -plugin through to -cc1.
> A few minutes of coding eliminates the entire problem of having to think
> about -cc1. Users would just use something like
>

Doesn't "clang++ -Xclang -plugin -Xclang ..." work today? Maybe that's "too
gross"...
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20100917/3e49252e/attachment.html>


More information about the cfe-dev mailing list