[cfe-dev] manipulating @llvm.var.annotation in AST?

Mark Brown mbrowncu98 at gmail.com
Tue Sep 13 17:46:45 PDT 2011


Ouch, this is painful. So even Annotations/Attributes are not allowed? Both
seem particular useful and trivial, along with safe.

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.

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.

Thanks everyone

On Tue, Sep 13, 2011 at 8:40 PM, Nico Weber <thakis at chromium.org> wrote:

> Ah, didn't read the start of the thread. The AST is effectively
> immutable once built: If you change it, you might break invariants
> that modules further down the road make. That's why -add-plugin
> plugins run after codegen.
>
> Nico
>
> On Tue, Sep 13, 2011 at 5:37 PM, Mark Brown <mbrowncu98 at gmail.com> wrote:
> > Thanks, that does run without error.
> >
> > Still no difference in the IR file though
> >
> > On Tue, Sep 13, 2011 at 8:33 PM, Nico Weber <thakis at chromium.org> wrote:
> >>
> >> -add-plugin? :-)
> >>
> >> On Tue, Sep 13, 2011 at 5:28 PM, Mark Brown <mbrowncu98 at gmail.com>
> wrote:
> >> > error: unknown argument: '-plugin-add'
> >> >
> >> > Full use was: clang -cc1 -load
> >> > ~/llvm/Release+Asserts/lib/libPrintFunctionNames.so -plugin-add
> >> > print-fns
> >> > double_assigns.c
> >> >
> >> > On Tue, Sep 13, 2011 at 8:21 PM, Joshua Cranmer <Pidgeot18 at gmail.com>
> >> > wrote:
> >> >>
> >> >> On 9/13/2011 6:26 PM, Mark Brown wrote:
> >> >> > Theres a direct way todo this? How can I avoid writing a AST file?
> >> >> > When I run
> >> >> >
> >> >> > clang -cc1 -load
> ~/llvm/Release+Asserts/lib/libPrintFunctionNames.so
> >> >> > -plugin print-fns test_file.c
> >> >> > or
> >> >> > clang -cc1 -load
> ~/llvm/Release+Asserts/lib/libPrintFunctionNames.so
> >> >> > -plugin print-fns test_file.c -S -emit-llvm
> >> >> >
> >> >> > I don't get any output, just my own printouts.
> >> >>
> >> >> Try s/-plugin/-plugin-add/.
> >> >>
> >> >> --
> >> >> Joshua Cranmer
> >> >> News submodule owner
> >> >> DXR coauthor
> >> >>
> >> >> _______________________________________________
> >> >> cfe-dev mailing list
> >> >> cfe-dev at cs.uiuc.edu
> >> >> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
> >> >
> >> >
> >> > _______________________________________________
> >> > 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/20110913/a7695f07/attachment.html>


More information about the cfe-dev mailing list