[cfe-dev] Is loading a plugin expected to change include search directories?

Sean Silva silvas at purdue.edu
Fri Mar 16 19:39:34 PDT 2012


The only way that I know of is to use all that `-Xclang` mumbo jumbo.
Luckily that script takes care of it in a fairly straightforward fashion.

There's a patch in the works that will simplify all the argument passing
and plugin invocation, but I don't know if it has been accepted yet (or if
it even will be accepted).

--Sean Silva

On Fri, Mar 16, 2012 at 5:31 PM, Philip Reames <listmail at philipreames.com>wrote:

> Thank you for the clarification.  I've gotten it working for now.
>
> Is there another way to load a plugin and invoke it which does not undo
> all the argument parsing/defaults?  I suspect that many plugins *want* all
> the argument parsing the frontend does.  I can see some plugins wanting to
> do their own argument parsing/defaults, but this doesn't seem like the most
> common case by far.  Thoughts?
>
> Yours,
> Philip Reames
>
>
> On 03/15/2012 08:48 PM, Sean Silva wrote:
>
>> Try this example plugin:
>> https://github.com/**chisophugis/clang_plugin_**example<https://github.com/chisophugis/clang_plugin_example>
>>
>> The script invocation_builder.py assembles the commandline options to
>> the normal `clang++` executable so that they get passed down to the
>> plugin correctly and such. That way you get to benefit from the "normal"
>> resolution of header search dirs that `clang++` before calling into
>> `-cc1`.
>>
>> This is something that I grappled with for a long time, and that was my
>> solution.
>>
>> On Thu, Mar 15, 2012 at 11:35 PM, Eli Friedman <eli.friedman at gmail.com
>> <mailto:eli.friedman at gmail.com**>> wrote:
>>
>>    On Thu, Mar 15, 2012 at 8:07 PM, Philip Reames
>>    <listmail at philipreames.com <mailto:listmail at philipreames.**com<listmail at philipreames.com>>>
>> wrote:
>>     > I'm seeing some unexpected behavior when loading a plugin for Clang.
>>     > Essentially, it appears that loading a plugin clears the default
>>    paths
>>     > from the include search list.
>>
>>    No, using clang -cc1 directly does that.
>>
>>    -Eli
>>    ______________________________**_________________
>>    cfe-dev mailing list
>>    cfe-dev at cs.uiuc.edu <mailto:cfe-dev at cs.uiuc.edu>
>>    http://lists.cs.uiuc.edu/**mailman/listinfo/cfe-dev<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/20120316/82f824ac/attachment.html>


More information about the cfe-dev mailing list