[cfe-dev] How to get custom __declspec using clang API

翔哥 15200099141 at qq.com
Sun Oct 5 01:19:34 PDT 2014


Hi,


   Recently, I am using clang API using C++ to parse VC in Windows, but I want to add new custom attribute(GUN) or __declspec(MS) for somehow adding new features to C++ in order to do automatic code generation. Are there anything methods(API) or suggestions?‍‍
The following are my test result:


class  __declspec("test") Test_Class{}; 


The AST printer result of above code does not contain a clang:Attr, while I look inside the 'ParseDecl.cpp', it actually parse the __declspec("test") and add it to the AttributeList. How can I get it?‍‍




Regards,
Vincky
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20141005/bd57485c/attachment.html>


More information about the cfe-dev mailing list