[cfe-dev] Range for CXFile

Jacob Carlborg doob at me.com
Sat Jan 10 05:05:06 PST 2015


On 2015-01-10 00:08, Milian Wolff wrote:

> It won't work. Think about something like this:
>
> // TODO: rewrite this file
>
> /**
>   * @file fubar
>   */
>
> /**
>   * this does bar
>   */
> void bar();
>
> if I understand the docs about the Documentation API correctly, I will only
> get access to the very last comment, as only stuff that "represents a
> documentable entity" can be passed to clang_Cursor_getParsedComment. Or am I
> missing something?

That might be correct, I didn't look so closely.

Your original question that your approach doesn't work for included 
files. If you visits all nodes in the tree shouldn't you eventually hit 
the nodes from the included files? In the tool I have that uses libclang 
I need to explicitly filter out nodes from included files.

Alternatively you could just parse the included files separately.

-- 
/Jacob Carlborg




More information about the cfe-dev mailing list