Identified Types using OCaml..

Hello all…

The conclusion of the LLVM Kaleidoscope example talks about the ability of create types and structures.

I would like to find a way to create a recursive structure type using the OCaml bindings. My purpose is to be able to create more advanced types such linked lists and trees.

My understanding is that I have to create identified, named types but I haven’t found any functions that allow me to do this.

An example of the desired LLVM IR is as follows.

%struct.node = type { i16, i16, %struct.node* }

Is there anyone who can point me in the right direction?

Thanks in advance.
Frank