[cfe-dev] CodeGen and AnnotateAttr objects

Julien Lerouge jlerouge at apple.com
Wed Sep 14 13:57:06 PDT 2011


On Tue, Sep 13, 2011 at 08:27:02PM -0400, Mark Brown wrote:
> I'm trying to figure out how Clang's CodeGen deals with AnnotateAttr
> objects. The only uses of "AnnotateAttr" I can find in the CodeGen directory
> seem to point to CodeGenModule::EmitAnnotateAttr(). The comment here seems
> to imply that this function will only handle AnnotateAttrs on GlobalValues.
> 
> How/where does it handle AnnotateAttrs on VarDecls, or even regular Decls?
> I'm asking because I have added some AnnotateAttrs to VarDecls in a plugin,
> had that plugin write out its AST file and then let clang compile it(with -S
> -emit-llvm). There was no references to my string(used in the AnnotateAttrs)
> or even of something like @llvm.var.annotation. So for some reason they are
> not making it to the IR and I have no idea why.
> 
> Thank you

Hello Mark,

Support for codegen of AnnotateAttr on VarDecls was added in r139423,
which is fairly recent. If you look at the current TOT, you should have
more code that deals with AnnotateAttr.

http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20110905/046156.html

Julien

-- 
Julien Lerouge
PGP Key Id: 0xB1964A62
PGP Fingerprint: 392D 4BAD DB8B CE7F 4E5F FA3C 62DB 4AA7 B196 4A62
PGP Public Key from: keyserver.pgp.com



More information about the cfe-dev mailing list