0

I would like to generate LLVM IR for a toy language whose compiler is written in Scala.

SLEM seems to be exactly what I need but I can't figure out if it's usable in its current state. I tried to download the sources but I am unable to compile it.

Anyone used it successfully or knows whether it's usable?

Oak
  • 26,231
  • 8
  • 93
  • 152
anotherCode245
  • 703
  • 1
  • 8
  • 20

1 Answers1

0

I haven't used SLEM, but checking its commits it seems that the last one was from early 2011, so it's updated to LLVM version 2.9 at the latest. The IR has significantly changed since then, so it would probably not be usable if you try to use it with a newer LLVM.

You can update it, of course, but perhaps a better option would be LLVM-J - Java bindings to LLVM. It's updated to LLVM 3.1, in which the IR is far closer to what it is right now, plus it's basically just a wrapper around LLVM's C API, so updating it yourself should be relatively simple.

Oak
  • 26,231
  • 8
  • 93
  • 152
  • Any help using LLVM-J? Do I have to build it? – anotherCode245 Dec 30 '13 at 12:55
  • @anotherCode245 yes, but that's the easy part - since it's just binding, not a complete generator like SLEM, you also need to build LLVM itself. But then again it's *because* it's just binding that it's easy to adapt to newer LLVM versions. – Oak Dec 30 '13 at 13:32