Hi there!
I am relatively new to OCaml (and hence its LLVM API) and am running into some nasty segfaults. For background i am building a compiler which translates my AST to LLVM IR. Everything up until my code generation phase has been working smoothly, but my first LLVM API reference is causing a segfault, specifically using the build_alloca
function. I am wondering what are some general practices in debugging these types of errors in OCaml. Any/all input is appreciated greatly.
If you want to look at my code for more context of the problem, here is the link: https://github.com/os12345678/Poppy/blob/codegen/lib/llvm-codegen/codegen_expr.ml