Skip to content

Commit

Permalink
Remove unions from the ocaml bindings.
Browse files Browse the repository at this point in the history
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112363 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
d0k committed Aug 28, 2010
1 parent e5ce4f6 commit 13ba2f9
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 43 deletions.
10 changes: 0 additions & 10 deletions bindings/ocaml/llvm/llvm.ml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ module TypeKind = struct
| Opaque
| Vector
| Metadata
| Union
end

module Linkage = struct
Expand Down Expand Up @@ -210,11 +209,6 @@ external struct_element_types : lltype -> lltype array
= "llvm_struct_element_types"
external is_packed : lltype -> bool = "llvm_is_packed"

(*--... Operations on union types ..........................................--*)
external union_type : llcontext -> lltype array -> lltype = "llvm_union_type"
external union_element_types : lltype -> lltype array
= "llvm_union_element_types"

(*--... Operations on pointer, vector, and array types .....................--*)
external array_type : lltype -> int -> lltype = "llvm_array_type"
external pointer_type : lltype -> lltype = "llvm_pointer_type"
Expand Down Expand Up @@ -321,7 +315,6 @@ external const_struct : llcontext -> llvalue array -> llvalue
external const_packed_struct : llcontext -> llvalue array -> llvalue
= "llvm_const_packed_struct"
external const_vector : llvalue array -> llvalue = "llvm_const_vector"
external const_union : lltype -> llvalue -> llvalue = "LLVMConstUnion"

(*--... Constant expressions ...............................................--*)
external align_of : lltype -> llvalue = "LLVMAlignOf"
Expand Down Expand Up @@ -1052,9 +1045,6 @@ let rec string_of_lltype ty =
if is_packed ty
then "<" ^ s ^ ">"
else s
| TypeKind.Union -> "union { " ^ (concat2 ", " (
Array.map string_of_lltype (union_element_types ty)
)) ^ " }"
| TypeKind.Array -> "[" ^ (string_of_int (array_length ty)) ^
" x " ^ (string_of_lltype (element_type ty)) ^ "]"
| TypeKind.Vector -> "<" ^ (string_of_int (vector_size ty)) ^
Expand Down
18 changes: 0 additions & 18 deletions bindings/ocaml/llvm/llvm.mli
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ module TypeKind : sig
| Opaque
| Vector
| Metadata
| Union
end

(** The linkage of a global value, accessed with {!linkage} and
Expand Down Expand Up @@ -408,19 +407,6 @@ external struct_element_types : lltype -> lltype array
external is_packed : lltype -> bool = "llvm_is_packed"


(** {7 Operations on union types} *)

(** [union_type context tys] returns the union type in the context [context]
containing the types in the array [tys]. See the method
[llvm::UnionType::get] *)
external union_type : llcontext -> lltype array -> lltype = "llvm_union_type"

(** [union_element_types uty] returns the constituent types of the union type
[uty]. See the method [llvm::UnionType::getElementType]. *)
external union_element_types : lltype -> lltype array
= "llvm_union_element_types"


(** {7 Operations on pointer, vector, and array types} *)

(** [array_type ty n] returns the array type containing [n] elements of type
Expand Down Expand Up @@ -697,10 +683,6 @@ external const_packed_struct : llcontext -> llvalue array -> llvalue
values [elts]. See the method [llvm::ConstantVector::get]. *)
external const_vector : llvalue array -> llvalue = "llvm_const_vector"

(** [const_union ty v] returns the union constant of type [union_type tys] and
containing the value [v]. See the method [llvm::ConstantUnion::get]. *)
external const_union : lltype -> llvalue -> llvalue = "LLVMConstUnion"


(** {7 Constant expressions} *)

Expand Down
15 changes: 0 additions & 15 deletions bindings/ocaml/llvm/llvm_ocaml.c
Original file line number Diff line number Diff line change
Expand Up @@ -318,21 +318,6 @@ CAMLprim value llvm_is_packed(LLVMTypeRef StructTy) {
return Val_bool(LLVMIsPackedStruct(StructTy));
}

/*--... Operations on union types ..........................................--*/

/* llcontext -> lltype array -> lltype */
CAMLprim LLVMTypeRef llvm_union_type(LLVMContextRef C, value ElementTypes) {
return LLVMUnionTypeInContext(C, (LLVMTypeRef *) ElementTypes,
Wosize_val(ElementTypes));
}

/* lltype -> lltype array */
CAMLprim value llvm_union_element_types(LLVMTypeRef UnionTy) {
value Tys = alloc(LLVMCountUnionElementTypes(UnionTy), 0);
LLVMGetUnionElementTypes(UnionTy, (LLVMTypeRef *) Tys);
return Tys;
}

/*--... Operations on array, pointer, and vector types .....................--*/

/* lltype -> int -> lltype */
Expand Down

0 comments on commit 13ba2f9

Please sign in to comment.