Ouch, this is painful. So even Annotations/Attributes are not allowed? Both seem particular useful and trivial, along with safe.<br><br>I'm asking this mostly because I'm saving the AST I modified myself and then later calling clang on it. So it seems like it doesn't matter if CodeGen already ran the first time, its the second that counts.<br>
<br>Sorry if I'm still beating a dead horse about this, I'm a bit confused and cant imagine why something like this wouldn't be much easier and a basic feature. Keep thinking I'm missing something simple.<br>
<br>Thanks everyone<br><br><div class="gmail_quote">On Tue, Sep 13, 2011 at 8:40 PM, Nico Weber <span dir="ltr"><<a href="mailto:thakis@chromium.org">thakis@chromium.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Ah, didn't read the start of the thread. The AST is effectively<br>
immutable once built: If you change it, you might break invariants<br>
that modules further down the road make. That's why -add-plugin<br>
plugins run after codegen.<br>
<font color="#888888"><br>
Nico<br>
</font><div><div></div><div class="h5"><br>
On Tue, Sep 13, 2011 at 5:37 PM, Mark Brown <<a href="mailto:mbrowncu98@gmail.com">mbrowncu98@gmail.com</a>> wrote:<br>
> Thanks, that does run without error.<br>
><br>
> Still no difference in the IR file though<br>
><br>
> On Tue, Sep 13, 2011 at 8:33 PM, Nico Weber <<a href="mailto:thakis@chromium.org">thakis@chromium.org</a>> wrote:<br>
>><br>
>> -add-plugin? :-)<br>
>><br>
>> On Tue, Sep 13, 2011 at 5:28 PM, Mark Brown <<a href="mailto:mbrowncu98@gmail.com">mbrowncu98@gmail.com</a>> wrote:<br>
>> > error: unknown argument: '-plugin-add'<br>
>> ><br>
>> > Full use was: clang -cc1 -load<br>
>> > ~/llvm/Release+Asserts/lib/libPrintFunctionNames.so -plugin-add<br>
>> > print-fns<br>
>> > double_assigns.c<br>
>> ><br>
>> > On Tue, Sep 13, 2011 at 8:21 PM, Joshua Cranmer <<a href="mailto:Pidgeot18@gmail.com">Pidgeot18@gmail.com</a>><br>
>> > wrote:<br>
>> >><br>
>> >> On 9/13/2011 6:26 PM, Mark Brown wrote:<br>
>> >> > Theres a direct way todo this? How can I avoid writing a AST file?<br>
>> >> > When I run<br>
>> >> ><br>
>> >> > clang -cc1 -load ~/llvm/Release+Asserts/lib/libPrintFunctionNames.so<br>
>> >> > -plugin print-fns test_file.c<br>
>> >> > or<br>
>> >> > clang -cc1 -load ~/llvm/Release+Asserts/lib/libPrintFunctionNames.so<br>
>> >> > -plugin print-fns test_file.c -S -emit-llvm<br>
>> >> ><br>
>> >> > I don't get any output, just my own printouts.<br>
>> >><br>
>> >> Try s/-plugin/-plugin-add/.<br>
>> >><br>
>> >> --<br>
>> >> Joshua Cranmer<br>
>> >> News submodule owner<br>
>> >> DXR coauthor<br>
>> >><br>
>> >> _______________________________________________<br>
>> >> cfe-dev mailing list<br>
>> >> <a href="mailto:cfe-dev@cs.uiuc.edu">cfe-dev@cs.uiuc.edu</a><br>
>> >> <a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev</a><br>
>> ><br>
>> ><br>
>> > _______________________________________________<br>
>> > cfe-dev mailing list<br>
>> > <a href="mailto:cfe-dev@cs.uiuc.edu">cfe-dev@cs.uiuc.edu</a><br>
>> > <a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev</a><br>
>> ><br>
>> ><br>
><br>
><br>
</div></div></blockquote></div><br>