[cfe-dev] clang via JNI + libclang-c

Anton Smirnov dev at antonsmirnov.name
Fri Oct 11 00:02:17 PDT 2013


Hey.

I'm facing with very strange behaviour of clang via JNI.
I have java class and native methods call libclang-c functions.

So i have to hold CXIndex and CXTranslationUnit pointers
and hold reference in java objects to instances.

If i do everything in the same native call (create index, parse, tokenize,
dispose), it's okay.
But if i do in few native function invocations, CXIndex and
CXTranslationUnit are corrupted (even if the CXIndex and CXTranslationUnit
pointers are the same).

I can provide additional info and full source code if necessary.
Are there any obvious limitations or anybody with such experience?

Regards, Anton.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20131011/866e3025/attachment.html>


More information about the cfe-dev mailing list