[cfe-dev] C++11 attributes attached to a statement

Michael Haidl haidl at pacxx.org
Sat Dec 13 06:00:29 PST 2014


Hi!

I the easiest way for you to add a C++11 attribute to a statement is to follow the LoopHint attribute through the code.

The attribute is handled in ./lib/Sema/SemaStmtAttr.cpp

Cheers,
Michael Haidl


On December 13, 2014, Luis Miguel Sanchez Garcia <luismiguel.sanchez at uc3m.es> wrote:
> Hi all,
> 
> I'm adding some new non-standard C++ attributes in clang. I'm using this link
> <http://clang.llvm.org/docs/InternalsManual.html#include-clang-basic-attr-td>
> 
> I added an C++11 attribute in clang attached to a Function,
> * include/clang/Basic/Attr.td
> 
> 
> def CXX11MYOWNAttr : InheritableAttr {
> let Spellings = [CXX11<"my","ownattr", 201412>];
> let Subjects = SubjectList<[Function], ErrorDiag>;
> let Documentation = [Undocumented];
> }
> * lib/Sema/SemaDeclAttr.cpp
> 
> 
> in ProcessDeclAttribute function:
> 
> case AttributeList::AT_CXX11MYOWNAttr:
> handleSimpleAttribute<CXX11MYOWNAttr>(S, D, Attr);
> break;
> }
> 
> 
> however, I would like to include this to a statement.
> 
> Any help?
> 
> Thanks.
> 
> -- 
> -- 
> --------------------------------------------------
> Luis Miguel Sánchez García
> Computer Architecture and Technology Area.Office 2.2.B08
> Computer Science Department. UNIVERSIDAD CARLOS III DE MADRID
> Universidad Carlos III de Madrid
> Avda. de la Universidad, 30
> 28911 Leganés - Madrid - Spain
> e-mail: <lmsan at arcos.inf.uc3m.es>
> <luismiguel.sanchez at uc3m.es>
> 
> 
> Phone: (+34) 91 624 5951
> 
> Linked-In: <http://es.linkedin.com/in/lmsan>
> Twitter: <http://twitter.com/lmsanchezgarcia>
> --------------------------------------------------
> _______________________________________________
> 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/20141213/3d0f983a/attachment.html>


More information about the cfe-dev mailing list