Hi List,
I have implemented the functionality of ‘Goto Declaration’ using the following pseudo code:
First, we obtain the cursor using ‘location’ and TU:
Hi List,
I have implemented the functionality of ‘Goto Declaration’ using the following pseudo code:
First, we obtain the cursor using ‘location’ and TU:
What about clang_getCursorDefinition. The documentation sounds like
this is what you're looking for but I might be wrong.
http://clang.llvm.org/doxygen/group__CINDEX__CURSOR__XREF.html
Thanks, that was what I was looking for
What about clang_getCursorDefinition. The documentation sounds like
this is what you’re looking for but I might be wrong.http://clang.llvm.org/doxygen/group__CINDEX__CURSOR__XREF.html
Thanks, that was what I was looking for
I celebrated too soon…
It worked on some cases, e.g.:
I issued the ‘find implementation’ from the source file where the implementation actually exists and it worked. But when I issued ‘Find Implementation’ from another source, it failed.
The logic to find the definition of a function is implemented like this:
At this point, the returned cursor is ‘InvalidFirst’
My guess is that libclang fails to find the implementation since it does not exists in the current TU
So the question is: how do I find a function definition which exists in another TU (but is associated to the same Index)
And in General are there any good practices to work with multiple translation units?
Off-topic question:
It seems to me that my questions are ‘user’ questions (as in ‘user of libclang’) but not really related to LLVM development… is this the correct mailing list?