[cfe-dev] adding attribute bits to types

Mike Stump mrs at apple.com
Thu Aug 20 08:53:02 PDT 2009


On Aug 20, 2009, at 6:04 AM, Mattias Holm wrote:
> I am currently working on an experiment where I am adding additional
> type qualifiers on struct instances (this is done with the  
> __attribute__
> syntax).

You can put them into ExtQualType, if they have to be on the type.  If  
you see how they handle address spaces or the GC attributes, you just  
copy those bits, and you're done.  The rest of the system works to  
make what needs to happen, happen.  If you don't need them on the  
type, they are already on the decl, just fetch the attributes from the  
decl, see:

           if (FD->hasAttr<NoReturnAttr>()) {
             NoReturnEdge = true;
             HasFakeEdge = true;

for example, in SemaDecl.cpp.



More information about the cfe-dev mailing list