LLVM Ocaml binding


I am actually using llvm ocaml binding to generate LLVM IR code.
Can some one tell me how to use the binding to generate debug informations if it’s possible ?

Many thanks

Try running the executable with -debug flag, use a debug build of llvm


Perhaps I miss fromulate my question.

I’am writting a compiler and I need to generate debug information throw MD structures provided by LLVM.
My compiler is written in OCaml and I use Ocaml-LLVM binding API to generate LLVM IR Code.

I want to generate something like the one generated by clang with :
clang -S -g -emit-llvm -o - with some optimisations.

I’am looking for the best way to generate debug informations with the LLVM-OCaml binding API.

Please, I need help to deal with this.