[llvm-commits] [PATCH] OCaml/C bindings updates

Török Edwin edwintorok at gmail.com
Tue Oct 11 09:44:31 PDT 2011


On 10/11/2011 09:11 AM, Cameron Zwarich wrote:
> There are a bunch of tabs throughout these changes. Please convert them to spaces before committing.

OK.

> 
> #4 has an extraneous change to lib/VMCore/Core.cpp that shouldn't be there.

Will remove.

> 
> The indentation here is a bit strange. What is the Ocaml standard in LLVM?

Apparently 2 spaces?
Well that patch definetely didn't follow the indentation of the rest of the code in that file,
so I'll fix it.

> 
> diff --git a/bindings/ocaml/llvm/llvm.ml b/bindings/ocaml/llvm/llvm.ml
> index 23b51f6..eecfa91 100644
> --- a/bindings/ocaml/llvm/llvm.ml
> +++ b/bindings/ocaml/llvm/llvm.ml
> @@ -1126,7 +1126,14 @@ let rec string_of_lltype ty =
>    (* FIXME: stop infinite recursion! :) *)
>    match classify_type ty with
>      TypeKind.Integer -> "i" ^ string_of_int (integer_bitwidth ty)
> -  | TypeKind.Pointer -> (string_of_lltype (element_type ty)) ^ "*"
> +  | TypeKind.Pointer ->
> +          (let ety = element_type ty in
> +          match classify_type ety with
> +          | TypeKind.Struct ->
> +                  (match struct_name ety with
> +                  | None -> (string_of_lltype ety)
> +                  | Some s -> s) ^ "*"
> +          | _ -> (string_of_lltype (element_type ty)) ^ "*")
>    | TypeKind.Struct ->
>        let s = "{ " ^ (concat2 ", " (
>                  Array.map string_of_lltype (struct_element_types ty)
> 
> I only took a look at the patches that you said weren't trivial, but it looks good to me besides those issues.

Thanks,
--Edwin



More information about the llvm-commits mailing list