[cfe-dev] How to get symbol's info. when the symbol is in macro instantiation

jiyang zhao zjyzhaojiyang at yahoo.com.cn
Tue Jan 25 19:20:30 PST 2011


Sorry for another post.

I make another test using c-index-test, and get a similar result.
//run
./c-index-test -cursor-at=/home/lucency/Study/source/lua/src/lcode.c:45:21 /home/lucency/Study/source/lua/src/lcode.c -I/home/lucency/Study/source/lua/src/

//result
UnexposedStmt=

Do i miss something?

PS. 
1.c-index-code is built about ten days ago using code checkout from svn.
2.As you can see, the test input files come from lua.

--- 11年1月25日,周二, Douglas Gregor <dgregor at apple.com> 写道:

发件人: Douglas Gregor <dgregor at apple.com>
主题: Re: [cfe-dev] How to get symbol's info. when the symbol is in macro instantiation
收件人: "jiyang zhao" <zjyzhaojiyang at yahoo.com.cn>
抄送: cfe-dev at cs.uiuc.edu
日期: 2011年1月25日,周二,下午11:53


On Jan 25, 2011, at 12:30 AM, jiyang zhao wrote:

Hi list
I meet a problem about macro when using libclang, when i want to get a viriable's infomation which is in a macro instantiation, for example, its linkage kind, i get 200(UnexposedStmt), is this the expected result? If so, how can i get the exact information of the symbol(e.g. previous in following code, SETARG_B is macro)?

//example
SETARG_B(*previous, from+n-1);

Thanks

This reference to previous will show up as a CXCursor_DeclRefExpr cursor. You can then use clang_getCursorReferenced() to find the declaration that the cursor points to.
	- Doug




      
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20110126/c7dbc4c4/attachment.html>


More information about the cfe-dev mailing list