开发者

Parsing LLVM bitcode from Java

Is there a way to parse LLVM bitcode in my Java application? In other words, is there any library that has Java binding and can p开发者_开发百科arse LLVM bitcode, which I could then access using some DOM or any other way?

Note that I'm not trying to convert LLVM bitcode to Java bytecode, just trying to parse LLVM bitcode into some workable representation for Java.


Using the LLVM C bindings via something like JNI is probably the most straightforward approach. However, since this question was asked, I was able to find a few projects that may be of help, as well as produce one of my own:

  1. LLVM-J, which is Java bindings for LLVM - could be more convenient than directly using the c bindings with JNI.
  2. JLLVM, which is a Java port of the LLVM Core package, and includes an ANTLR LLVM IR parser.
  3. My own LLVM IR SDK, which parses LLVM IR to build an EMF Core (ECore) module via XText and can be easily used within Eclipse.


You could emit JNI calls to the llvm C bindings.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜