File tree Expand file tree Collapse file tree 4 files changed +39
-0
lines changed Expand file tree Collapse file tree 4 files changed +39
-0
lines changed Original file line number Diff line number Diff line change @@ -525,6 +525,9 @@ external vector_size : lltype -> int = "llvm_vector_size"
525
525
(* --... Operations on other types ..........................................--*)
526
526
external void_type : llcontext -> lltype = " llvm_void_type"
527
527
external label_type : llcontext -> lltype = " llvm_label_type"
528
+ external x86_amx_type : llcontext -> lltype = " llvm_x86_amx_type"
529
+ external token_type : llcontext -> lltype = " llvm_token_type"
530
+ external metadata_type : llcontext -> lltype = " llvm_metadata_type"
528
531
external type_by_name : llmodule -> string -> lltype option = " llvm_type_by_name"
529
532
530
533
external classify_value : llvalue -> ValueKind .t = " llvm_classify_value"
Original file line number Diff line number Diff line change @@ -766,6 +766,18 @@ val void_type : llcontext -> lltype
766
766
[llvm::Type::LabelTy]. *)
767
767
val label_type : llcontext -> lltype
768
768
769
+ (* * [x86_amx_type c] creates an X86 AMX type in the context [c]. See
770
+ [llvm::Type::getX86_AMXTy]. *)
771
+ val x86_amx_type : llcontext -> lltype
772
+
773
+ (* * [token_type c] creates a token type in the context [c]. See
774
+ [llvm::Type::getTokenTy]. *)
775
+ val token_type : llcontext -> lltype
776
+
777
+ (* * [metadata_type c] creates a metadata type in the context [c]. See
778
+ [llvm::Type::getMetadataTy]. *)
779
+ val metadata_type : llcontext -> lltype
780
+
769
781
(* * [type_by_name m name] returns the specified type from the current module
770
782
if it exists.
771
783
See the method [llvm::Module::getTypeByName] *)
Original file line number Diff line number Diff line change @@ -686,6 +686,21 @@ value llvm_label_type(value Context) {
686
686
return to_val (LLVMLabelTypeInContext (Context_val (Context)));
687
687
}
688
688
689
+ /* llcontext -> lltype */
690
+ value llvm_x86_amx_type (value Context) {
691
+ return to_val (LLVMX86AMXTypeInContext (Context_val (Context)));
692
+ }
693
+
694
+ /* llcontext -> lltype */
695
+ value llvm_token_type (value Context) {
696
+ return to_val (LLVMTokenTypeInContext (Context_val (Context)));
697
+ }
698
+
699
+ /* llcontext -> lltype */
700
+ value llvm_metadata_type (value Context) {
701
+ return to_val (LLVMMetadataTypeInContext (Context_val (Context)));
702
+ }
703
+
689
704
/* llmodule -> string -> lltype option */
690
705
value llvm_type_by_name (value M, value Name) {
691
706
return ptr_to_option (LLVMGetTypeByName (Module_val (M), String_val (Name)));
Original file line number Diff line number Diff line change @@ -53,6 +53,14 @@ let test_pointer_types () =
53
53
insist (0 = address_space (qualified_pointer_type context 0 ));
54
54
insist (1 = address_space (qualified_pointer_type context 1 ))
55
55
56
+ (* ===-- Other types ------------------------------------------------------===*)
57
+ let test_other_types () =
58
+ insist (TypeKind. Void = classify_type void_type);
59
+ insist (TypeKind. Label = classify_type (label_type context));
60
+ insist (TypeKind. X86_amx = classify_type (x86_amx_type context));
61
+ insist (TypeKind. Token = classify_type (token_type context));
62
+ insist (TypeKind. Metadata = classify_type (metadata_type context))
63
+
56
64
(* ===-- Conversion --------------------------------------------------------===*)
57
65
58
66
let test_conversion () =
@@ -1461,6 +1469,7 @@ let _ =
1461
1469
suite " modules" test_modules;
1462
1470
suite " contained types" test_contained_types;
1463
1471
suite " pointer types" test_pointer_types;
1472
+ suite " other types" test_other_types;
1464
1473
suite " conversion" test_conversion;
1465
1474
suite " target" test_target;
1466
1475
suite " constants" test_constants;
You can’t perform that action at this time.
0 commit comments