[cfe-dev] clang_getCursorUSR : reverse?
dgregor at apple.com
Tue Jan 25 07:51:01 PST 2011
On Jan 24, 2011, at 8:53 PM, Michael Mullin wrote:
> I might be misunderstanding clang_getCursorUSR. I believe it's purpose is to facilitate comparing entities across translation units, but Im not quite sure how to exactly go about the comparison.
> Is the client program supposed to recursively descend (visitChildren) the second translation unit, testing clang_getCursorUSR on each cursor against the cursor from the first translation unit it wants to find?
Yes, that's one way. The assumption that libclang makes is that there is some external database that will help perform mappings across
> is there a way to keep this functionality "inside" the libclang api rather than have the client be responsible for it?
> since there is a function
> CXString clang_getCursorUSR( CXCursor );
> should there be a function
> CXCursor clang_getCursorFromUSR( CXString );
I think that would make a great addition. It's going to require writing the equivalent of a demangler for USRs (mapping from USRs to entity names and such) along with a localized search to find matching USRs, but it would be really useful.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the cfe-dev