mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-05 13:26:55 +00:00
OCaml bindings: fix infinite recursion on string_of_lltype
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141994 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -1137,7 +1137,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)
|
||||
|
Reference in New Issue
Block a user