I'm trying to generate LLVM ir, and currently have this
let fill_structs = StringMap.iter (fun k v -> L.struct_set_body k v false ) structs
(* more let...in statements *)
The error message I'm getting is over my 'k' that I pass into L.struct_set_body
StringMap.key
This expression has type string but an expression was expected of type
L.lltype
My understanding of ocaml is weak, so I see from here that struct_set_body does this
lltype -> lltype array -> bool -> unit
Which I assume means it takes a lltype array and a boolean, and returns unit? I don't know, I am thinking about this the way I would a function signature in C or Java, but I don't think that's how I should be thinking about this.
The other thing is I don't know how to make my string 'k' into a lltype to accomplish what I want to do.