mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-01-31 12:41:49 +01:00
Remove unions from the ocaml bindings.
llvm-svn: 112363
This commit is contained in:
parent
956e07b985
commit
4c15ccc237
@ -35,7 +35,6 @@ module TypeKind = struct
|
||||
| Opaque
|
||||
| Vector
|
||||
| Metadata
|
||||
| Union
|
||||
end
|
||||
|
||||
module Linkage = struct
|
||||
@ -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"
|
||||
@ -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"
|
||||
@ -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)) ^
|
||||
|
@ -72,7 +72,6 @@ module TypeKind : sig
|
||||
| Opaque
|
||||
| Vector
|
||||
| Metadata
|
||||
| Union
|
||||
end
|
||||
|
||||
(** The linkage of a global value, accessed with {!linkage} and
|
||||
@ -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
|
||||
@ -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} *)
|
||||
|
||||
|
@ -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 */
|
||||
|
Loading…
x
Reference in New Issue
Block a user