从Java生成LLVM代码 [英] Generating LLVM Code from Java

查看:229
本文介绍了从Java生成LLVM代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用Java的LLVM代码生成框架。

I want to use the LLVM code generation Framework from Java.

即,我想要将Java代码编译成LLVM。我只想要一个用于代码生成的LLVM库,我可以从Java调用它。通常的LLVM库是C,所以我不能使用它。

I.e., I do not want to compile Java code into LLVM. I simply want an LLVM library for code generation that I can call from Java. The usual LLVM library is C, so I cannot use it.

是否有任何Java端口?如果不是,那么最简单的方法是什么呢?将API包装到JNI中?

Are there any Java ports? If no, what would be the easiest way to do it anyway? Wrap the API into JNI?

推荐答案

快速搜索 llvm java api bindings 发现了几个看起来很合适的项目:

A quick search for llvm java api bindings turned out several projects that seem like a good fit:

  • LLVM-J
  • JLLVM
  • LAJ

所有这些库都使用JNI来访问C-API,因此无论如何你都拥有LLVM本身的DLL或SO文件。

All of those libraries use JNI to access the C-API, so you have a DLL or SO file of the LLVM itself in any case.

这篇关于从Java生成LLVM代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆