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

Mark Brown mbrowncu98 at gmail.com
Tue Sep 13 16:26:56 PDT 2011


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.

On Tue, Sep 13, 2011 at 7:23 PM, John McCall <rjmccall at apple.com> wrote:

> On Sep 13, 2011, at 4:20 PM, Mark Brown wrote:
> > My plugin now adds AnnotateAttr objects directly to VarDecls, and writes
> out the AST file. This AST file is compiled to clang, with the -S -emit-llvm
> options, and there is nothing about these AnnotateAttr in there. I can tell
> they are being add because they print to the screen before hand, but there
> are no traces in the IR file.
> >
> > I was expecting to see my string or atleast a reference to
> @llvm.var.annotation.
> >
> > Am I missing something?
>
> That should work.  It's possible that the attributes are not being
> serialized or deserialized properly;  I would check whether it works
> when you don't round-trip through an AST file.
>
> John.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20110913/eb703ca0/attachment.html>


More information about the cfe-dev mailing list