-
Notifications
You must be signed in to change notification settings - Fork 8
/
llvm.vapi
1833 lines (1698 loc) · 81.4 KB
/
llvm.vapi
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
/*
* API for LLVM 3.0
*
* Maintained by Andre Masella <https://github.com/apmasell/vapis>
* Based on Marc-André Lureau <http://gitorious.org/llvm-vapi>
*
* Marc-André Lureau did not list a license, but I assume this, since it based
* on the LLVM code, it is distributed under the University of Illinois Open
* Source Licence.
*/
[CCode (cheader_filename = "llvm-c/Core.h")]
namespace LLVM {
/**
* IR Builder
*/
[Compact]
[CCode (cname = "struct LLVMOpaqueBuilder", free_function = "LLVMDisposeBuilder", has_type_id = false)]
public class Builder {
/**
* Create a new builder in the global context.
*/
[CCode (cname = "LLVMCreateBuilder")]
public Builder ();
[CCode (cname = "LLVMPositionBuilder")]
public void position (BasicBlock block, Instruction instr);
[CCode (cname = "LLVMPositionBuilderBefore")]
public void position_before (Instruction instr);
[CCode (cname = "LLVMPositionBuilderAtEnd")]
public void position_at_end (BasicBlock block);
[CCode (cname = "LLVMBuildRetVoid")]
public ReturnInst build_ret_void ();
[CCode (cname = "LLVMBuildRet")]
public ReturnInst build_ret (LLVM.Value v);
[CCode (cname = "LLVMBuildAggregateRet")]
public ReturnInst build_aggregate_ret (LLVM.Value[] ret_vals);
[CCode (cname = "LLVMBuildBr")]
public BranchInst build_br (BasicBlock dest);
[CCode (cname = "LLVMBuildCondBr")]
public BranchInst build_cond_br (Value @if, BasicBlock then, BasicBlock @else);
[CCode (cname = "LLVMBuildSwitch")]
public SwitchInst build_switch (Value v, BasicBlock @else, uint num_cases = 10);
[CCode (cname = "LLVMBuildInvoke")]
public InvokeInst build_invoke (Value Fn, [CCode (array_length_pos = 2.9)] Value[] args, BasicBlock then, BasicBlock @catch, string name = "");
[CCode (cname = "LLVMBuildLandingPad")]
public Value build_landing_pad (Ty ty, Value pers_fn, uint num_clauses, string name);
[CCode (cname = "LLVMBuildResume")]
public Value build_resume (Value exn);
[CCode (cname = "LLVMBuildUnreachable")]
public UnreachableInst build_unreachable ();
[CCode (cname = "LLVMBuildAdd")]
public Value build_add (Value lhs, Value rhs, string name = "");
[CCode (cname = "LLVMBuildNSWAdd")]
public Value build_nswadd (Value lhs, Value rhs, string name = "");
[CCode (cname = "LLVMBuildFAdd")]
public Value build_fadd (Value lhs, Value rhs, string name = "");
[CCode (cname = "LLVMBuildSub")]
public Value build_sub (Value lhs, Value rhs, string name = "");
[CCode (cname = "LLVMBuildFSub")]
public Value build_fsub (Value lhs, Value rhs, string name = "");
[CCode (cname = "LLVMBuildMul")]
public Value build_mul (Value lhs, Value rhs, string name = "");
[CCode (cname = "LLVMBuildFMul")]
public Value build_fmul (Value lhs, Value rhs, string name = "");
[CCode (cname = "LLVMBuildUDiv")]
public Value build_udiv (Value lhs, Value rhs, string name = "");
[CCode (cname = "LLVMBuildFDiv")]
public Value build_fdiv (Value lhs, Value rhs, string name = "");
[CCode (cname = "LLVMBuildSDiv")]
public Value build_sdiv (Value lhs, Value rhs, string name = "");
[CCode (cname = "LLVMBuildExactSDiv")]
public Value build_exact_sdiv (Value lhs, Value rhs, string name = "");
[CCode (cname = "LLVMBuildURem")]
public Value build_urem (Value lhs, Value rhs, string name = "");
[CCode (cname = "LLVMBuildSRem")]
public Value build_srem (Value lhs, Value rhs, string name = "");
[CCode (cname = "LLVMBuildFRem")]
public Value build_frem (Value lhs, Value rhs, string name = "");
[CCode (cname = "LLVMBuildShl")]
public Value build_shl (Value lhs, Value rhs, string name = "");
[CCode (cname = "LLVMBuildLShr")]
public Value build_lshr (Value lhs, Value rhs, string name = "");
[CCode (cname = "LLVMBuildAShr")]
public Value build_ashr (Value lhs, Value rhs, string name = "");
[CCode (cname = "LLVMBuildAnd")]
public Value build_and (Value lhs, Value rhs, string name = "");
[CCode (cname = "LLVMBuildOr")]
public Value build_or (Value lhs, Value rhs, string name = "");
[CCode (cname = "LLVMBuildXor")]
public Value build_xor (Value lhs, Value rhs, string name = "");
[CCode (cname = "LLVMBuildNeg")]
public Value build_neg (Value v, string name = "");
[CCode (cname = "LLVMBuildFNeg")]
public Value build_fneg (Value v, string name = "");
[CCode (cname = "LLVMBuildNot")]
public Value build_not (Value v, string name = "");
[CCode (cname = "LLVMBuildMalloc")]
public CallInst build_malloc (Ty ty, string name = "");
[CCode (cname = "LLVMBuildArrayMalloc")]
public CallInst build_array_malloc (Ty ty, Value val, string name = "");
[CCode (cname = "LLVMBuildAlloca")]
public AllocaInst build_alloca (Ty ty, string name = "");
[CCode (cname = "LLVMBuildArrayAlloca")]
public AllocaInst build_array_alloca (Ty ty, Value val, string name = "");
[CCode (cname = "LLVMBuildFree")]
public CallInst build_free (Value pointer_val);
[CCode (cname = "LLVMBuildLoad")]
public LoadInst build_load (Value pointer_val, string name = "");
[CCode (cname = "LLVMBuildStore")]
public StoreInst build_store (Value val, Value ptr);
[CCode (cname = "LLVMBuildGEP")]
public GEPInst build_gep (Value pointer, [CCode (array_length_pos = 2.9)] Value[] indices, string name = "");
[CCode (cname = "LLVMBuildInBoundsGEP")]
public GEPInst build_in_bounds_gep (Value pointer, [CCode (array_length_pos = 2.9)] Value[] indices, string name = "");
[CCode (cname = "LLVMBuildStructGEP")]
public GEPInst build_struct_gep (Value pointer, uint idx, string name = "");
[CCode (cname = "LLVMBuildGlobalString")]
public GlobalValue build_global_string (string str, string name = "");
[CCode (cname = "LLVMBuildGlobalStringPtr")]
public GEPInst build_global_string_ptr (string str, string name = "");
[CCode (cname = "LLVMBuildTrunc")]
public CastInst build_trunc (Value val, Ty destty, string name = "");
[CCode (cname = "LLVMBuildZExt")]
public CastInst build_zext (Value val, Ty destty, string name = "");
[CCode (cname = "LLVMBuildSExt")]
public CastInst build_sext (Value val, Ty destty, string name = "");
[CCode (cname = "LLVMBuildFPToSI")]
public CastInst build_fp_to_si (Value val, Ty destty, string name = "");
[CCode (cname = "LLVMBuildFPToUI")]
public CastInst build_fp_to_ui (Value val, Ty destty, string name = "");
[CCode (cname = "LLVMBuildUIToFP")]
public CastInst build_ui_to_fp (Value val, Ty destty, string name = "");
[CCode (cname = "LLVMBuildSIToFP")]
public CastInst build_si_to_fp (Value val, Ty destty, string name = "");
[CCode (cname = "LLVMBuildFPTrunc")]
public CastInst build_fp_trunc (Value val, Ty destty, string name = "");
[CCode (cname = "LLVMBuildFPExt")]
public CastInst build_fp_ext (Value val, Ty destty, string name = "");
[CCode (cname = "LLVMBuildPtrToInt")]
public CastInst build_ptr_to_int (Value val, Ty destty, string name = "");
[CCode (cname = "LLVMBuildIntToPtr")]
public CastInst build_int_to_ptr (Value val, Ty destty, string name = "");
[CCode (cname = "LLVMBuildBitCast")]
public CastInst build_bit_cast (Value val, Ty destty, string name = "");
[CCode (cname = "LLVMBuildZExtOrBitCast")]
public CastInst build_zext_or_bit_cast (Value val, Ty destty, string name = "");
[CCode (cname = "LLVMBuildSExtOrBitCast")]
public CastInst build_sext_or_bit_cast (Value val, Ty destty, string name = "");
[CCode (cname = "LLVMBuildTruncOrBitCast")]
public CastInst build_trunc_or_bit_cast (Value val, Ty destty, string name = "");
[CCode (cname = "LLVMBuildPointerCast")]
public CastInst build_pointer_cast (Value val, Ty destty, string name = "");
[CCode (cname = "LLVMBuildIntCast")]
public CastInst build_int_cast (Value val, Ty destty, string name = "");
[CCode (cname = "LLVMBuildFPCast")]
public CastInst build_fp_cast (Value val, Ty destty, string name = "");
[CCode (cname = "LLVMBuildICmp")]
public ICmpInst build_icmp (IntPredicate op, Value lhs, Value rhs, string name = "");
[CCode (cname = "LLVMBuildFCmp")]
public FCmpInst build_fcmp (RealPredicate op, Value lhs, Value rhs, string name = "");
[CCode (cname = "LLVMBuildPhi")]
public PHINode build_phi (Ty ty, string name = "");
[CCode (cname = "LLVMBuildCall")]
public CallInst build_call (Function fn, [CCode (array_length_pos = 2.9)] LLVM.Value[] args, string name = "");
[CCode (cname = "LLVMBuildSelect")]
public SelectInst build_select (Value @if, Value then, Value @else, string name = "");
[CCode (cname = "LLVMBuildVAArg")]
public VAArgInst build_vaarg (Value list, Ty ty, string name = "");
[CCode (cname = "LLVMBuildExtractElement")]
public ExtractElementInst build_extract_element (Value vec_val, Value index, string name = "");
[CCode (cname = "LLVMBuildInsertElement")]
public InsertElementInst build_insert_element (Value vec_val, Value elt_val, Value index, string name = "");
[CCode (cname = "LLVMBuildShuffleVector")]
public ShuffleVectorInst build_shuffle_vector (Value v1, Value v2, Value mask, string name = "");
[CCode (cname = "LLVMBuildExtractValue")]
public ExtractValueInst build_extract_value (Value agg_val, uint index, string name = "");
[CCode (cname = "LLVMBuildInsertValue")]
public InsertValueInst build_insert_value (Value agg_val, Value elt_val, uint index, string name = "");
[CCode (cname = "LLVMBuildIsNotNull")]
public ICmpInst build_is_not_null (Value val, string name = "");
[CCode (cname = "LLVMBuildIsNull")]
public ICmpInst build_is_null (Value val, string name = "");
[CCode (cname = "LLVMBuildPtrDiff")]
public Value build_ptr_diff (Value lhs, Value rhs, string name = "");
[CCode (cname = "LLVMGetInsertBlock")]
public BasicBlock get_insert_block ();
[CCode (cname = "LLVMClearInsertionPosition")]
public void clear_insertion_position ();
[CCode (cname = "LLVMInsertIntoBuilder")]
public void insert (Instruction instr);
[CCode (cname = "LLVMInsertIntoBuilderWithName")]
public void insert_with_name (Instruction instr, string name = "");
public BasicBlock insert_block {
[CCode (cname = "LLVMGetInsertBlock")] get;
}
}
/**
* Owner of LLVM's infrastructure
*
* This is an important class for using LLVM in a threaded context. It
* (opaquely) owns and manages the core "global" data of LLVM's core
* infrastructure, including the type and constant uniquing tables. It
* provides no locking guarantees, so you should be careful to have one
* context per thread.
*/
[Compact]
[CCode (cname = "struct LLVMOpaqueContext", free_function = "LLVMContextDispose", has_type_id = false)]
public class Context {
[CCode (cname = "LLVMContextCreate")]
public Context ();
[CCode (cname = "LLVMAppendBasicBlockInContext")]
BasicBlock append_basic_block (Value fn, string name = "");
[CCode (cname = "LLVMInsertBasicBlockInContext")]
BasicBlock insert_basic_block (BasicBlock bb, string name = "");
[CCode (cname = "LLVMGetGlobalContext")]
public static unowned Context get_global ();
[CCode (cname = "LLVMModuleCreateWithNameInContext", instance_pos = -1)]
public Module create_module (string name);
/**
* Create a new builder in the supplied context.
*
* The builder will become invalid if the context is released.
*/
[CCode (cname = "LLVMCreateBuilderInContext")]
public Builder create_builder ();
[CCode (cname = "LLVMDoubleTypeInContext")]
public Ty double ();
[CCode (cname = "LLVMFP128TypeInContext")]
public Ty fp128 ();
[CCode (cname = "LLVMFloatTypeInContext")]
public Ty float ();
[CCode (cname = "LLVMInt16TypeInContext")]
public Ty int16 ();
[CCode (cname = "LLVMInt1TypeInContext")]
public Ty int1 ();
[CCode (cname = "LLVMInt32TypeInContext")]
public Ty int32 ();
[CCode (cname = "LLVMInt64TypeInContext")]
public Ty int64 ();
[CCode (cname = "LLVMInt8TypeInContext")]
public Ty int8 ();
[CCode (cname = "LLVMIntTypeInContext")]
public Ty int (uint num_bits);
[CCode (cname = "LLVMLabelTypeInContext")]
public Ty label ();
[CCode (cname = "LLVMPPCFP128TypeInContext")]
public Ty ppcfp128 ();
[CCode (cname = "LLVMStructTypeInContext")]
public Ty struct (Ty[] element_types, bool packed);
[CCode (cname = "LLVMVoidTypeInContext")]
public Ty void ();
[CCode (cname = "LLVMX86FP80TypeInContext")]
public Ty x86fp80 ();
[CCode (cname = "LLVMConstStringInContext")]
public Constant const_string (uint8[] str, bool dont_null_terminate);
[CCode (cname = "LLVMConstStructInContext")]
public Constant const_struct (LLVM.Value[] constant_vals, bool packed);
}
/**
* Interface for implementation execution of LLVM modules
*
* This interface is designed to support both interpreter and just-in-time
* (JIT) compiler implementations.
*/
[Compact]
[CCode (cname = "struct LLVMOpaqueExecutionEngine", free_function = "LLVMDisposeExecutionEngine", cheader_filename = "llvm-c/ExecutionEngine.h", has_type_id = false)]
public class ExecutionEngine {
/**
* Create an execution engine which is appropriate for the current machine.
*/
[CCode (cname = "LLVMCreateExecutionEngine")]
public static bool create_execution_engine (out ExecutionEngine ee, owned ModuleProvider m, out string error);
/**
* This is the factory method for creating a JIT for the current machine,
* it does not fall back to the interpreter.
*
* Clients should make sure to initialize targets prior to calling this function.
*/
[CCode (cname = "LLVMCreateJITCompiler")]
public static bool create_jit_compiler (out ExecutionEngine jit, owned ModuleProvider m, uint opt_level, out string error);
[CCode (cname = "LLVMCreateInterpreter")]
public static bool create_interpreter (out ExecutionEngine interp, owned ModuleProvider m, out string error);
public TargetData target_data {
[CCode (cname = "LLVMGetExecutionEngineTargetData")] get;
}
/**
* Tell the execution engine that the specified global is at the specified location.
*
* This is used internally as functions are JIT'd and as global variables
* are laid out in memory. It can and should also be used by clients of the
* EE that want to have an LLVM global overlay existing data in memory.
* Mappings are automatically removed when their {@link GlobalValue} is destroyed.
*/
[CCode (cname = "LLVMAddGlobalMapping")]
public void add_global_mapping (Value global, void* addr);
/**
* Add a module to the list of modules that we can JIT from.
*/
[CCode (cname = "LLVMAddModuleProvider")]
public void add_module_provider (owned ModuleProvider mp);
[CCode (cname = "LLVMRemoveModuleProvider")]
public int remove_module_provider (ModuleProvider mp, out Module mod, out string error);
/**
* Execute the specified function with the specified arguments, and return the result.
*/
[CCode (cname = "LLVMRunFunction")]
public GenericValue run_function (Function f, [CCode (array_length_pos = 1.9)] GenericValue[] args);
/**
* This method is used to execute all of the static constructors for a program.
*/
[CCode (cname = "LLVMRunStaticConstructors")]
public void run_static_constructors ();
/**
* This method is used to execute all of the static destructors for a program.
*/
[CCode (cname = "LLVMRunStaticDestructors")]
public void run_static_destructors ();
[CCode (cname = "LLVMRunFunctionAsMain")]
public int run_function_as_main (Function f, [CCode (array_length_pos = 1.9)] string[] args, [CCode (array_length = false, array_null_terminated = true)] string[] env);
/**
* Release memory in the ExecutionEngine corresponding to the machine code emitted to execute this function.
*
* Useful for garbage-collecting generated code.
*/
[CCode (cname = "LLVMFreeMachineCodeForFunction")]
public void free_machine_code_for_function (Function f);
/**
* Search all of the active modules to find the one that defines the function.
*
* This is very slow operation and shouldn't be used for general code.
*/
[CCode (cname = "LLVMFindFunction")]
public int find_function (string name, out Function f);
/**
* This returns the address of the specified global value.
*
* This may involve code generation if it's a function.
*/
[CCode (cname = "LLVMGetPointerToGlobal")]
public void * get_pointer_to_global (GlobalValue global);
}
[Compact]
[CCode (cname = "struct LLVMOpaqueGenericValue", free_function = "LLVMDisposeGenericValue", cheader_filename = "llvm-c/ExecutionEngine.h", has_type_id = false)]
public class GenericValue {
[CCode (cname = "LLVMCreateGenericValueOfFloat", cheader_filename = "llvm-c/ExecutionEngine.h")]
public GenericValue.of_float (Ty ty, double n);
[CCode (cname = "LLVMCreateGenericValueOfInt", cheader_filename = "llvm-c/ExecutionEngine.h")]
public GenericValue.of_int (Ty ty, uint n, int is_signed);
[CCode (cname = "LLVMCreateGenericValueOfPointer", cheader_filename = "llvm-c/ExecutionEngine.h")]
public GenericValue.of_pointer (void* p);
public uint int_witdh {
[CCode (cname = "LLVMGenericValueIntWidth", cheader_filename = "llvm-c/ExecutionEngine.h")] get;
}
[CCode (cname = "LLVMGenericValueToFloat", instance_pos = 1.9, cheader_filename = "llvm-c/ExecutionEngine.h")]
public double to_float (Ty ty);
[CCode (cname = "LLVMGenericValueToInt", cheader_filename = "llvm-c/ExecutionEngine.h")]
public uint to_int (int is_signed);
[CCode (cname = "LLVMGenericValueToPointer", cheader_filename = "llvm-c/ExecutionEngine.h")]
public void * to_pointer ();
}
[Compact]
[CCode (cname = "struct LLVMOpaqueMemoryBuffer", free_function = "LLVMDisposeMemoryBuffer", cheader_filename = "llvm-c/BitReader.h", has_type_id = false)]
public class MemoryBuffer {
[CCode (cname = "LLVMCreateMemoryBufferWithSTDIN")]
public static int create_with_stdin (out MemoryBuffer membuf, out string message);
[CCode (cname = "LLVMCreateMemoryBufferWithContentsOfFile")]
public static int create_with_contents_of_file (string path, out MemoryBuffer membuf, out string message);
// TODO ownedness of self depends on result
[CCode (cname = "LLVMGetBitcodeModuleProvider")]
public bool get_module_provider (out unowned ModuleProvider mp, out string message);
[CCode (cname = "LLVMGetBitcodeModuleProviderInContext", instance_pos = 1.9)]
public bool get_module_provider_in_context (Context context, out unowned ModuleProvider mp, out string message);
[CCode (cname = "LLVMParseBitcode", cheader_filename = "llvm-c/BitReader.h")]
public bool parse_bitcode (out unowned Module module, out string message);
[CCode (cname = "LLVMParseBitcodeInContext", instance_pos = 1.9, cheader_filename = "llvm-c/BitReader.h")]
public bool parse_bitcode_in_context (Context Context, out unowned Module module, out string message);
}
/**
* A wrapper around modules.
*
* This exists for historical reasons.
*/
[Compact]
[CCode (cname = "struct LLVMOpaqueModuleProvider", free_function = "LLVMDisposeModuleProvider", has_type_id = false)]
public class ModuleProvider {
[CCode (cname = "LLVMCreateModuleProviderForExistingModule")]
public ModuleProvider (owned Module m);
}
/**
* Container for the LLVM Intermediate Representation
*
* An instance is used to store all the information related to an LLVM
* module. Modules are the top level container of all other LLVM Intermediate
* Representation (IR) objects. Each module directly contains a list of
* globals variables, a list of functions, a list of libraries (or other
* modules) this module depends on, a symbol table, and various data about
* the target's characteristics.
*
* A module maintains a list of all constant references to global variables
* in the module. When a global variable is destroyed, it should have no
* entries in this table.
*/
[Compact]
[CCode (cname = "struct LLVMOpaqueModule", free_function = "LLVMDisposeModule", has_type_id = false)]
public class Module {
[CCode (cname = "LLVMModuleCreateWithName")]
public Module (string name);
/**
* The type sizes and alignments expected by this module.
*/
public string data_layout {
[CCode (cname = "LLVMGetDataLayout")]
get;
[CCode (cname = "LLVMSetDataLayout")]
set;
}
public string target {
[CCode (cname = "LLVMGetTarget")]
get;
[CCode (cname = "LLVMSetTarget")]
set;
}
[CCode (cname = "LLVMAddAlias")]
public GlobalAlias add_alias (LLVM.Ty ty, LLVM.Value aliasee, string name);
[CCode (cname = "LLVMDumpModule")]
public void dump ();
[CCode (cname = "LLVMGetNamedGlobal")]
public GlobalVariable get_named_global (string name);
public GlobalVariable first_global {
[CCode (cname = "LLVMGetFirstGlobal")] get;
}
public GlobalVariable last_global {
[CCode (cname = "LLVMGetLastGlobal")] get;
}
/**
* Look up the specified function in the module symbol table.
*/
[CCode (cname = "LLVMGetNamedFunction")]
public Function? get_named_function (string name);
public Function first_function {
[CCode (cname = "LLVMGetFirstFunction")] get;
}
public Function last_function {
[CCode (cname = "LLVMGetLastFunction")] get;
}
[CCode (cname = "LLVMVerifyModule", cheader_filename = "llvm-c/Analysis.h")]
public int verify (VerifierFailureAction action, out string message);
[CCode (cname = "LLVMWriteBitcodeToFile", cheader_filename = "llvm-c/BitWriter.h")]
public int write_bitcode_to_file (string path);
[CCode (cname = "LLVMWriteBitcodeToFD", cheader_filename = "llvm-c/BitWriter.h")]
public bool write_bitcode_to_fd (int fd, bool should_close = true, bool unbuffered = false);
[Deprecated (replacement = "write_bitcode_to_fd")]
[CCode (cname = "LLVMWriteBitcodeToFileHandle", cheader_filename = "llvm-c/BitWriter.h")]
public bool write_bitcode_to_file_handle (int handle);
public bool write_bitcode_to_file_stream (
# if POSIX
Posix.FILE
# else {
GLib.FileStream
# endif
file) {
write_bitcode_to_fd (file.fileno (), false, false);
}
[CCode (cname = "LLVMAddFunction")]
public Function add_function (string name, LLVM.Ty function_ty);
}
[CCode (cname = "LLVMAddGlobal")]
public GlobalVariable add_global (LLVM.Ty ty, string name);
[CCode (cname = "LLVMAddAlias")]
public GlobalAlias add_global_alias (LLVM.Ty ty, LLVM.Value aliasee, string name);
}
/**
* An abstract interface to allow code to add passes to a pass manager without having to hard-code what kind of pass manager it is.
*/
[Compact]
[CCode (cname = "struct LLVMOpaquePassManager", free_function = "LLVMDisposePassManager", has_type_id = false)]
public class PassManagerBase {
[CCode (cname = "LLVMAddTargetData", instance_pos = -1)]
public void add_target_data (TargetData target);
[CCode (cname = "LLVMAddAggressiveDCEPass", cheader_filename = "llvm-c/Transforms/Scalar.h")]
public void add_aggressive_dce ();
[CCode (cname = "LLVMAddArgumentPromotionPass", cheader_filename = "llvm-c/Transforms/IPO.h")]
public void add_argument_promotion ();
[CCode (cname = "LLVMAddCFGSimplificationPass", cheader_filename = "llvm-c/Transforms/Scalar.h")]
public void add_cfg_simplification ();
[CCode (cname = "LLVMAddConstantMergePass", cheader_filename = "llvm-c/Transforms/IPO.h")]
public void add_constant_merge ();
[CCode (cname = "LLVMAddConstantPropagationPass", cheader_filename = "llvm-c/Transforms/IPO.h")]
public void add_constant_propagation ();
[CCode (cname = "LLVMAddDeadArgEliminationPass", cheader_filename = "llvm-c/Transforms/Scalar.h")]
public void add_dead_arg_elimination ();
[CCode (cname = "LLVMAddDeadStoreEliminationPass", cheader_filename = "llvm-c/Transforms/Scalar.h")]
public void add_dead_store_elimination ();
[CCode (cname = "LLVMAddDemoteMemoryToRegisterPass", cheader_filename = "llvm-c/Transforms/Scalar.h")]
public void add_demote_memory_to_register ();
[CCode (cname = "LLVMAddFunctionAttrsPass", cheader_filename = "llvm-c/Transforms/IPO.h")]
public void add_function_attrs ();
[CCode (cname = "LLVMAddFunctionInliningPass", cheader_filename = "llvm-c/Transforms/IPO.h")]
public void add_function_inlining ();
[CCode (cname = "LLVMAddAlwaysInlinerPass")]
public void add_always_inliner ();
[CCode (cname = "LLVMAddGVNPass", cheader_filename = "llvm-c/Transforms/Scalar.h")]
public void add_gvn ();
[CCode (cname = "LLVMAddGlobalDCEPass", cheader_filename = "llvm-c/Transforms/IPO.h")]
public void add_global_dce ();
[CCode (cname = "LLVMAddGlobalOptimizerPass", cheader_filename = "llvm-c/Transforms/IPO.h")]
public void add_global_optimizer_pass ();
[CCode (cname = "LLVMAddIPConstantPropagationPass", cheader_filename = "llvm-c/Transforms/IPO.h")]
public void add_ipconstant_propagation ();
[CCode (cname = "LLVMAddIndVarSimplifyPass", cheader_filename = "llvm-c/Transforms/Scalar.h")]
public void add_ind_var_simplify ();
[CCode (cname = "LLVMAddInstructionCombiningPass", cheader_filename = "llvm-c/Transforms/Scalar.h")]
public void add_instruction_combining ();
[CCode (cname = "LLVMAddJumpThreadingPass", cheader_filename = "llvm-c/Transforms/Scalar.h")]
public void add_jump_threading ();
[CCode (cname = "LLVMAddLICMPass", cheader_filename = "llvm-c/Transforms/Scalar.h")]
public void add_licm ();
[CCode (cname = "LLVMAddLoopDeletionPass", cheader_filename = "llvm-c/Transforms/Scalar.h")]
public void add_loop_deletion ();
[CCode (cname = "LLVMAddLoopIndexSplitPass", cheader_filename = "llvm-c/Transforms/Scalar.h")]
public void add_loop_index_split ();
[CCode (cname = "LLVMAddLoopRotatePass", cheader_filename = "llvm-c/Transforms/Scalar.h")]
public void add_loop_rotate ();
[CCode (cname = "LLVMAddLoopUnrollPass", cheader_filename = "llvm-c/Transforms/Scalar.h")]
public void add_loop_unroll ();
[CCode (cname = "LLVMAddLoopUnswitchPass", cheader_filename = "llvm-c/Transforms/Scalar.h")]
public void add_loop_unswitch ();
[CCode (cname = "LLVMAddMemCpyOptPass", cheader_filename = "llvm-c/Transforms/Scalar.h")]
public void add_memcpy_opt ();
[CCode (cname = "LLVMAddPromoteMemoryToRegisterPass", cheader_filename = "llvm-c/Transforms/Scalar.h")]
public void add_promote_memory_to_register ();
[CCode (cname = "LLVMAddLoopIdiomPass", cheader_filename = "llvm-c/Transforms/Scalar.h")]
public void add_loop_idiom ();
[CCode (cname = "LLVMAddPruneEHPass", cheader_filename = "llvm-c/Transforms/IPO.h")]
public void add_prune_eh ();
[CCode (cname = "LLVMAddReassociatePass", cheader_filename = "llvm-c/Transforms/Scalar.h")]
public void add_reassociate ();
[CCode (cname = "LLVMAddSCCPPass", cheader_filename = "llvm-c/Transforms/Scalar.h")]
public void add_sccp ();
[CCode (cname = "LLVMAddScalarReplAggregatesPass", cheader_filename = "llvm-c/Transforms/Scalar.h")]
public void add_scalar_repl_aggregates ();
[CCode (cname = "LLVMAddScalarReplAggregatesPassSSA", cheader_filename = "llvm-c/Transforms/Scalar.h")]
public void add_scalar_repl_aggregates_ssa ();
[CCode (cname = "LLVMAddSimplifyLibCallsPass", cheader_filename = "llvm-c/Transforms/Scalar.h")]
public void add_simplify_lib_calls ();
[CCode (cname = "LLVMAddStripDeadPrototypesPass", cheader_filename = "llvm-c/Transforms/IPO.h")]
public void add_strip_dead_prototypes ();
[CCode (cname = "LLVMAddStripSymbolsPass", cheader_filename = "llvm-c/Transforms/IPO.h")]
public void add_strip_symbols ();
[CCode (cname = "LLVMAddTailCallEliminationPass", cheader_filename = "llvm-c/Transforms/Scalar.h")]
public void add_tailcall_elimination ();
[CCode (cname = "LLVMAddCorrelatedValuePropagationPass", cheader_filename = "llvm-c/Transforms/Scalar.h")]
public void add_correlated_value_propagation ();
[CCode (cname = "LLVMAddEarlyCSEPass", cheader_filename = "llvm-c/Transforms/Scalar.h")]
public void add_early_cse ();
[CCode (cname = "LLVMAddLowerExpectIntrinsicPass", cheader_filename = "llvm-c/Transforms/Scalar.h")]
public void add_lower_expect_intrinsic ();
[CCode (cname = "LLVMAddTypeBasedAliasAnalysisPass", cheader_filename = "llvm-c/Transforms/Scalar.h")]
public void add_type_based_alias_analysis ();
[CCode (cname = "LLVMAddBasicAliasAnalysisPass", cheader_filename = "llvm-c/Transforms/Scalar.h")]
public void add_basic_alias_analysis ();
}
/**
* Manages module PassManagers.
*/
[Compact]
[CCode (cname = "struct LLVMOpaquePassManager", free_function = "LLVMDisposePassManager", has_type_id = false)]
public class PassManager : PassManagerBase {
[CCode (cname = "LLVMCreatePassManager")]
public PassManager ();
/**
* Execute all of the passes scheduled for execution.
*
* @return true if any of the passes modifies the module.
*/
[CCode (cname = "LLVMRunPassManager")]
public bool run (Module m);
}
/**
* Manages function and basic block pass managers.
*/
[Compact]
[CCode (cname = "struct LLVMOpaquePassManager", free_function = "LLVMDisposePassManager", has_type_id = false)]
public class FunctionPassManager : PassManagerBase {
[CCode (cname = "LLVMCreateFunctionPassManager")]
public FunctionPassManager (ModuleProvider mp);
/**
* Run all of the finalizers for the function passes.
*/
[CCode (cname = "LLVMFinalizeFunctionPassManager")]
public bool finalize ();
/**
* Run all of the initializers for the function passes.
*/
[CCode (cname = "LLVMInitializeFunctionPassManager")]
public bool initialize ();
/**
* Execute all of the passes scheduled for execution.
* @return true if any of the passes modifies the function.
*/
[CCode (cname = "LLVMRunFunctionPassManager")]
public int run (Function f);
}
[CCode (cname = "LLVMByteOrdering", cprefix = "", has_type_id = "0", cheader_filename = "llvm-c/Target.h")]
public enum ByteOrdering {
[CCode (cname = "LLVMBigEndian")]
BIG_ENDIAN,
[CCode (cname = "LLVMLittleEndian")]
LITTLE_ENDIAN
}
[Compact]
[CCode (cheader_filename = "llvm-c/Target.h", cname = "struct LLVMOpaqueTargetData", free_function = "LLVMDisposeTargetData", has_type_id = false)]
public class TargetData {
/**
* Constructs a TargetData from a specification string.
*/
[CCode (cname = "LLVMCreateTargetData", cheader_filename = "llvm-c/Target.h")]
public TargetData (string string_rep);
[CCode (cname = "LLVMOffsetOfElement", cheader_filename = "llvm-c/Target.h")]
public uint offset_of_element (Ty struct_ty, uint element);
public uint pointer_size {[CCode (cname = "LLVMPointerSize", cheader_filename = "llvm-c/Target.h")] get; }
public string string_rep {[CCode (cname = "LLVMCopyStringRepOfTargetData", cheader_filename = "llvm-c/Target.h")] owned get; }
public ByteOrdering byte_order {[CCode (cname = "LLVMByteOrder", cheader_filename = "llvm-c/Target.h")] get; }
[CCode (cname = "LLVMSizeOfTypeInBits", cheader_filename = "llvm-c/Target.h")]
public uint size_of_type_in_bits (Ty ty);
[CCode (cname = "LLVMStoreSizeOfType", cheader_filename = "llvm-c/Target.h")]
public uint store_size_of_type (Ty ty);
[CCode (cname = "LLVMABISizeOfType", cheader_filename = "llvm-c/Target.h")]
public uint abi_size_of_type (Ty ty);
[CCode (cname = "LLVMABIAlignmentOfType", cheader_filename = "llvm-c/Target.h")]
public uint abi_alignment_of_type (Ty ty);
[CCode (cname = "LLVMCallFrameAlignmentOfType", cheader_filename = "llvm-c/Target.h")]
public uint call_frame_alignment_of_type (Ty ty);
[CCode (cname = "LLVMElementAtOffset", cheader_filename = "llvm-c/Target.h")]
public uint element_at_offset (Ty struct_ty, uint offset);
[CCode (cname = "LLVMPreferredAlignmentOfGlobal", cheader_filename = "llvm-c/Target.h")]
public uint preferred_alignment_of_global (GlobalVariable global_var);
[CCode (cname = "LLVMPreferredAlignmentOfType", cheader_filename = "llvm-c/Target.h")]
public uint preferred_alignment_of_type (Ty ty);
}
[SimpleType]
[CCode (cname = "LLVMTypeRef", has_type_id = false)]
public struct Ty {
/* array */
[CCode (cname = "LLVMArrayType")]
public static Ty array (Ty element_type, uint element_count);
/* double */
[CCode (cname = "LLVMDoubleType")]
public static Ty double ();
/* fp128 */
[CCode (cname = "LLVMFP128Type")]
public static Ty fp128 ();
/* float */
[CCode (cname = "LLVMFloatType")]
public static Ty float ();
/* function */
[CCode (cname = "LLVMFunctionType")]
public static Ty function (Ty return_type, [CCode (array_length_pos = 2.9)] Ty[] param_types, bool is_var_arg = false);
[CCode (cname = "LLVMInt16Type")]
public static Ty int16 ();
[CCode (cname = "LLVMInt1Type")]
public static Ty int1 ();
[CCode (cname = "LLVMInt32Type")]
public static Ty int32 ();
[CCode (cname = "LLVMInt64Type")]
public static Ty int64 ();
[CCode (cname = "LLVMInt8Type")]
public static Ty int8 ();
[CCode (cname = "LLVMIntPtrType", cheader_filename = "llvm-c/Target.h")]
public static Ty int_ptr (TargetData p1);
[CCode (cname = "LLVMIntType")]
public static Ty int (uint num_bits);
[CCode (cname = "LLVMLabelType")]
public static Ty label ();
[CCode (cname = "LLVMPPCFP128Type")]
public static Ty ppcfp128 ();
[CCode (cname = "LLVMPointerType")]
public static Ty pointer (Ty element_type, uint address_space = 0);
[CCode (cname = "LLVMStructType")]
public static Ty struct (Ty[] element_types, bool packed);
[CCode (cname = "LLVMStructCreateNamed")]
public static Ty struct_named (Context C, string name);
[CCode (cname = "LLVMVectorType")]
public static Ty vector (Ty element_type, uint element_count);
[CCode (cname = "LLVMVoidType")]
public static Ty void ();
[CCode (cname = "LLVMX86FP80Type")]
public static Ty x86fp80 ();
public uint array_length {[CCode (cname = "LLVMGetArrayLength")] get; }
public bool is_function_var_arg {[CCode (cname = "LLVMIsFunctionVarArg")] get; }
public bool is_sized {[CCode (cname = "LLVMTypeIsSized")] get; }
public bool is_opaque_struct {[CCode (cname = "LLVMIsOpaqueStruct")] get; }
public Ty return_type {[CCode (cname = "LLVMGetReturnType")] get; }
public string struct_name {[CCode (cname = "LLVMGetStructName")] get; }
public uint param_count {[CCode (cname = "LLVMCountParamTypes")] get; }
public uint pointer_address_space {[CCode (cname = "LLVMGetPointerAddressSpace")] get; }
public uint struct_element_count {[CCode (cname = "LLVMCountStructElementTypes")] get; }
public bool is_packed_struct {[CCode (cname = "LLVMIsPackedStruct")] get; }
public uint vector_size {[CCode (cname = "LLVMGetVectorSize")] get; }
public Ty element_type {[CCode (cname = "LLVMGetElementType")] get; }
public TypeKind kind {[CCode (cname = "LLVMGetTypeKind")] get; }
public Context context {[CCode (cname = "LLVMGetTypeContext")] get; }
public Value size {[CCode (cname = "LLVMSizeOf")] get; }
public uint int_width {[CCode (cname = "LLVMGetIntTypeWidth")] get; }
[CCode (cname = "LLVMGetParamTypes")]
public void get_param_types ([CCode (array_length = false)] Ty[] dest);
[CCode (cname = "LLVMGetStructElementTypes")]
public void get_struct_element_types ([CCode (array_length = false)] Ty[] Dest);
[CCode (cname = "LLVMStructSetBody")]
public void set_struct_body (Ty[] elements, bool packed);
[CCode (cname = "LLVMConstNamedStruct")]
public Value const_named_struct (Value[] constant_vals);
}
[SimpleType]
[CCode (cname = "LLVMUseRef", has_type_id = false)]
public struct UseIterator {
[CCode (cname = "LLVMGetNextUse")]
public UseIterator? next_value ();
public LLVM.Value used_value {[CCode (cname = "LLVMGetUsedValue")] get; }
public LLVM.Value user {[CCode (cname = "LLVMGetUser")] get; }
}
/**
* LLVM Value Representation.
*
* This is a very important LLVM class. It is the base class of all values
* computed by a program that may be used as operands to other values. Value
* is the super class of other important classes such as {@link Instruction}
* and {@link Function}. All Values have a {@link Ty}. Type is not a
* subclass of Value. Some values can have a name and they belong to some
* Module. Setting the name on the Value automatically updates the module's
* symbol table.
*
* Every value has a "use list" that keeps track of which other Values are
* using this Value. A Value can also have an arbitrary number of ValueHandle
* objects that watch it and listen to RAUW and Destroy events. See
* llvm/Support/ValueHandle.h for details.
*/
[CCode (cname = "struct LLVMOpaqueValue", ref_function = "", unref_function = "", has_type_id = false)]
public class Value {
public string name {
[CCode (cname = "LLVMGetValueName")]
get;
[CCode (cname = "LLVMSetValueName")]
set;
}
public Ty type_of {[CCode (cname = "LLVMTypeOf")] get; }
[CCode (cname = "LLVMDumpValue")]
public void dump ();
[CCode (cname = "LLVMReplaceAllUsesWith")]
public void replace_all_use_with (Value new_val);
[CCode (cname = "LLVMGetFirstUse")]
public UseIterator iterator ();
public bool is_a_alloca_inst {[CCode (cname = "LLVMIsAAllocaInst")] get; }
public bool is_a_argument {[CCode (cname = "LLVMIsAArgument")] get; }
public bool is_a_basic_block {[CCode (cname = "LLVMIsABasicBlock")] get; }
public bool is_a_binary_operator {[CCode (cname = "LLVMIsABinaryOperator")] get; }
public bool is_a_bit_cast_inst {[CCode (cname = "LLVMIsABitCastInst")] get; }
public bool is_a_branch_inst {[CCode (cname = "LLVMIsABranchInst")] get; }
public bool is_a_call_inst {[CCode (cname = "LLVMIsACallInst")] get; }
public bool is_a_cast_inst {[CCode (cname = "LLVMIsACastInst")] get; }
public bool is_a_cmp_inst {[CCode (cname = "LLVMIsACmpInst")] get; }
public bool is_a_constant {[CCode (cname = "LLVMIsAConstant")] get; }
public bool is_a_constant_aggregate_zero {[CCode (cname = "LLVMIsAConstantAggregateZero")] get; }
public bool is_a_constant_array {[CCode (cname = "LLVMIsAConstantArray")] get; }
public bool is_a_constant_expr {[CCode (cname = "LLVMIsAConstantExpr")] get; }
public bool is_a_constant_fp {[CCode (cname = "LLVMIsAConstantFP")] get; }
public bool is_a_constant_int {[CCode (cname = "LLVMIsAConstantInt")] get; }
public bool is_a_constant_pointer_null {[CCode (cname = "LLVMIsAConstantPointerNull")] get; }
public bool is_a_constant_struct {[CCode (cname = "LLVMIsAConstantStruct")] get; }
public bool is_a_constant_vector {[CCode (cname = "LLVMIsAConstantVector")] get; }
public bool is_a_dbg_declare_inst {[CCode (cname = "LLVMIsADbgDeclareInst")] get; }
public bool is_a_dbg_func_start_inst {[CCode (cname = "LLVMIsADbgFuncStartInst")] get; }
public bool is_a_dbg_info_intrinsic {[CCode (cname = "LLVMIsADbgInfoIntrinsic")] get; }
public bool is_a_dbg_region_end_inst {[CCode (cname = "LLVMIsADbgRegionEndInst")] get; }
public bool is_a_dbg_region_start_inst {[CCode (cname = "LLVMIsADbgRegionStartInst")] get; }
public bool is_a_dbg_stop_point_inst {[CCode (cname = "LLVMIsADbgStopPointInst")] get; }
public bool is_a_eh_selector_inst {[CCode (cname = "LLVMIsAEHSelectorInst")] get; }
public bool is_a_eh_exception_inst {[CCode (cname = "LLVMIsAEHExceotionInst")] get; }
public bool is_a_extract_element_inst {[CCode (cname = "LLVMIsAExtractElementInst")] get; }
public bool is_a_extract_value_inst {[CCode (cname = "LLVMIsAExtractValueInst")] get; }
public bool is_a_fcmp_inst {[CCode (cname = "LLVMIsAFCmpInst")] get; }
public bool is_a_fp_ext_inst {[CCode (cname = "LLVMIsAFPExtInst")] get; }
public bool is_a_fp_to_si_inst {[CCode (cname = "LLVMIsAFPToSIInst")] get; }
public bool is_a_fp_to_ui_inst {[CCode (cname = "LLVMIsAFPToUIInst")] get; }
public bool is_a_fp_trunc_inst {[CCode (cname = "LLVMIsAFPTruncInst")] get; }
public bool is_a_function {[CCode (cname = "LLVMIsAFunction")] get; }
public bool is_a_get_element_ptr_inst {[CCode (cname = "LLVMIsAGetElementPtrInst")] get; }
public bool is_a_global_alias {[CCode (cname = "LLVMIsAGlobalAlias")] get; }
public bool is_a_global_value {[CCode (cname = "LLVMIsAGlobalValue")] get; }
public bool is_a_global_variable {[CCode (cname = "LLVMIsAGlobalVariable")] get; }
public bool is_a_icmp_inst {[CCode (cname = "LLVMIsAICmpInst")] get; }
public bool is_a_inline_asm {[CCode (cname = "LLVMIsAInlineAsm")] get; }
public bool is_a_md_node {[CCode (cname = "LLVMIsAMDNode")] get; }
public bool is_a_md_string {[CCode (cname = "LLVMIsAMDString")] get; }
public bool is_a_insert_element_inst {[CCode (cname = "LLVMIsAInsertElementInst")] get; }
public bool is_a_insert_value_inst {[CCode (cname = "LLVMIsAInsertValueInst")] get; }
public bool is_a_landing_pad_inst {[CCode (cname = "LLVMIsALandingPadInst")] get; }
public bool is_a_instruction {[CCode (cname = "LLVMIsAInstruction")] get; }
public bool is_a_int_to_ptr_inst {[CCode (cname = "LLVMIsAIntToPtrInst")] get; }
public bool is_a_intrinsic_inst {[CCode (cname = "LLVMIsAIntrinsicInst")] get; }
public bool is_a_invoke_inst {[CCode (cname = "LLVMIsAInvokeInst")] get; }
public bool is_a_load_inst {[CCode (cname = "LLVMIsALoadInst")] get; }
public bool is_a_mem_cpy_inst {[CCode (cname = "LLVMIsAMemCpyInst")] get; }
public bool is_a_mem_intrinsic {[CCode (cname = "LLVMIsAMemIntrinsic")] get; }
public bool is_a_mem_move_inst {[CCode (cname = "LLVMIsAMemMoveInst")] get; }
public bool is_a_mem_set_inst {[CCode (cname = "LLVMIsAMemSetInst")] get; }
public bool is_a_phi_node {[CCode (cname = "LLVMIsAPHINode")] get; }
public bool is_a_ptr_to_int_inst {[CCode (cname = "LLVMIsAPtrToIntInst")] get; }
public bool is_a_return_inst {[CCode (cname = "LLVMIsAReturnInst")] get; }
public bool is_a_sext_inst {[CCode (cname = "LLVMIsASExtInst")] get; }
public bool is_a_si_to_fp_inst {[CCode (cname = "LLVMIsASIToFPInst")] get; }
public bool is_a_select_inst {[CCode (cname = "LLVMIsASelectInst")] get; }
public bool is_a_shuffle_vector_inst {[CCode (cname = "LLVMIsAShuffleVectorInst")] get; }
public bool is_a_store_inst {[CCode (cname = "LLVMIsAStoreInst")] get; }
public bool is_a_switch_inst {[CCode (cname = "LLVMIsASwitchInst")] get; }
public bool is_a_terminator_inst {[CCode (cname = "LLVMIsATerminatorInst")] get; }
public bool is_a_trunc_inst {[CCode (cname = "LLVMIsATruncInst")] get; }
public bool is_a_ui_to_fp_inst {[CCode (cname = "LLVMIsAUIToFPInst")] get; }
public bool is_a_unary_instruction {[CCode (cname = "LLVMIsAUnaryInstruction")] get; }
public bool is_a_undef_value {[CCode (cname = "LLVMIsAUndefValue")] get; }
public bool is_a_unreachable_inst {[CCode (cname = "LLVMIsAUnreachableInst")] get; }
public bool is_a_resume_inst {[CCode (cname = "LLVMIsAResumeInst")] get; }
public bool is_a_user {[CCode (cname = "LLVMIsAUser")] get; }
public bool is_a_va_arg_inst {[CCode (cname = "LLVMIsAVAArgInst")] get; }
public bool is_a_zext_inst {[CCode (cname = "LLVMIsAZExtInst")] get; }
public bool is_constant {[CCode (cname = "LLVMIsConstant")] get; }
public bool is_block_address {[CCode (cname = "LLVMIsBlockAddress")] get; }
public bool is_declaration {[CCode (cname = "LLVMIsDeclaration")] get; }
public bool is_global_constant {[CCode (cname = "LLVMIsGlobalConstant")] get; }
public bool is_null {[CCode (cname = "LLVMIsNull")] get; }
public bool is_tail_call {[CCode (cname = "LLVMIsTailCall")] get; }
public bool is_thread_local {[CCode (cname = "LLVMIsThreadLocal")] get; }
public bool is_undef {[CCode (cname = "LLVMIsUndef")] get; }
public bool is_basic_block {[CCode (cname = "LLVMValueIsBasicBlock")] get; }
public uint8[] md_string {
[CCode (cname = "LLVMGetMDString")]
get;
}
public int md_node_operands {
[CCode (cname = "LLVMGetMDNodeNumOperands")]
get;
}
[CCode (cname = "LLVMValueAsBasicBlock")]
public BasicBlock as_basic_block ();
[CCode (cname = "LLVMGetMDNodeOperand")]
public Value * get_md_node_operand (uint i);
}
[SimpleType]
[CCode (cname = "LLVMBasicBlockRef", has_type_id = false)]
public struct BasicBlock {
public Value parent {[CCode (cname = "LLVMGetBasicBlockParent")] get; }
public Value @value {[CCode (cname = "LLVMBasicBlockAsValue")] get; }
public BasicBlock next {[CCode (cname = "LLVMGetNextBasicBlock")] get; }
public BasicBlock previous {[CCode (cname = "LLVMGetPreviousBasicBlock")] get; }
public Instruction first_instruction {[CCode (cname = "LLVMGetFirstInstruction")] get; }
public Instruction last_instruction {[CCode (cname = "LLVMGetLastInstruction")] get; }
[CCode (cname = "LLVMDeleteBasicBlock")]
[DestroysInstance]
public void delete ();
[CCode (cname = "LLVMInsertBasicBlock")]
public BasicBlock insert_before (string name);
[CCode (cname = "LLVMGetBasicBlockTerminator")]
public Value get_terminator ();
[CCode (cname = "LLVMRemoveBasicBlockFromParent")]
public void remove_from_parent ();
}
[CCode (cname = "struct LLVMOpaqueValue", ref_function = "", unref_function = "", has_type_id = false)]
public class User : Value {
public int size {[CCode (cname = "LLVMGetNumOperands")] get; }
[CCode (cname = "LLVMSetOperand")]
public Value get (uint index);
[CCode (cname = "LLVMGetOperand")]
public Value set (uint index, Value val);
}
[CCode (cname = "struct LLVMOpaqueValue", ref_function = "", unref_function = "", has_type_id = false)]
public class Instruction : User {
public BasicBlock parent {[CCode (cname = "LLVMGetInstructionParent")] get; }
public Instruction next {[CCode (cname = "LLVMGetNextInstruction")] get; }
public Instruction previous {[CCode (cname = "LLVMGetPreviousInstruction")] get; }
public Opcode opcode {[CCode (cname = "LLVMGetInstructionOpcode")] get; }
public IntPredicate icmp_predicate {[CCode (cname = "LLVMGetICmpPredicate")] get; }
[CCode (cname = "LLVMInstructionEraseFromParent")]
public void erase_from_parent ();
}
[CCode (cname = "struct LLVMOpaqueValue", ref_function = "", unref_function = "", has_type_id = false)]
public class CmpInst : Instruction {}
[CCode (cname = "struct LLVMOpaqueValue", ref_function = "", unref_function = "", has_type_id = false)]
public class ICmpInst : CmpInst {}
[CCode (cname = "struct LLVMOpaqueValue", ref_function = "", unref_function = "", has_type_id = false)]
public class FCmpInst : CmpInst {}
[CCode (cname = "struct LLVMOpaqueValue", ref_function = "", unref_function = "", has_type_id = false)]
public class ReturnInst : Instruction {}
[CCode (cname = "struct LLVMOpaqueValue", ref_function = "", unref_function = "", has_type_id = false)]
public class BranchInst : Instruction {}
[CCode (cname = "struct LLVMOpaqueValue", ref_function = "", unref_function = "", has_type_id = false)]
public class SwitchInst : Instruction {
public BasicBlock default_dest {[CCode (cname = "LLVMGetSwitchDefaultDest")] get; }
[CCode (cname = "LLVMAddCase")]
public void add_case (Value on_val, BasicBlock dest);
}
[CCode (cname = "struct LLVMOpaqueValue", ref_function = "", unref_function = "", has_type_id = false)]
public class InvokeInst : Instruction {}
[CCode (cname = "struct LLVMOpaqueValue", ref_function = "", unref_function = "", has_type_id = false)]
public class LandingPadInst : Instruction {
/**
* Add a catch or filter clause to the landingpad instruction
*/
[CCode (cname = "LLVMAddClause")]
public void add_clause (Value clause_val);
/**
* Set the 'cleanup' flag in the landingpad instruction
*/
[CCode (cname = "LLVMSetCleanup")]
void set_cleanup (bool val);
}
[CCode (cname = "struct LLVMOpaqueValue", ref_function = "", unref_function = "", has_type_id = false)]
public class UnreachableInst : Instruction {}
[CCode (cname = "struct LLVMOpaqueValue", ref_function = "", unref_function = "", has_type_id = false)]
public class UnaryInst : Instruction {}
[CCode (cname = "struct LLVMOpaqueValue", ref_function = "", unref_function = "", has_type_id = false)]