llvm.org GIT mirror llvm / 6fd937c
[LLVM-C][OCaml] Add C and OCaml APIs for llvm::StructType::isLiteral Summary: This patch adds LLVMIsLiteralStruct to the C API to expose StructType::isLiteral. This is then used to implement the analogous addition to the OCaml API. Reviewers: whitequark, deadalnix Reviewed By: whitequark Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D52209 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@342435 91177308-0d34-0410-b5e6-96231b3b80d8 whitequark 1 year, 29 days ago
5 changed file(s) with 21 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
468468 = "llvm_struct_element_types"
469469 external is_packed : lltype -> bool = "llvm_is_packed"
470470 external is_opaque : lltype -> bool = "llvm_is_opaque"
471 external is_literal : lltype -> bool = "llvm_is_literal"
471472
472473 (*--... Operations on pointer, vector, and array types .....................--*)
473474
664664 [false] otherwise. See the method [llvm::StructType::isOpaque]. *)
665665 val is_opaque : lltype -> bool
666666
667 (** [is_literal sty] returns [true] if the structure type [sty] is literal.
668 [false] otherwise. See the method [llvm::StructType::isLiteral]. *)
669 val is_literal : lltype -> bool
670
667671
668672 (** {7 Operations on pointer, vector, and array types} *)
669673
509509 return Val_bool(LLVMIsOpaqueStruct(StructTy));
510510 }
511511
512 /* lltype -> bool */
513 CAMLprim value llvm_is_literal(LLVMTypeRef StructTy) {
514 return Val_bool(LLVMIsLiteralStruct(StructTy));
515 }
516
512517 /*--... Operations on array, pointer, and vector types .....................--*/
513518
514519 /* lltype -> lltype array */
12761276 * @see llvm::StructType::isOpaque()
12771277 */
12781278 LLVMBool LLVMIsOpaqueStruct(LLVMTypeRef StructTy);
1279
1280 /**
1281 * Determine whether a structure is literal.
1282 *
1283 * @see llvm::StructType::isLiteral()
1284 */
1285 LLVMBool LLVMIsLiteralStruct(LLVMTypeRef StructTy);
12791286
12801287 /**
12811288 * @}
703703
704704 LLVMBool LLVMIsOpaqueStruct(LLVMTypeRef StructTy) {
705705 return unwrap(StructTy)->isOpaque();
706 }
707
708 LLVMBool LLVMIsLiteralStruct(LLVMTypeRef StructTy) {
709 return unwrap(StructTy)->isLiteral();
706710 }
707711
708712 LLVMTypeRef LLVMGetTypeByName(LLVMModuleRef M, const char *Name) {