1

I want to do a runtime with llvmlite, and I would like to transpiler c to llvm.

I want to know if in a way in llvmlite itself or in some python lib, I can't find it on the internet, so I came to ask you. Thank you very much in advance

1 Answers1

2

If you want to transform C code to LLVM IR, no need to do it using llvmlite, which is a LLVM binding library. Just call clang -c -emit-llvm on a C source from your Python code.

arrowd
  • 33,231
  • 8
  • 79
  • 110
  • I'm making a compiler and I need it done programmatically. – josué santos May 17 '20 at 10:54
  • If you are making a compiler for your own language, why do you need C at all? And if you are making your own C compiler, you'd need `libclang` too, which is not included in `llvmlite`. Moreover, `libclang` might not provide APIs to turn C code into LLVM IR, so you might need to implement these parts yourself. – arrowd May 18 '20 at 07:51