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

John McCall rjmccall at apple.com
Tue Sep 13 16:23:39 PDT 2011


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.



More information about the cfe-dev mailing list