Hello,

I am new to Clang, LLVM and have some questions regarding attaching comments to 
the clang AST. I would like to parse a C/C++ file and get preceeding comments 
to variable declarations and attach these to the AST. The comments are 
annotations of model objects in the source code. I need to get the source 
location for certain actions in the model based on these comments.

So far I can visit the VarDecl, statements using the ASTRecursive visitor. I 
have read several tutorials and searched, but could not find any straight 
forward way of reading the comments and attaching it to the AST node. I also 
noticed that the getRawCommentForDeclNoCache(VarDecl) is always null. From one 
of the tutorials it was mentioned that the option -fparse-all-comments must be 
passed to clang inorder to have non-doxygen style of comments.

Can someone please provide me with more clarification on this? Why do I always 
get nullptr for  getRawCommentForDeclNoCache(VarDecl). Where to pass this 
option.

Thanks inadvance,

Bewoayia
 
_______________________________________________
cfe-users mailing list
cfe-users@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-users

Reply via email to