mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-25 03:30:37 +00:00
ocaml/C bindings: type->isSized()
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141288 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
4917ec9ec7
commit
ff12c99d13
@ -167,6 +167,7 @@ external set_module_inline_asm : llmodule -> string -> unit
|
|||||||
(*===-- Types -------------------------------------------------------------===*)
|
(*===-- Types -------------------------------------------------------------===*)
|
||||||
external classify_type : lltype -> TypeKind.t = "llvm_classify_type"
|
external classify_type : lltype -> TypeKind.t = "llvm_classify_type"
|
||||||
external type_context : lltype -> llcontext = "llvm_type_context"
|
external type_context : lltype -> llcontext = "llvm_type_context"
|
||||||
|
external type_is_sized : lltype -> bool = "llvm_type_is_sized"
|
||||||
|
|
||||||
(*--... Operations on integer types ........................................--*)
|
(*--... Operations on integer types ........................................--*)
|
||||||
external i1_type : llcontext -> lltype = "llvm_i1_type"
|
external i1_type : llcontext -> lltype = "llvm_i1_type"
|
||||||
|
@ -271,6 +271,11 @@ val set_module_inline_asm : llmodule -> string -> unit
|
|||||||
See the method [llvm::Type::getTypeID]. *)
|
See the method [llvm::Type::getTypeID]. *)
|
||||||
val classify_type : lltype -> TypeKind.t
|
val classify_type : lltype -> TypeKind.t
|
||||||
|
|
||||||
|
(** [type_is_sized ty] returns whether the type has a size or not.
|
||||||
|
* If it doesn't then it is not safe to call the [TargetData::] methods on it.
|
||||||
|
* *)
|
||||||
|
val type_is_sized : lltype -> bool
|
||||||
|
|
||||||
(** [type_context ty] returns the {!llcontext} corresponding to the type [ty].
|
(** [type_context ty] returns the {!llcontext} corresponding to the type [ty].
|
||||||
See the method [llvm::Type::getContext]. *)
|
See the method [llvm::Type::getContext]. *)
|
||||||
val type_context : lltype -> llcontext
|
val type_context : lltype -> llcontext
|
||||||
|
@ -172,6 +172,10 @@ CAMLprim value llvm_classify_type(LLVMTypeRef Ty) {
|
|||||||
return Val_int(LLVMGetTypeKind(Ty));
|
return Val_int(LLVMGetTypeKind(Ty));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
CAMLprim value llvm_type_is_sized(LLVMTypeRef Ty) {
|
||||||
|
return Val_bool(LLVMTypeIsSized(Ty));
|
||||||
|
}
|
||||||
|
|
||||||
/* lltype -> llcontext */
|
/* lltype -> llcontext */
|
||||||
CAMLprim LLVMContextRef llvm_type_context(LLVMTypeRef Ty) {
|
CAMLprim LLVMContextRef llvm_type_context(LLVMTypeRef Ty) {
|
||||||
return LLVMGetTypeContext(Ty);
|
return LLVMGetTypeContext(Ty);
|
||||||
|
@ -355,6 +355,7 @@ LLVMContextRef LLVMGetModuleContext(LLVMModuleRef M);
|
|||||||
|
|
||||||
/** See llvm::LLVMTypeKind::getTypeID. */
|
/** See llvm::LLVMTypeKind::getTypeID. */
|
||||||
LLVMTypeKind LLVMGetTypeKind(LLVMTypeRef Ty);
|
LLVMTypeKind LLVMGetTypeKind(LLVMTypeRef Ty);
|
||||||
|
LLVMBool LLVMTypeIsSized(LLVMTypeRef Ty);
|
||||||
|
|
||||||
/** See llvm::LLVMType::getContext. */
|
/** See llvm::LLVMType::getContext. */
|
||||||
LLVMContextRef LLVMGetTypeContext(LLVMTypeRef Ty);
|
LLVMContextRef LLVMGetTypeContext(LLVMTypeRef Ty);
|
||||||
|
@ -167,6 +167,11 @@ LLVMTypeKind LLVMGetTypeKind(LLVMTypeRef Ty) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
LLVMBool LLVMTypeIsSized(LLVMTypeRef Ty)
|
||||||
|
{
|
||||||
|
return unwrap(Ty)->isSized();
|
||||||
|
}
|
||||||
|
|
||||||
LLVMContextRef LLVMGetTypeContext(LLVMTypeRef Ty) {
|
LLVMContextRef LLVMGetTypeContext(LLVMTypeRef Ty) {
|
||||||
return wrap(&unwrap(Ty)->getContext());
|
return wrap(&unwrap(Ty)->getContext());
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user