-
-
Notifications
You must be signed in to change notification settings - Fork 59
Expand file tree
/
Copy pathllvm.cy
More file actions
2577 lines (1799 loc) · 83.1 KB
/
Copy pathllvm.cy
File metadata and controls
2577 lines (1799 loc) · 83.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
-- ./src/tools/cbindgen.cy -o=src/tools/llvm.cy src/tools/llvm.h -clang -isysroot -clang /Library/Developer/CommandLineTools/SDKs/MacOSX26.sdk -clang -I/opt/homebrew/Cellar/llvm/20.1.7/include -lib-path=libLLVM.dylib -strip-prefix=LLVM
-- CBINDGEN MARKER
-- Code below is generated by cbindgen.cy
use c
use meta
type u16 = r16
type u32 = r32
type u64 = r64
type c_int = c.c_int
type c_uint = c.c_uint
type c_char = c.c_char
#if meta.is_vm_target():
#if meta.system() == .macos:
#c.bind_lib('libLLVM.dylib')
#else meta.system() == .linux:
#c.bind_lib('libLLVM.so')
type Bool = c_int
type MemoryBufferRef = Ptr[OpaqueMemoryBuffer_S]
type ContextRef = Ptr[OpaqueContext_S]
type ModuleRef = Ptr[OpaqueModule_S]
type TypeRef = Ptr[OpaqueType_S]
type ValueRef = Ptr[OpaqueValue_S]
type BasicBlockRef = Ptr[OpaqueBasicBlock_S]
type MetadataRef = Ptr[OpaqueMetadata_S]
type NamedMDNodeRef = Ptr[OpaqueNamedMDNode_S]
type ValueMetadataEntry = OpaqueValueMetadataEntry_S
type BuilderRef = Ptr[OpaqueBuilder_S]
type DIBuilderRef = Ptr[OpaqueDIBuilder_S]
type ModuleProviderRef = Ptr[OpaqueModuleProvider_S]
type PassManagerRef = Ptr[OpaquePassManager_S]
type UseRef = Ptr[OpaqueUse_S]
type OperandBundleRef = Ptr[OpaqueOperandBundle_S]
type AttributeRef = Ptr[OpaqueAttributeRef_S]
type DiagnosticInfoRef = Ptr[OpaqueDiagnosticInfo_S]
type ComdatRef = Ptr[Comdat_S]
type ModuleFlagEntry = OpaqueModuleFlagEntry_S
type JITEventListenerRef = Ptr[OpaqueJITEventListener_S]
type BinaryRef = Ptr[OpaqueBinary_S]
type DbgRecordRef = Ptr[OpaqueDbgRecord_S]
type Opcode_E = c_int
const Ret = c_int(1)
const Br = c_int(2)
const Switch = c_int(3)
const IndirectBr = c_int(4)
const Invoke = c_int(5)
const Unreachable = c_int(7)
const CallBr = c_int(67)
const FNeg = c_int(66)
const Add = c_int(8)
const FAdd = c_int(9)
const Sub = c_int(10)
const FSub = c_int(11)
const Mul = c_int(12)
const FMul = c_int(13)
const UDiv = c_int(14)
const SDiv = c_int(15)
const FDiv = c_int(16)
const URem = c_int(17)
const SRem = c_int(18)
const FRem = c_int(19)
const Shl = c_int(20)
const LShr = c_int(21)
const AShr = c_int(22)
const And = c_int(23)
const Or = c_int(24)
const Xor = c_int(25)
const Alloca = c_int(26)
const Load = c_int(27)
const Store = c_int(28)
const GetElementPtr = c_int(29)
const Trunc = c_int(30)
const ZExt = c_int(31)
const SExt = c_int(32)
const FPToUI = c_int(33)
const FPToSI = c_int(34)
const UIToFP = c_int(35)
const SIToFP = c_int(36)
const FPTrunc = c_int(37)
const FPExt = c_int(38)
const PtrToInt = c_int(39)
const IntToPtr = c_int(40)
const BitCast = c_int(41)
const AddrSpaceCast = c_int(60)
const ICmp = c_int(42)
const FCmp = c_int(43)
const PHI = c_int(44)
const Call = c_int(45)
const Select = c_int(46)
const UserOp1 = c_int(47)
const UserOp2 = c_int(48)
const VAArg = c_int(49)
const ExtractElement = c_int(50)
const InsertElement = c_int(51)
const ShuffleVector = c_int(52)
const ExtractValue = c_int(53)
const InsertValue = c_int(54)
const Freeze = c_int(68)
const Fence = c_int(55)
const AtomicCmpXchg = c_int(56)
const AtomicRMW = c_int(57)
const Resume = c_int(58)
const LandingPad = c_int(59)
const CleanupRet = c_int(61)
const CatchRet = c_int(62)
const CatchPad = c_int(63)
const CleanupPad = c_int(64)
const CatchSwitch = c_int(65)
type Opcode = Opcode_E
type TypeKind_E = c_int
const VoidTypeKind = c_int(0)
const HalfTypeKind = c_int(1)
const FloatTypeKind = c_int(2)
const DoubleTypeKind = c_int(3)
const X86_FP80TypeKind = c_int(4)
const FP128TypeKind = c_int(5)
const PPC_FP128TypeKind = c_int(6)
const LabelTypeKind = c_int(7)
const IntegerTypeKind = c_int(8)
const FunctionTypeKind = c_int(9)
const StructTypeKind = c_int(10)
const ArrayTypeKind = c_int(11)
const PointerTypeKind = c_int(12)
const VectorTypeKind = c_int(13)
const MetadataTypeKind = c_int(14)
const TokenTypeKind = c_int(16)
const ScalableVectorTypeKind = c_int(17)
const BFloatTypeKind = c_int(18)
const X86_AMXTypeKind = c_int(19)
const TargetExtTypeKind = c_int(20)
type TypeKind = TypeKind_E
type Linkage_E = c_int
const ExternalLinkage = c_int(0)
const AvailableExternallyLinkage = c_int(1)
const LinkOnceAnyLinkage = c_int(2)
const LinkOnceODRLinkage = c_int(3)
const LinkOnceODRAutoHideLinkage = c_int(4)
const WeakAnyLinkage = c_int(5)
const WeakODRLinkage = c_int(6)
const AppendingLinkage = c_int(7)
const InternalLinkage = c_int(8)
const PrivateLinkage = c_int(9)
const DLLImportLinkage = c_int(10)
const DLLExportLinkage = c_int(11)
const ExternalWeakLinkage = c_int(12)
const GhostLinkage = c_int(13)
const CommonLinkage = c_int(14)
const LinkerPrivateLinkage = c_int(15)
const LinkerPrivateWeakLinkage = c_int(16)
type Linkage = Linkage_E
type Visibility_E = c_int
const DefaultVisibility = c_int(0)
const HiddenVisibility = c_int(1)
const ProtectedVisibility = c_int(2)
type Visibility = Visibility_E
type UnnamedAddr_E = c_int
const NoUnnamedAddr = c_int(0)
const LocalUnnamedAddr = c_int(1)
const GlobalUnnamedAddr = c_int(2)
type UnnamedAddr = UnnamedAddr_E
type DLLStorageClass_E = c_int
const DefaultStorageClass = c_int(0)
const DLLImportStorageClass = c_int(1)
const DLLExportStorageClass = c_int(2)
type DLLStorageClass = DLLStorageClass_E
type CallConv_E = c_int
const CCallConv = c_int(0)
const FastCallConv = c_int(8)
const ColdCallConv = c_int(9)
const GHCCallConv = c_int(10)
const HiPECallConv = c_int(11)
const AnyRegCallConv = c_int(13)
const PreserveMostCallConv = c_int(14)
const PreserveAllCallConv = c_int(15)
const SwiftCallConv = c_int(16)
const CXXFASTTLSCallConv = c_int(17)
const X86StdcallCallConv = c_int(64)
const X86FastcallCallConv = c_int(65)
const ARMAPCSCallConv = c_int(66)
const ARMAAPCSCallConv = c_int(67)
const ARMAAPCSVFPCallConv = c_int(68)
const MSP430INTRCallConv = c_int(69)
const X86ThisCallCallConv = c_int(70)
const PTXKernelCallConv = c_int(71)
const PTXDeviceCallConv = c_int(72)
const SPIRFUNCCallConv = c_int(75)
const SPIRKERNELCallConv = c_int(76)
const IntelOCLBICallConv = c_int(77)
const X8664SysVCallConv = c_int(78)
const Win64CallConv = c_int(79)
const X86VectorCallCallConv = c_int(80)
const HHVMCallConv = c_int(81)
const HHVMCCallConv = c_int(82)
const X86INTRCallConv = c_int(83)
const AVRINTRCallConv = c_int(84)
const AVRSIGNALCallConv = c_int(85)
const AVRBUILTINCallConv = c_int(86)
const AMDGPUVSCallConv = c_int(87)
const AMDGPUGSCallConv = c_int(88)
const AMDGPUPSCallConv = c_int(89)
const AMDGPUCSCallConv = c_int(90)
const AMDGPUKERNELCallConv = c_int(91)
const X86RegCallCallConv = c_int(92)
const AMDGPUHSCallConv = c_int(93)
const MSP430BUILTINCallConv = c_int(94)
const AMDGPULSCallConv = c_int(95)
const AMDGPUESCallConv = c_int(96)
type CallConv = CallConv_E
type ValueKind_E = c_int
const ArgumentValueKind = c_int(0)
const BasicBlockValueKind = c_int(1)
const MemoryUseValueKind = c_int(2)
const MemoryDefValueKind = c_int(3)
const MemoryPhiValueKind = c_int(4)
const FunctionValueKind = c_int(5)
const GlobalAliasValueKind = c_int(6)
const GlobalIFuncValueKind = c_int(7)
const GlobalVariableValueKind = c_int(8)
const BlockAddressValueKind = c_int(9)
const ConstantExprValueKind = c_int(10)
const ConstantArrayValueKind = c_int(11)
const ConstantStructValueKind = c_int(12)
const ConstantVectorValueKind = c_int(13)
const UndefValueValueKind = c_int(14)
const ConstantAggregateZeroValueKind = c_int(15)
const ConstantDataArrayValueKind = c_int(16)
const ConstantDataVectorValueKind = c_int(17)
const ConstantIntValueKind = c_int(18)
const ConstantFPValueKind = c_int(19)
const ConstantPointerNullValueKind = c_int(20)
const ConstantTokenNoneValueKind = c_int(21)
const MetadataAsValueValueKind = c_int(22)
const InlineAsmValueKind = c_int(23)
const InstructionValueKind = c_int(24)
const PoisonValueValueKind = c_int(25)
const ConstantTargetNoneValueKind = c_int(26)
const ConstantPtrAuthValueKind = c_int(27)
type ValueKind = ValueKind_E
type IntPredicate_E = c_int
const IntEQ = c_int(32)
const IntNE = c_int(33)
const IntUGT = c_int(34)
const IntUGE = c_int(35)
const IntULT = c_int(36)
const IntULE = c_int(37)
const IntSGT = c_int(38)
const IntSGE = c_int(39)
const IntSLT = c_int(40)
const IntSLE = c_int(41)
type IntPredicate = IntPredicate_E
type RealPredicate_E = c_int
const RealPredicateFalse = c_int(0)
const RealOEQ = c_int(1)
const RealOGT = c_int(2)
const RealOGE = c_int(3)
const RealOLT = c_int(4)
const RealOLE = c_int(5)
const RealONE = c_int(6)
const RealORD = c_int(7)
const RealUNO = c_int(8)
const RealUEQ = c_int(9)
const RealUGT = c_int(10)
const RealUGE = c_int(11)
const RealULT = c_int(12)
const RealULE = c_int(13)
const RealUNE = c_int(14)
const RealPredicateTrue = c_int(15)
type RealPredicate = RealPredicate_E
type LandingPadClauseTy_E = c_int
const LandingPadCatch = c_int(0)
const LandingPadFilter = c_int(1)
type LandingPadClauseTy = LandingPadClauseTy_E
type ThreadLocalMode_E = c_int
const NotThreadLocal = c_int(0)
const GeneralDynamicTLSModel = c_int(1)
const LocalDynamicTLSModel = c_int(2)
const InitialExecTLSModel = c_int(3)
const LocalExecTLSModel = c_int(4)
type ThreadLocalMode = ThreadLocalMode_E
type AtomicOrdering_E = c_int
const AtomicOrderingNotAtomic = c_int(0)
const AtomicOrderingUnordered = c_int(1)
const AtomicOrderingMonotonic = c_int(2)
const AtomicOrderingAcquire = c_int(4)
const AtomicOrderingRelease = c_int(5)
const AtomicOrderingAcquireRelease = c_int(6)
const AtomicOrderingSequentiallyConsistent = c_int(7)
type AtomicOrdering = AtomicOrdering_E
type AtomicRMWBinOp_E = c_int
const AtomicRMWBinOpXchg = c_int(0)
const AtomicRMWBinOpAdd = c_int(1)
const AtomicRMWBinOpSub = c_int(2)
const AtomicRMWBinOpAnd = c_int(3)
const AtomicRMWBinOpNand = c_int(4)
const AtomicRMWBinOpOr = c_int(5)
const AtomicRMWBinOpXor = c_int(6)
const AtomicRMWBinOpMax = c_int(7)
const AtomicRMWBinOpMin = c_int(8)
const AtomicRMWBinOpUMax = c_int(9)
const AtomicRMWBinOpUMin = c_int(10)
const AtomicRMWBinOpFAdd = c_int(11)
const AtomicRMWBinOpFSub = c_int(12)
const AtomicRMWBinOpFMax = c_int(13)
const AtomicRMWBinOpFMin = c_int(14)
const AtomicRMWBinOpUIncWrap = c_int(15)
const AtomicRMWBinOpUDecWrap = c_int(16)
const AtomicRMWBinOpUSubCond = c_int(17)
const AtomicRMWBinOpUSubSat = c_int(18)
type AtomicRMWBinOp = AtomicRMWBinOp_E
type DiagnosticSeverity_E = c_int
const DSError = c_int(0)
const DSWarning = c_int(1)
const DSRemark = c_int(2)
const DSNote = c_int(3)
type DiagnosticSeverity = DiagnosticSeverity_E
type InlineAsmDialect_E = c_int
const InlineAsmDialectATT = c_int(0)
const InlineAsmDialectIntel = c_int(1)
type InlineAsmDialect = InlineAsmDialect_E
type ModuleFlagBehavior_E = c_int
const ModuleFlagBehaviorError = c_int(0)
const ModuleFlagBehaviorWarning = c_int(1)
const ModuleFlagBehaviorRequire = c_int(2)
const ModuleFlagBehaviorOverride = c_int(3)
const ModuleFlagBehaviorAppend = c_int(4)
const ModuleFlagBehaviorAppendUnique = c_int(5)
type ModuleFlagBehavior = ModuleFlagBehavior_E
type AttributeIndex = c_uint
type TailCallKind_E = c_int
const TailCallKindNone = c_int(0)
const TailCallKindTail = c_int(1)
const TailCallKindMustTail = c_int(2)
const TailCallKindNoTail = c_int(3)
type TailCallKind = TailCallKind_E
type FastMathFlags = c_uint
type GEPNoWrapFlags = c_uint
#[extern='LLVMShutdown']
fn Shutdown() -> void
#[extern='LLVMGetVersion']
fn GetVersion(Major Ptr[c_uint], Minor Ptr[c_uint], Patch Ptr[c_uint]) -> void
#[extern='LLVMCreateMessage']
fn CreateMessage(Message Ptr[c_char]) -> Ptr[c_char]
#[extern='LLVMDisposeMessage']
fn DisposeMessage(Message Ptr[c_char]) -> void
type DiagnosticHandler = #[extern] fn(DiagnosticInfoRef, Ptr[void])->void
type YieldCallback = #[extern] fn(ContextRef, Ptr[void])->void
#[extern='LLVMContextCreate']
fn ContextCreate() -> ContextRef
#[extern='LLVMGetGlobalContext']
fn GetGlobalContext() -> ContextRef
#[extern='LLVMContextSetDiagnosticHandler']
fn ContextSetDiagnosticHandler(C ContextRef, Handler DiagnosticHandler, DiagnosticContext Ptr[void]) -> void
#[extern='LLVMContextGetDiagnosticHandler']
fn ContextGetDiagnosticHandler(C ContextRef) -> DiagnosticHandler
#[extern='LLVMContextGetDiagnosticContext']
fn ContextGetDiagnosticContext(C ContextRef) -> Ptr[void]
#[extern='LLVMContextSetYieldCallback']
fn ContextSetYieldCallback(C ContextRef, Callback YieldCallback, OpaqueHandle Ptr[void]) -> void
#[extern='LLVMContextShouldDiscardValueNames']
fn ContextShouldDiscardValueNames(C ContextRef) -> Bool
#[extern='LLVMContextSetDiscardValueNames']
fn ContextSetDiscardValueNames(C ContextRef, Discard Bool) -> void
#[extern='LLVMContextDispose']
fn ContextDispose(C ContextRef) -> void
#[extern='LLVMGetDiagInfoDescription']
fn GetDiagInfoDescription(DI DiagnosticInfoRef) -> Ptr[c_char]
#[extern='LLVMGetDiagInfoSeverity']
fn GetDiagInfoSeverity(DI DiagnosticInfoRef) -> DiagnosticSeverity
#[extern='LLVMGetMDKindIDInContext']
fn GetMDKindIDInContext(C ContextRef, Name Ptr[c_char], SLen c_uint) -> c_uint
#[extern='LLVMGetMDKindID']
fn GetMDKindID(Name Ptr[c_char], SLen c_uint) -> c_uint
#[extern='LLVMGetSyncScopeID']
fn GetSyncScopeID(C ContextRef, Name Ptr[c_char], SLen u64) -> c_uint
#[extern='LLVMGetEnumAttributeKindForName']
fn GetEnumAttributeKindForName(Name Ptr[c_char], SLen u64) -> c_uint
#[extern='LLVMGetLastEnumAttributeKind']
fn GetLastEnumAttributeKind() -> c_uint
#[extern='LLVMCreateEnumAttribute']
fn CreateEnumAttribute(C ContextRef, KindID c_uint, Val u64) -> AttributeRef
#[extern='LLVMGetEnumAttributeKind']
fn GetEnumAttributeKind(A AttributeRef) -> c_uint
#[extern='LLVMGetEnumAttributeValue']
fn GetEnumAttributeValue(A AttributeRef) -> u64
#[extern='LLVMCreateTypeAttribute']
fn CreateTypeAttribute(C ContextRef, KindID c_uint, type_ref TypeRef) -> AttributeRef
#[extern='LLVMGetTypeAttributeValue']
fn GetTypeAttributeValue(A AttributeRef) -> TypeRef
#[extern='LLVMCreateConstantRangeAttribute']
fn CreateConstantRangeAttribute(C ContextRef, KindID c_uint, NumBits c_uint, LowerWords Ptr[void], UpperWords Ptr[void]) -> AttributeRef
#[extern='LLVMCreateStringAttribute']
fn CreateStringAttribute(C ContextRef, K Ptr[c_char], KLength c_uint, V Ptr[c_char], VLength c_uint) -> AttributeRef
#[extern='LLVMGetStringAttributeKind']
fn GetStringAttributeKind(A AttributeRef, Length Ptr[c_uint]) -> Ptr[c_char]
#[extern='LLVMGetStringAttributeValue']
fn GetStringAttributeValue(A AttributeRef, Length Ptr[c_uint]) -> Ptr[c_char]
#[extern='LLVMIsEnumAttribute']
fn IsEnumAttribute(A AttributeRef) -> Bool
#[extern='LLVMIsStringAttribute']
fn IsStringAttribute(A AttributeRef) -> Bool
#[extern='LLVMIsTypeAttribute']
fn IsTypeAttribute(A AttributeRef) -> Bool
#[extern='LLVMGetTypeByName2']
fn GetTypeByName2(C ContextRef, Name Ptr[c_char]) -> TypeRef
#[extern='LLVMModuleCreateWithName']
fn ModuleCreateWithName(ModuleID Ptr[c_char]) -> ModuleRef
#[extern='LLVMModuleCreateWithNameInContext']
fn ModuleCreateWithNameInContext(ModuleID Ptr[c_char], C ContextRef) -> ModuleRef
#[extern='LLVMCloneModule']
fn CloneModule(M ModuleRef) -> ModuleRef
#[extern='LLVMDisposeModule']
fn DisposeModule(M ModuleRef) -> void
#[extern='LLVMIsNewDbgInfoFormat']
fn IsNewDbgInfoFormat(M ModuleRef) -> Bool
#[extern='LLVMSetIsNewDbgInfoFormat']
fn SetIsNewDbgInfoFormat(M ModuleRef, UseNewFormat Bool) -> void
#[extern='LLVMGetModuleIdentifier']
fn GetModuleIdentifier(M ModuleRef, Len Ptr[u64]) -> Ptr[c_char]
#[extern='LLVMSetModuleIdentifier']
fn SetModuleIdentifier(M ModuleRef, Ident Ptr[c_char], Len u64) -> void
#[extern='LLVMGetSourceFileName']
fn GetSourceFileName(M ModuleRef, Len Ptr[u64]) -> Ptr[c_char]
#[extern='LLVMSetSourceFileName']
fn SetSourceFileName(M ModuleRef, Name Ptr[c_char], Len u64) -> void
#[extern='LLVMGetDataLayoutStr']
fn GetDataLayoutStr(M ModuleRef) -> Ptr[c_char]
#[extern='LLVMGetDataLayout']
fn GetDataLayout(M ModuleRef) -> Ptr[c_char]
#[extern='LLVMSetDataLayout']
fn SetDataLayout(M ModuleRef, DataLayoutStr Ptr[c_char]) -> void
#[extern='LLVMGetTarget']
fn GetTarget(M ModuleRef) -> Ptr[c_char]
#[extern='LLVMSetTarget']
fn SetTarget(M ModuleRef, Triple Ptr[c_char]) -> void
#[extern='LLVMCopyModuleFlagsMetadata']
fn CopyModuleFlagsMetadata(M ModuleRef, Len Ptr[u64]) -> Ptr[ModuleFlagEntry]
#[extern='LLVMDisposeModuleFlagsMetadata']
fn DisposeModuleFlagsMetadata(Entries Ptr[ModuleFlagEntry]) -> void
#[extern='LLVMModuleFlagEntriesGetFlagBehavior']
fn ModuleFlagEntriesGetFlagBehavior(Entries Ptr[ModuleFlagEntry], Index c_uint) -> ModuleFlagBehavior
#[extern='LLVMModuleFlagEntriesGetKey']
fn ModuleFlagEntriesGetKey(Entries Ptr[ModuleFlagEntry], Index c_uint, Len Ptr[u64]) -> Ptr[c_char]
#[extern='LLVMModuleFlagEntriesGetMetadata']
fn ModuleFlagEntriesGetMetadata(Entries Ptr[ModuleFlagEntry], Index c_uint) -> MetadataRef
#[extern='LLVMGetModuleFlag']
fn GetModuleFlag(M ModuleRef, Key Ptr[c_char], KeyLen u64) -> MetadataRef
#[extern='LLVMAddModuleFlag']
fn AddModuleFlag(M ModuleRef, Behavior ModuleFlagBehavior, Key Ptr[c_char], KeyLen u64, Val MetadataRef) -> void
#[extern='LLVMDumpModule']
fn DumpModule(M ModuleRef) -> void
#[extern='LLVMPrintModuleToFile']
fn PrintModuleToFile(M ModuleRef, Filename Ptr[c_char], ErrorMessage Ptr[Ptr[c_char]]) -> Bool
#[extern='LLVMPrintModuleToString']
fn PrintModuleToString(M ModuleRef) -> Ptr[c_char]
#[extern='LLVMGetModuleInlineAsm']
fn GetModuleInlineAsm(M ModuleRef, Len Ptr[u64]) -> Ptr[c_char]
#[extern='LLVMSetModuleInlineAsm2']
fn SetModuleInlineAsm2(M ModuleRef, Asm Ptr[c_char], Len u64) -> void
#[extern='LLVMAppendModuleInlineAsm']
fn AppendModuleInlineAsm(M ModuleRef, Asm Ptr[c_char], Len u64) -> void
#[extern='LLVMGetInlineAsm']
fn GetInlineAsm(Ty TypeRef, AsmString Ptr[c_char], AsmStringSize u64, Constraints Ptr[c_char], ConstraintsSize u64, HasSideEffects Bool, IsAlignStack Bool, Dialect InlineAsmDialect, CanThrow Bool) -> ValueRef
#[extern='LLVMGetInlineAsmAsmString']
fn GetInlineAsmAsmString(InlineAsmVal ValueRef, Len Ptr[u64]) -> Ptr[c_char]
#[extern='LLVMGetInlineAsmConstraintString']
fn GetInlineAsmConstraintString(InlineAsmVal ValueRef, Len Ptr[u64]) -> Ptr[c_char]
#[extern='LLVMGetInlineAsmDialect']
fn GetInlineAsmDialect(InlineAsmVal ValueRef) -> InlineAsmDialect
#[extern='LLVMGetInlineAsmFunctionType']
fn GetInlineAsmFunctionType(InlineAsmVal ValueRef) -> TypeRef
#[extern='LLVMGetInlineAsmHasSideEffects']
fn GetInlineAsmHasSideEffects(InlineAsmVal ValueRef) -> Bool
#[extern='LLVMGetInlineAsmNeedsAlignedStack']
fn GetInlineAsmNeedsAlignedStack(InlineAsmVal ValueRef) -> Bool
#[extern='LLVMGetInlineAsmCanUnwind']
fn GetInlineAsmCanUnwind(InlineAsmVal ValueRef) -> Bool
#[extern='LLVMGetModuleContext']
fn GetModuleContext(M ModuleRef) -> ContextRef
#[extern='LLVMGetTypeByName']
fn GetTypeByName(M ModuleRef, Name Ptr[c_char]) -> TypeRef
#[extern='LLVMGetFirstNamedMetadata']
fn GetFirstNamedMetadata(M ModuleRef) -> NamedMDNodeRef
#[extern='LLVMGetLastNamedMetadata']
fn GetLastNamedMetadata(M ModuleRef) -> NamedMDNodeRef
#[extern='LLVMGetNextNamedMetadata']
fn GetNextNamedMetadata(NamedMDNode NamedMDNodeRef) -> NamedMDNodeRef
#[extern='LLVMGetPreviousNamedMetadata']
fn GetPreviousNamedMetadata(NamedMDNode NamedMDNodeRef) -> NamedMDNodeRef
#[extern='LLVMGetNamedMetadata']
fn GetNamedMetadata(M ModuleRef, Name Ptr[c_char], NameLen u64) -> NamedMDNodeRef
#[extern='LLVMGetOrInsertNamedMetadata']
fn GetOrInsertNamedMetadata(M ModuleRef, Name Ptr[c_char], NameLen u64) -> NamedMDNodeRef
#[extern='LLVMGetNamedMetadataName']
fn GetNamedMetadataName(NamedMD NamedMDNodeRef, NameLen Ptr[u64]) -> Ptr[c_char]
#[extern='LLVMGetNamedMetadataNumOperands']
fn GetNamedMetadataNumOperands(M ModuleRef, Name Ptr[c_char]) -> c_uint
#[extern='LLVMGetNamedMetadataOperands']
fn GetNamedMetadataOperands(M ModuleRef, Name Ptr[c_char], Dest Ptr[ValueRef]) -> void
#[extern='LLVMAddNamedMetadataOperand']
fn AddNamedMetadataOperand(M ModuleRef, Name Ptr[c_char], Val ValueRef) -> void
#[extern='LLVMGetDebugLocDirectory']
fn GetDebugLocDirectory(Val ValueRef, Length Ptr[c_uint]) -> Ptr[c_char]
#[extern='LLVMGetDebugLocFilename']
fn GetDebugLocFilename(Val ValueRef, Length Ptr[c_uint]) -> Ptr[c_char]
#[extern='LLVMGetDebugLocLine']
fn GetDebugLocLine(Val ValueRef) -> c_uint
#[extern='LLVMGetDebugLocColumn']
fn GetDebugLocColumn(Val ValueRef) -> c_uint
#[extern='LLVMAddFunction']
fn AddFunction(M ModuleRef, Name Ptr[c_char], FunctionTy TypeRef) -> ValueRef
#[extern='LLVMGetNamedFunction']
fn GetNamedFunction(M ModuleRef, Name Ptr[c_char]) -> ValueRef
#[extern='LLVMGetNamedFunctionWithLength']
fn GetNamedFunctionWithLength(M ModuleRef, Name Ptr[c_char], Length u64) -> ValueRef
#[extern='LLVMGetFirstFunction']
fn GetFirstFunction(M ModuleRef) -> ValueRef
#[extern='LLVMGetLastFunction']
fn GetLastFunction(M ModuleRef) -> ValueRef
#[extern='LLVMGetNextFunction']
fn GetNextFunction(param0 ValueRef) -> ValueRef
#[extern='LLVMGetPreviousFunction']
fn GetPreviousFunction(param0 ValueRef) -> ValueRef
#[extern='LLVMSetModuleInlineAsm']
fn SetModuleInlineAsm(M ModuleRef, Asm Ptr[c_char]) -> void
#[extern='LLVMGetTypeKind']
fn GetTypeKind(Ty TypeRef) -> TypeKind
#[extern='LLVMTypeIsSized']
fn TypeIsSized(Ty TypeRef) -> Bool
#[extern='LLVMGetTypeContext']
fn GetTypeContext(Ty TypeRef) -> ContextRef
#[extern='LLVMDumpType']
fn DumpType(Val TypeRef) -> void
#[extern='LLVMPrintTypeToString']
fn PrintTypeToString(Val TypeRef) -> Ptr[c_char]
#[extern='LLVMInt1TypeInContext']
fn Int1TypeInContext(C ContextRef) -> TypeRef
#[extern='LLVMInt8TypeInContext']
fn Int8TypeInContext(C ContextRef) -> TypeRef
#[extern='LLVMInt16TypeInContext']
fn Int16TypeInContext(C ContextRef) -> TypeRef
#[extern='LLVMInt32TypeInContext']
fn Int32TypeInContext(C ContextRef) -> TypeRef
#[extern='LLVMInt64TypeInContext']
fn Int64TypeInContext(C ContextRef) -> TypeRef
#[extern='LLVMInt128TypeInContext']
fn Int128TypeInContext(C ContextRef) -> TypeRef
#[extern='LLVMIntTypeInContext']
fn IntTypeInContext(C ContextRef, NumBits c_uint) -> TypeRef
#[extern='LLVMInt1Type']
fn Int1Type() -> TypeRef
#[extern='LLVMInt8Type']
fn Int8Type() -> TypeRef
#[extern='LLVMInt16Type']
fn Int16Type() -> TypeRef
#[extern='LLVMInt32Type']
fn Int32Type() -> TypeRef
#[extern='LLVMInt64Type']
fn Int64Type() -> TypeRef
#[extern='LLVMInt128Type']
fn Int128Type() -> TypeRef
#[extern='LLVMIntType']
fn IntType(NumBits c_uint) -> TypeRef
#[extern='LLVMGetIntTypeWidth']
fn GetIntTypeWidth(IntegerTy TypeRef) -> c_uint
#[extern='LLVMHalfTypeInContext']
fn HalfTypeInContext(C ContextRef) -> TypeRef
#[extern='LLVMBFloatTypeInContext']
fn BFloatTypeInContext(C ContextRef) -> TypeRef
#[extern='LLVMFloatTypeInContext']
fn FloatTypeInContext(C ContextRef) -> TypeRef
#[extern='LLVMDoubleTypeInContext']
fn DoubleTypeInContext(C ContextRef) -> TypeRef
#[extern='LLVMX86FP80TypeInContext']
fn X86FP80TypeInContext(C ContextRef) -> TypeRef
#[extern='LLVMFP128TypeInContext']
fn FP128TypeInContext(C ContextRef) -> TypeRef
#[extern='LLVMPPCFP128TypeInContext']
fn PPCFP128TypeInContext(C ContextRef) -> TypeRef
#[extern='LLVMHalfType']
fn HalfType() -> TypeRef
#[extern='LLVMBFloatType']
fn BFloatType() -> TypeRef
#[extern='LLVMFloatType']
fn FloatType() -> TypeRef
#[extern='LLVMDoubleType']
fn DoubleType() -> TypeRef
#[extern='LLVMX86FP80Type']
fn X86FP80Type() -> TypeRef
#[extern='LLVMFP128Type']
fn FP128Type() -> TypeRef
#[extern='LLVMPPCFP128Type']
fn PPCFP128Type() -> TypeRef
#[extern='LLVMFunctionType']
fn FunctionType(ReturnType TypeRef, ParamTypes Ptr[TypeRef], ParamCount c_uint, IsVarArg Bool) -> TypeRef
#[extern='LLVMIsFunctionVarArg']
fn IsFunctionVarArg(FunctionTy TypeRef) -> Bool
#[extern='LLVMGetReturnType']
fn GetReturnType(FunctionTy TypeRef) -> TypeRef
#[extern='LLVMCountParamTypes']
fn CountParamTypes(FunctionTy TypeRef) -> c_uint
#[extern='LLVMGetParamTypes']
fn GetParamTypes(FunctionTy TypeRef, Dest Ptr[TypeRef]) -> void
#[extern='LLVMStructTypeInContext']
fn StructTypeInContext(C ContextRef, ElementTypes Ptr[TypeRef], ElementCount c_uint, Packed Bool) -> TypeRef
#[extern='LLVMStructType']
fn StructType(ElementTypes Ptr[TypeRef], ElementCount c_uint, Packed Bool) -> TypeRef
#[extern='LLVMStructCreateNamed']
fn StructCreateNamed(C ContextRef, Name Ptr[c_char]) -> TypeRef
#[extern='LLVMGetStructName']
fn GetStructName(Ty TypeRef) -> Ptr[c_char]
#[extern='LLVMStructSetBody']
fn StructSetBody(StructTy TypeRef, ElementTypes Ptr[TypeRef], ElementCount c_uint, Packed Bool) -> void
#[extern='LLVMCountStructElementTypes']
fn CountStructElementTypes(StructTy TypeRef) -> c_uint
#[extern='LLVMGetStructElementTypes']
fn GetStructElementTypes(StructTy TypeRef, Dest Ptr[TypeRef]) -> void
#[extern='LLVMStructGetTypeAtIndex']
fn StructGetTypeAtIndex(StructTy TypeRef, i c_uint) -> TypeRef
#[extern='LLVMIsPackedStruct']
fn IsPackedStruct(StructTy TypeRef) -> Bool
#[extern='LLVMIsOpaqueStruct']
fn IsOpaqueStruct(StructTy TypeRef) -> Bool
#[extern='LLVMIsLiteralStruct']
fn IsLiteralStruct(StructTy TypeRef) -> Bool
#[extern='LLVMGetElementType']
fn GetElementType(Ty TypeRef) -> TypeRef
#[extern='LLVMGetSubtypes']
fn GetSubtypes(Tp TypeRef, Arr Ptr[TypeRef]) -> void
#[extern='LLVMGetNumContainedTypes']
fn GetNumContainedTypes(Tp TypeRef) -> c_uint
#[extern='LLVMArrayType']
fn ArrayType(ElementType TypeRef, ElementCount c_uint) -> TypeRef
#[extern='LLVMArrayType2']
fn ArrayType2(ElementType TypeRef, ElementCount u64) -> TypeRef
#[extern='LLVMGetArrayLength']
fn GetArrayLength(ArrayTy TypeRef) -> c_uint
#[extern='LLVMGetArrayLength2']
fn GetArrayLength2(ArrayTy TypeRef) -> u64
#[extern='LLVMPointerType']
fn PointerType(ElementType TypeRef, AddressSpace c_uint) -> TypeRef
#[extern='LLVMPointerTypeIsOpaque']
fn PointerTypeIsOpaque(Ty TypeRef) -> Bool
#[extern='LLVMPointerTypeInContext']
fn PointerTypeInContext(C ContextRef, AddressSpace c_uint) -> TypeRef
#[extern='LLVMGetPointerAddressSpace']
fn GetPointerAddressSpace(PointerTy TypeRef) -> c_uint
#[extern='LLVMVectorType']
fn VectorType(ElementType TypeRef, ElementCount c_uint) -> TypeRef
#[extern='LLVMScalableVectorType']
fn ScalableVectorType(ElementType TypeRef, ElementCount c_uint) -> TypeRef
#[extern='LLVMGetVectorSize']
fn GetVectorSize(VectorTy TypeRef) -> c_uint
#[extern='LLVMGetConstantPtrAuthPointer']
fn GetConstantPtrAuthPointer(PtrAuth ValueRef) -> ValueRef
#[extern='LLVMGetConstantPtrAuthKey']
fn GetConstantPtrAuthKey(PtrAuth ValueRef) -> ValueRef
#[extern='LLVMGetConstantPtrAuthDiscriminator']
fn GetConstantPtrAuthDiscriminator(PtrAuth ValueRef) -> ValueRef
#[extern='LLVMGetConstantPtrAuthAddrDiscriminator']
fn GetConstantPtrAuthAddrDiscriminator(PtrAuth ValueRef) -> ValueRef
#[extern='LLVMVoidTypeInContext']
fn VoidTypeInContext(C ContextRef) -> TypeRef
#[extern='LLVMLabelTypeInContext']
fn LabelTypeInContext(C ContextRef) -> TypeRef
#[extern='LLVMX86AMXTypeInContext']
fn X86AMXTypeInContext(C ContextRef) -> TypeRef
#[extern='LLVMTokenTypeInContext']
fn TokenTypeInContext(C ContextRef) -> TypeRef
#[extern='LLVMMetadataTypeInContext']
fn MetadataTypeInContext(C ContextRef) -> TypeRef
#[extern='LLVMVoidType']
fn VoidType() -> TypeRef
#[extern='LLVMLabelType']
fn LabelType() -> TypeRef
#[extern='LLVMX86AMXType']
fn X86AMXType() -> TypeRef
#[extern='LLVMTargetExtTypeInContext']
fn TargetExtTypeInContext(C ContextRef, Name Ptr[c_char], TypeParams Ptr[TypeRef], TypeParamCount c_uint, IntParams Ptr[c_uint], IntParamCount c_uint) -> TypeRef
#[extern='LLVMGetTargetExtTypeName']
fn GetTargetExtTypeName(TargetExtTy TypeRef) -> Ptr[c_char]
#[extern='LLVMGetTargetExtTypeNumTypeParams']
fn GetTargetExtTypeNumTypeParams(TargetExtTy TypeRef) -> c_uint
#[extern='LLVMGetTargetExtTypeTypeParam']
fn GetTargetExtTypeTypeParam(TargetExtTy TypeRef, Idx c_uint) -> TypeRef
#[extern='LLVMGetTargetExtTypeNumIntParams']
fn GetTargetExtTypeNumIntParams(TargetExtTy TypeRef) -> c_uint
#[extern='LLVMGetTargetExtTypeIntParam']
fn GetTargetExtTypeIntParam(TargetExtTy TypeRef, Idx c_uint) -> c_uint
#[extern='LLVMTypeOf']
fn TypeOf(Val ValueRef) -> TypeRef
#[extern='LLVMGetValueKind']
fn GetValueKind(Val ValueRef) -> ValueKind
#[extern='LLVMGetValueName2']
fn GetValueName2(Val ValueRef, Length Ptr[u64]) -> Ptr[c_char]
#[extern='LLVMSetValueName2']
fn SetValueName2(Val ValueRef, Name Ptr[c_char], NameLen u64) -> void
#[extern='LLVMDumpValue']
fn DumpValue(Val ValueRef) -> void
#[extern='LLVMPrintValueToString']
fn PrintValueToString(Val ValueRef) -> Ptr[c_char]
#[extern='LLVMGetValueContext']
fn GetValueContext(Val ValueRef) -> ContextRef
#[extern='LLVMPrintDbgRecordToString']
fn PrintDbgRecordToString(Record DbgRecordRef) -> Ptr[c_char]
#[extern='LLVMReplaceAllUsesWith']
fn ReplaceAllUsesWith(OldVal ValueRef, NewVal ValueRef) -> void
#[extern='LLVMIsConstant']
fn IsConstant(Val ValueRef) -> Bool
#[extern='LLVMIsUndef']
fn IsUndef(Val ValueRef) -> Bool
#[extern='LLVMIsPoison']
fn IsPoison(Val ValueRef) -> Bool
#[extern='LLVMIsAMDNode']
fn IsAMDNode(Val ValueRef) -> ValueRef
#[extern='LLVMIsAValueAsMetadata']
fn IsAValueAsMetadata(Val ValueRef) -> ValueRef
#[extern='LLVMIsAMDString']
fn IsAMDString(Val ValueRef) -> ValueRef
#[extern='LLVMGetValueName']
fn GetValueName(Val ValueRef) -> Ptr[c_char]
#[extern='LLVMSetValueName']
fn SetValueName(Val ValueRef, Name Ptr[c_char]) -> void
#[extern='LLVMGetFirstUse']
fn GetFirstUse(Val ValueRef) -> UseRef
#[extern='LLVMGetNextUse']
fn GetNextUse(U UseRef) -> UseRef
#[extern='LLVMGetUser']
fn GetUser(U UseRef) -> ValueRef
#[extern='LLVMGetUsedValue']
fn GetUsedValue(U UseRef) -> ValueRef
#[extern='LLVMGetOperand']
fn GetOperand(Val ValueRef, Index c_uint) -> ValueRef
#[extern='LLVMGetOperandUse']
fn GetOperandUse(Val ValueRef, Index c_uint) -> UseRef
#[extern='LLVMSetOperand']
fn SetOperand(User ValueRef, Index c_uint, Val ValueRef) -> void