[llvm-dev] Use LLVM C API for reading metadata

Guang Chen via llvm-dev llvm-dev at lists.llvm.org
Sun Aug 12 23:12:31 PDT 2018


Hi everyone,

I’m looking forward to reading metadata by C API. Currently I can get the metadata reference but I cannot find any API for determine its type (e.g. DILocation, DIVariable) nor find any API for reading its field (e.g. DILocation’s line and column). The only walk around is us LLVMPrintValueToString method and parse the string manually. However, I’m using JNI to call the C API and this method is very slow. For a program with 30K LOC, printing the metadata as string may take about 5 minutes. It is not acceptable since we need to analysis program with millions LOC.

So is there any possibility to get the metadata information easily like in C++?

Guang Chen





-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: Message signed with OpenPGP
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20180813/bc2d5c8a/attachment.sig>


More information about the llvm-dev mailing list