rltk 2.2.1 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/LICENSE +12 -12
- data/README.md +458 -285
- data/Rakefile +99 -92
- data/lib/rltk/ast.rb +221 -126
- data/lib/rltk/cfg.rb +218 -239
- data/lib/rltk/cg/basic_block.rb +1 -1
- data/lib/rltk/cg/bindings.rb +9 -26
- data/lib/rltk/cg/builder.rb +40 -8
- data/lib/rltk/cg/context.rb +1 -1
- data/lib/rltk/cg/contractor.rb +51 -0
- data/lib/rltk/cg/execution_engine.rb +45 -8
- data/lib/rltk/cg/function.rb +12 -2
- data/lib/rltk/cg/generated_bindings.rb +2541 -575
- data/lib/rltk/cg/generic_value.rb +2 -2
- data/lib/rltk/cg/instruction.rb +104 -83
- data/lib/rltk/cg/llvm.rb +44 -3
- data/lib/rltk/cg/memory_buffer.rb +22 -5
- data/lib/rltk/cg/module.rb +85 -36
- data/lib/rltk/cg/old_generated_bindings.rb +6152 -0
- data/lib/rltk/cg/pass_manager.rb +87 -43
- data/lib/rltk/cg/support.rb +2 -4
- data/lib/rltk/cg/target.rb +158 -28
- data/lib/rltk/cg/triple.rb +8 -8
- data/lib/rltk/cg/type.rb +69 -25
- data/lib/rltk/cg/value.rb +107 -66
- data/lib/rltk/cg.rb +16 -17
- data/lib/rltk/lexer.rb +21 -11
- data/lib/rltk/lexers/calculator.rb +1 -1
- data/lib/rltk/lexers/ebnf.rb +8 -7
- data/lib/rltk/parser.rb +300 -247
- data/lib/rltk/parsers/infix_calc.rb +1 -1
- data/lib/rltk/parsers/postfix_calc.rb +2 -2
- data/lib/rltk/parsers/prefix_calc.rb +2 -2
- data/lib/rltk/token.rb +1 -2
- data/lib/rltk/version.rb +3 -3
- data/lib/rltk.rb +6 -6
- data/test/cg/tc_basic_block.rb +83 -0
- data/test/cg/tc_control_flow.rb +191 -0
- data/test/cg/tc_function.rb +54 -0
- data/test/cg/tc_generic_value.rb +33 -0
- data/test/cg/tc_instruction.rb +256 -0
- data/test/cg/tc_llvm.rb +25 -0
- data/test/cg/tc_math.rb +88 -0
- data/test/cg/tc_module.rb +89 -0
- data/test/cg/tc_transforms.rb +68 -0
- data/test/cg/tc_type.rb +69 -0
- data/test/cg/tc_value.rb +151 -0
- data/test/cg/ts_cg.rb +23 -0
- data/test/tc_ast.rb +105 -8
- data/test/tc_cfg.rb +63 -48
- data/test/tc_lexer.rb +84 -96
- data/test/tc_parser.rb +224 -52
- data/test/tc_token.rb +6 -6
- data/test/ts_rltk.rb +12 -15
- metadata +149 -75
- data/lib/rltk/cg/generated_extended_bindings.rb +0 -287
- data/lib/rltk/util/abstract_class.rb +0 -25
- data/lib/rltk/util/monkeys.rb +0 -129
@@ -4,7 +4,7 @@ require 'ffi'
|
|
4
4
|
|
5
5
|
module RLTK::CG::Bindings
|
6
6
|
extend FFI::Library
|
7
|
-
ffi_lib 'LLVM-3.
|
7
|
+
ffi_lib 'LLVM-3.4'
|
8
8
|
|
9
9
|
def self.attach_function(name, *_)
|
10
10
|
begin; super; rescue FFI::NotFoundError => e
|
@@ -30,62 +30,94 @@ module RLTK::CG::Bindings
|
|
30
30
|
|
31
31
|
DISASSEMBLER_REFERENCE_TYPE_OUT_LIT_POOL_CSTR_ADDR = 3
|
32
32
|
|
33
|
-
|
33
|
+
DISASSEMBLER_REFERENCE_TYPE_OUT_OBJC_CF_STRING_REF = 4
|
34
|
+
|
35
|
+
DISASSEMBLER_REFERENCE_TYPE_OUT_OBJC_MESSAGE = 5
|
36
|
+
|
37
|
+
DISASSEMBLER_REFERENCE_TYPE_OUT_OBJC_MESSAGE_REF = 6
|
38
|
+
|
39
|
+
DISASSEMBLER_REFERENCE_TYPE_OUT_OBJC_SELECTOR_REF = 7
|
40
|
+
|
41
|
+
DISASSEMBLER_REFERENCE_TYPE_OUT_OBJC_CLASS_REF = 8
|
42
|
+
|
43
|
+
DISASSEMBLER_OPTION_USE_MARKUP = 1
|
44
|
+
|
45
|
+
DISASSEMBLER_OPTION_PRINT_IMM_HEX = 2
|
46
|
+
|
47
|
+
DISASSEMBLER_OPTION_ASM_PRINTER_VARIANT = 4
|
48
|
+
|
49
|
+
DISASSEMBLER_OPTION_SET_INSTR_COMMENTS = 8
|
50
|
+
|
51
|
+
DISASSEMBLER_OPTION_PRINT_LATENCY = 16
|
52
|
+
|
53
|
+
# The top-level container for all LLVM global data. See the LLVMContext class.
|
34
54
|
class OpaqueContext < FFI::Struct
|
35
55
|
layout :dummy, :char
|
36
56
|
end
|
37
57
|
|
38
58
|
# The top-level container for all other LLVM Intermediate Representation (IR)
|
39
|
-
# objects.
|
59
|
+
# objects.
|
60
|
+
#
|
61
|
+
# @see llvm::Module
|
40
62
|
class OpaqueModule < FFI::Struct
|
41
63
|
layout :dummy, :char
|
42
64
|
end
|
43
65
|
|
44
|
-
# Each value in the LLVM IR has a type, an LLVMTypeRef.
|
45
|
-
#
|
66
|
+
# Each value in the LLVM IR has a type, an LLVMTypeRef.
|
67
|
+
#
|
68
|
+
# @see llvm::Type
|
46
69
|
class OpaqueType < FFI::Struct
|
47
70
|
layout :dummy, :char
|
48
71
|
end
|
49
72
|
|
50
|
-
#
|
73
|
+
# Represents an individual value in LLVM IR.
|
74
|
+
#
|
75
|
+
# This models llvm::Value.
|
51
76
|
class OpaqueValue < FFI::Struct
|
52
77
|
layout :dummy, :char
|
53
78
|
end
|
54
79
|
|
55
|
-
#
|
80
|
+
# Represents a basic block of instructions in LLVM IR.
|
81
|
+
#
|
82
|
+
# This models llvm::BasicBlock.
|
56
83
|
class OpaqueBasicBlock < FFI::Struct
|
57
84
|
layout :dummy, :char
|
58
85
|
end
|
59
86
|
|
60
|
-
#
|
87
|
+
# Represents an LLVM basic block builder.
|
88
|
+
#
|
89
|
+
# This models llvm::IRBuilder.
|
61
90
|
class OpaqueBuilder < FFI::Struct
|
62
91
|
layout :dummy, :char
|
63
92
|
end
|
64
93
|
|
65
|
-
# Interface used to provide a module to JIT or interpreter.
|
66
|
-
# synonym for llvm::Module, but we have to keep using the
|
67
|
-
# keep binary compatibility.
|
94
|
+
# Interface used to provide a module to JIT or interpreter.
|
95
|
+
# This is now just a synonym for llvm::Module, but we have to keep using the
|
96
|
+
# different type to keep binary compatibility.
|
68
97
|
class OpaqueModuleProvider < FFI::Struct
|
69
98
|
layout :dummy, :char
|
70
99
|
end
|
71
100
|
|
72
101
|
# Used to provide a module to JIT or interpreter.
|
73
|
-
#
|
102
|
+
#
|
103
|
+
# @see llvm::MemoryBuffer
|
74
104
|
class OpaqueMemoryBuffer < FFI::Struct
|
75
105
|
layout :dummy, :char
|
76
106
|
end
|
77
107
|
|
78
|
-
#
|
108
|
+
# @see llvm::PassManagerBase
|
79
109
|
class OpaquePassManager < FFI::Struct
|
80
110
|
layout :dummy, :char
|
81
111
|
end
|
82
112
|
|
83
|
-
#
|
113
|
+
# @see llvm::PassRegistry
|
84
114
|
class OpaquePassRegistry < FFI::Struct
|
85
115
|
layout :dummy, :char
|
86
116
|
end
|
87
117
|
|
88
|
-
# Used to get the users and usees of a Value.
|
118
|
+
# Used to get the users and usees of a Value.
|
119
|
+
#
|
120
|
+
# @see llvm::Use
|
89
121
|
class OpaqueUse < FFI::Struct
|
90
122
|
layout :dummy, :char
|
91
123
|
end
|
@@ -145,8 +177,6 @@ module RLTK::CG::Bindings
|
|
145
177
|
#
|
146
178
|
# :uw_table ::
|
147
179
|
#
|
148
|
-
# :non_lazy_bind ::
|
149
|
-
#
|
150
180
|
#
|
151
181
|
# @method _enum_attribute_
|
152
182
|
# @return [Symbol]
|
@@ -176,8 +206,7 @@ module RLTK::CG::Bindings
|
|
176
206
|
:inline_hint_attribute, 33554432,
|
177
207
|
:stack_alignment, 469762048,
|
178
208
|
:returns_twice, 536870912,
|
179
|
-
:uw_table, 1073741824
|
180
|
-
:non_lazy_bind, 2147483648
|
209
|
+
:uw_table, 1073741824
|
181
210
|
]
|
182
211
|
|
183
212
|
# (Not documented)
|
@@ -265,6 +294,8 @@ module RLTK::CG::Bindings
|
|
265
294
|
#
|
266
295
|
# :bit_cast ::
|
267
296
|
#
|
297
|
+
# :addr_space_cast ::
|
298
|
+
#
|
268
299
|
# :i_cmp ::
|
269
300
|
# Other Operators
|
270
301
|
# :f_cmp ::
|
@@ -301,8 +332,6 @@ module RLTK::CG::Bindings
|
|
301
332
|
# Exception Handling Operators
|
302
333
|
# :landing_pad ::
|
303
334
|
#
|
304
|
-
# :unwind ::
|
305
|
-
#
|
306
335
|
#
|
307
336
|
# @method _enum_opcode_
|
308
337
|
# @return [Symbol]
|
@@ -348,6 +377,7 @@ module RLTK::CG::Bindings
|
|
348
377
|
:ptr_to_int, 39,
|
349
378
|
:int_to_ptr, 40,
|
350
379
|
:bit_cast, 41,
|
380
|
+
:addr_space_cast, 60,
|
351
381
|
:i_cmp, 42,
|
352
382
|
:f_cmp, 43,
|
353
383
|
:phi, 44,
|
@@ -365,8 +395,7 @@ module RLTK::CG::Bindings
|
|
365
395
|
:atomic_cmp_xchg, 56,
|
366
396
|
:atomic_rmw, 57,
|
367
397
|
:resume, 58,
|
368
|
-
:landing_pad, 59
|
369
|
-
:unwind, 60
|
398
|
+
:landing_pad, 59
|
370
399
|
]
|
371
400
|
|
372
401
|
# (Not documented)
|
@@ -376,8 +405,10 @@ module RLTK::CG::Bindings
|
|
376
405
|
# === Options:
|
377
406
|
# :void ::
|
378
407
|
#
|
379
|
-
# :
|
408
|
+
# :half ::
|
380
409
|
# < type with no size
|
410
|
+
# :float ::
|
411
|
+
# < 16 bit floating point type
|
381
412
|
# :double ::
|
382
413
|
# < 32 bit floating point type
|
383
414
|
# :x86_fp80 ::
|
@@ -410,20 +441,21 @@ module RLTK::CG::Bindings
|
|
410
441
|
# @scope class
|
411
442
|
enum :type_kind, [
|
412
443
|
:void, 0,
|
413
|
-
:
|
414
|
-
:
|
415
|
-
:
|
416
|
-
:
|
417
|
-
:
|
418
|
-
:
|
419
|
-
:
|
420
|
-
:
|
421
|
-
:
|
422
|
-
:
|
423
|
-
:
|
424
|
-
:
|
425
|
-
:
|
426
|
-
:
|
444
|
+
:half, 1,
|
445
|
+
:float, 2,
|
446
|
+
:double, 3,
|
447
|
+
:x86_fp80, 4,
|
448
|
+
:fp128, 5,
|
449
|
+
:ppc_fp128, 6,
|
450
|
+
:label, 7,
|
451
|
+
:integer, 8,
|
452
|
+
:function, 9,
|
453
|
+
:struct, 10,
|
454
|
+
:array, 11,
|
455
|
+
:pointer, 12,
|
456
|
+
:vector, 13,
|
457
|
+
:metadata, 14,
|
458
|
+
:x86_mmx, 15
|
427
459
|
]
|
428
460
|
|
429
461
|
# (Not documented)
|
@@ -439,9 +471,11 @@ module RLTK::CG::Bindings
|
|
439
471
|
#
|
440
472
|
# :link_once_odr ::
|
441
473
|
# < Keep one copy of function when linking (inline)
|
442
|
-
# :
|
474
|
+
# :link_once_odr_auto_hide ::
|
443
475
|
# < Same, but only replaced by something
|
444
476
|
# equivalent.
|
477
|
+
# :weak_any ::
|
478
|
+
# < Obsolete
|
445
479
|
# :weak_odr ::
|
446
480
|
# < Keep one copy of function when linking (weak)
|
447
481
|
# :appending ::
|
@@ -466,8 +500,6 @@ module RLTK::CG::Bindings
|
|
466
500
|
# < Tentative definitions
|
467
501
|
# :linker_private_weak ::
|
468
502
|
# < Like Private, but linker removes.
|
469
|
-
# :linker_private_weak_def_auto ::
|
470
|
-
# < Like LinkerPrivate, but is weak.
|
471
503
|
#
|
472
504
|
# @method _enum_linkage_
|
473
505
|
# @return [Symbol]
|
@@ -477,19 +509,19 @@ module RLTK::CG::Bindings
|
|
477
509
|
:available_externally, 1,
|
478
510
|
:link_once_any, 2,
|
479
511
|
:link_once_odr, 3,
|
480
|
-
:
|
481
|
-
:
|
482
|
-
:
|
483
|
-
:
|
484
|
-
:
|
485
|
-
:
|
486
|
-
:
|
487
|
-
:
|
488
|
-
:
|
489
|
-
:
|
490
|
-
:
|
491
|
-
:
|
492
|
-
:
|
512
|
+
:link_once_odr_auto_hide, 4,
|
513
|
+
:weak_any, 5,
|
514
|
+
:weak_odr, 6,
|
515
|
+
:appending, 7,
|
516
|
+
:internal, 8,
|
517
|
+
:private, 9,
|
518
|
+
:dll_import, 10,
|
519
|
+
:dll_export, 11,
|
520
|
+
:external_weak, 12,
|
521
|
+
:ghost, 13,
|
522
|
+
:common, 14,
|
523
|
+
:linker_private, 15,
|
524
|
+
:linker_private_weak, 16
|
493
525
|
]
|
494
526
|
|
495
527
|
# (Not documented)
|
@@ -524,6 +556,10 @@ module RLTK::CG::Bindings
|
|
524
556
|
#
|
525
557
|
# :cold ::
|
526
558
|
#
|
559
|
+
# :web_kit_js ::
|
560
|
+
#
|
561
|
+
# :any_reg ::
|
562
|
+
#
|
527
563
|
# :x86_stdcall ::
|
528
564
|
#
|
529
565
|
# :x86_fastcall ::
|
@@ -536,6 +572,8 @@ module RLTK::CG::Bindings
|
|
536
572
|
:c, 0,
|
537
573
|
:fast, 8,
|
538
574
|
:cold, 9,
|
575
|
+
:web_kit_js, 12,
|
576
|
+
:any_reg, 13,
|
539
577
|
:x86_stdcall, 64,
|
540
578
|
:x86_fastcall, 65
|
541
579
|
]
|
@@ -662,35 +700,202 @@ module RLTK::CG::Bindings
|
|
662
700
|
|
663
701
|
# (Not documented)
|
664
702
|
#
|
703
|
+
# <em>This entry is only for documentation and no real method. The FFI::Enum can be accessed via #enum_type(:thread_local_mode).</em>
|
704
|
+
#
|
705
|
+
# === Options:
|
706
|
+
# :not_thread_local ::
|
707
|
+
#
|
708
|
+
# :general_dynamic_tls_model ::
|
709
|
+
#
|
710
|
+
# :local_dynamic_tls_model ::
|
711
|
+
#
|
712
|
+
# :initial_exec_tls_model ::
|
713
|
+
#
|
714
|
+
# :local_exec_tls_model ::
|
715
|
+
#
|
716
|
+
#
|
717
|
+
# @method _enum_thread_local_mode_
|
718
|
+
# @return [Symbol]
|
719
|
+
# @scope class
|
720
|
+
enum :thread_local_mode, [
|
721
|
+
:not_thread_local, 0,
|
722
|
+
:general_dynamic_tls_model, 1,
|
723
|
+
:local_dynamic_tls_model, 2,
|
724
|
+
:initial_exec_tls_model, 3,
|
725
|
+
:local_exec_tls_model, 4
|
726
|
+
]
|
727
|
+
|
728
|
+
# (Not documented)
|
729
|
+
#
|
730
|
+
# <em>This entry is only for documentation and no real method. The FFI::Enum can be accessed via #enum_type(:atomic_ordering).</em>
|
731
|
+
#
|
732
|
+
# === Options:
|
733
|
+
# :not_atomic ::
|
734
|
+
#
|
735
|
+
# :unordered ::
|
736
|
+
# < A load or store which is not atomic
|
737
|
+
# :monotonic ::
|
738
|
+
# < Lowest level of atomicity, guarantees
|
739
|
+
# somewhat sane results, lock free.
|
740
|
+
# :acquire ::
|
741
|
+
# < guarantees that if you take all the
|
742
|
+
# operations affecting a specific address,
|
743
|
+
# a consistent ordering exists
|
744
|
+
# :release ::
|
745
|
+
# < Acquire provides a barrier of the sort
|
746
|
+
# necessary to acquire a lock to access other
|
747
|
+
# memory with normal loads and stores.
|
748
|
+
# :acquire_release ::
|
749
|
+
# < Release is similar to Acquire, but with
|
750
|
+
# a barrier of the sort necessary to release
|
751
|
+
# a lock.
|
752
|
+
#
|
753
|
+
# @method _enum_atomic_ordering_
|
754
|
+
# @return [Symbol]
|
755
|
+
# @scope class
|
756
|
+
enum :atomic_ordering, [
|
757
|
+
:not_atomic, 0,
|
758
|
+
:unordered, 1,
|
759
|
+
:monotonic, 2,
|
760
|
+
:acquire, 4,
|
761
|
+
:release, 5,
|
762
|
+
:acquire_release, 6
|
763
|
+
]
|
764
|
+
|
765
|
+
# (Not documented)
|
766
|
+
#
|
767
|
+
# <em>This entry is only for documentation and no real method. The FFI::Enum can be accessed via #enum_type(:atomic_rmw_bin_op).</em>
|
768
|
+
#
|
769
|
+
# === Options:
|
770
|
+
# :xchg ::
|
771
|
+
#
|
772
|
+
# :add ::
|
773
|
+
# < Set the new value and return the one old
|
774
|
+
# :sub ::
|
775
|
+
# < Add a value and return the old one
|
776
|
+
# :and_ ::
|
777
|
+
# < Subtract a value and return the old one
|
778
|
+
# :nand ::
|
779
|
+
# < And a value and return the old one
|
780
|
+
# :or_ ::
|
781
|
+
# < Not-And a value and return the old one
|
782
|
+
# :xor ::
|
783
|
+
# < OR a value and return the old one
|
784
|
+
# :max ::
|
785
|
+
# < Xor a value and return the old one
|
786
|
+
# :min ::
|
787
|
+
# < Sets the value if it's greater than the
|
788
|
+
# original using a signed comparison and return
|
789
|
+
# the old one
|
790
|
+
# :u_max ::
|
791
|
+
# < Sets the value if it's Smaller than the
|
792
|
+
# original using a signed comparison and return
|
793
|
+
# the old one
|
794
|
+
# :u_min ::
|
795
|
+
# < Sets the value if it's greater than the
|
796
|
+
# original using an unsigned comparison and return
|
797
|
+
# the old one
|
798
|
+
#
|
799
|
+
# @method _enum_atomic_rmw_bin_op_
|
800
|
+
# @return [Symbol]
|
801
|
+
# @scope class
|
802
|
+
enum :atomic_rmw_bin_op, [
|
803
|
+
:xchg, 0,
|
804
|
+
:add, 1,
|
805
|
+
:sub, 2,
|
806
|
+
:and_, 3,
|
807
|
+
:nand, 4,
|
808
|
+
:or_, 5,
|
809
|
+
:xor, 6,
|
810
|
+
:max, 7,
|
811
|
+
:min, 8,
|
812
|
+
:u_max, 9,
|
813
|
+
:u_min, 10
|
814
|
+
]
|
815
|
+
|
816
|
+
# @}
|
817
|
+
#
|
665
818
|
# @method initialize_core(r)
|
666
819
|
# @param [OpaquePassRegistry] r
|
667
820
|
# @return [nil]
|
668
821
|
# @scope class
|
669
822
|
attach_function :initialize_core, :LLVMInitializeCore, [OpaquePassRegistry], :void
|
670
823
|
|
824
|
+
# Deallocate and destroy all ManagedStatic variables.
|
825
|
+
# @see llvm::llvm_shutdown
|
826
|
+
# @see ManagedStatic
|
827
|
+
#
|
828
|
+
# @method shutdown()
|
829
|
+
# @return [nil]
|
830
|
+
# @scope class
|
831
|
+
attach_function :shutdown, :LLVMShutdown, [], :void
|
832
|
+
|
671
833
|
# ===-- Error handling ----------------------------------------------------===
|
672
834
|
#
|
835
|
+
# @method create_message(message)
|
836
|
+
# @param [String] message
|
837
|
+
# @return [String]
|
838
|
+
# @scope class
|
839
|
+
attach_function :create_message, :LLVMCreateMessage, [:string], :string
|
840
|
+
|
841
|
+
# (Not documented)
|
842
|
+
#
|
673
843
|
# @method dispose_message(message)
|
674
844
|
# @param [String] message
|
675
845
|
# @return [nil]
|
676
846
|
# @scope class
|
677
847
|
attach_function :dispose_message, :LLVMDisposeMessage, [:string], :void
|
678
848
|
|
679
|
-
#
|
849
|
+
# Install a fatal error handler. By default, if LLVM detects a fatal error, it
|
850
|
+
# will call exit(1). This may not be appropriate in many contexts. For example,
|
851
|
+
# doing exit(1) will bypass many crash reporting/tracing system tools. This
|
852
|
+
# function allows you to install a callback that will be invoked prior to the
|
853
|
+
# call to exit(1).
|
854
|
+
#
|
855
|
+
# @method install_fatal_error_handler(handler)
|
856
|
+
# @param [FFI::Pointer(FatalErrorHandler)] handler
|
857
|
+
# @return [nil]
|
858
|
+
# @scope class
|
859
|
+
attach_function :install_fatal_error_handler, :LLVMInstallFatalErrorHandler, [:pointer], :void
|
860
|
+
|
861
|
+
# Reset the fatal error handler. This resets LLVM's fatal error handling
|
862
|
+
# behavior to the default.
|
863
|
+
#
|
864
|
+
# @method reset_fatal_error_handler()
|
865
|
+
# @return [nil]
|
866
|
+
# @scope class
|
867
|
+
attach_function :reset_fatal_error_handler, :LLVMResetFatalErrorHandler, [], :void
|
868
|
+
|
869
|
+
# Enable LLVM's built-in stack trace code. This intercepts the OS's crash
|
870
|
+
# signals and prints which component of LLVM you were in at the time if the
|
871
|
+
# crash.
|
872
|
+
#
|
873
|
+
# @method enable_pretty_stack_trace()
|
874
|
+
# @return [nil]
|
875
|
+
# @scope class
|
876
|
+
attach_function :enable_pretty_stack_trace, :LLVMEnablePrettyStackTrace, [], :void
|
877
|
+
|
878
|
+
# Create a new context.
|
879
|
+
#
|
880
|
+
# Every call to this function should be paired with a call to
|
881
|
+
# LLVMContextDispose() or the context will leak memory.
|
680
882
|
#
|
681
883
|
# @method context_create()
|
682
884
|
# @return [OpaqueContext]
|
683
885
|
# @scope class
|
684
886
|
attach_function :context_create, :LLVMContextCreate, [], OpaqueContext
|
685
887
|
|
686
|
-
#
|
888
|
+
# Obtain the global context instance.
|
687
889
|
#
|
688
890
|
# @method get_global_context()
|
689
891
|
# @return [OpaqueContext]
|
690
892
|
# @scope class
|
691
893
|
attach_function :get_global_context, :LLVMGetGlobalContext, [], OpaqueContext
|
692
894
|
|
693
|
-
#
|
895
|
+
# Destroy a context instance.
|
896
|
+
#
|
897
|
+
# This should be called for every call to LLVMContextCreate() or memory
|
898
|
+
# will be leaked.
|
694
899
|
#
|
695
900
|
# @method context_dispose(c)
|
696
901
|
# @param [OpaqueContext] c
|
@@ -717,7 +922,13 @@ module RLTK::CG::Bindings
|
|
717
922
|
# @scope class
|
718
923
|
attach_function :get_md_kind_id, :LLVMGetMDKindID, [:string, :uint], :uint
|
719
924
|
|
720
|
-
#
|
925
|
+
# Create a new, empty module in the global context.
|
926
|
+
#
|
927
|
+
# This is equivalent to calling LLVMModuleCreateWithNameInContext with
|
928
|
+
# LLVMGetGlobalContext() as the context parameter.
|
929
|
+
#
|
930
|
+
# Every invocation should be paired with LLVMDisposeModule() or memory
|
931
|
+
# will be leaked.
|
721
932
|
#
|
722
933
|
# @method module_create_with_name(module_id)
|
723
934
|
# @param [String] module_id
|
@@ -725,7 +936,10 @@ module RLTK::CG::Bindings
|
|
725
936
|
# @scope class
|
726
937
|
attach_function :module_create_with_name, :LLVMModuleCreateWithName, [:string], OpaqueModule
|
727
938
|
|
728
|
-
#
|
939
|
+
# Create a new, empty module in a specific context.
|
940
|
+
#
|
941
|
+
# Every invocation should be paired with LLVMDisposeModule() or memory
|
942
|
+
# will be leaked.
|
729
943
|
#
|
730
944
|
# @method module_create_with_name_in_context(module_id, c)
|
731
945
|
# @param [String] module_id
|
@@ -734,7 +948,10 @@ module RLTK::CG::Bindings
|
|
734
948
|
# @scope class
|
735
949
|
attach_function :module_create_with_name_in_context, :LLVMModuleCreateWithNameInContext, [:string, OpaqueContext], OpaqueModule
|
736
950
|
|
737
|
-
#
|
951
|
+
# Destroy a module instance.
|
952
|
+
#
|
953
|
+
# This must be called for every created module or memory will be
|
954
|
+
# leaked.
|
738
955
|
#
|
739
956
|
# @method dispose_module(m)
|
740
957
|
# @param [OpaqueModule] m
|
@@ -742,7 +959,9 @@ module RLTK::CG::Bindings
|
|
742
959
|
# @scope class
|
743
960
|
attach_function :dispose_module, :LLVMDisposeModule, [OpaqueModule], :void
|
744
961
|
|
745
|
-
#
|
962
|
+
# Obtain the data layout for a module.
|
963
|
+
#
|
964
|
+
# @see Module::getDataLayout()
|
746
965
|
#
|
747
966
|
# @method get_data_layout(m)
|
748
967
|
# @param [OpaqueModule] m
|
@@ -750,7 +969,9 @@ module RLTK::CG::Bindings
|
|
750
969
|
# @scope class
|
751
970
|
attach_function :get_data_layout, :LLVMGetDataLayout, [OpaqueModule], :string
|
752
971
|
|
753
|
-
#
|
972
|
+
# Set the data layout for a module.
|
973
|
+
#
|
974
|
+
# @see Module::setDataLayout()
|
754
975
|
#
|
755
976
|
# @method set_data_layout(m, triple)
|
756
977
|
# @param [OpaqueModule] m
|
@@ -759,7 +980,9 @@ module RLTK::CG::Bindings
|
|
759
980
|
# @scope class
|
760
981
|
attach_function :set_data_layout, :LLVMSetDataLayout, [OpaqueModule, :string], :void
|
761
982
|
|
762
|
-
#
|
983
|
+
# Obtain the target triple for a module.
|
984
|
+
#
|
985
|
+
# @see Module::getTargetTriple()
|
763
986
|
#
|
764
987
|
# @method get_target(m)
|
765
988
|
# @param [OpaqueModule] m
|
@@ -767,7 +990,9 @@ module RLTK::CG::Bindings
|
|
767
990
|
# @scope class
|
768
991
|
attach_function :get_target, :LLVMGetTarget, [OpaqueModule], :string
|
769
992
|
|
770
|
-
#
|
993
|
+
# Set the target triple for a module.
|
994
|
+
#
|
995
|
+
# @see Module::setTargetTriple()
|
771
996
|
#
|
772
997
|
# @method set_target(m, triple)
|
773
998
|
# @param [OpaqueModule] m
|
@@ -776,7 +1001,9 @@ module RLTK::CG::Bindings
|
|
776
1001
|
# @scope class
|
777
1002
|
attach_function :set_target, :LLVMSetTarget, [OpaqueModule, :string], :void
|
778
1003
|
|
779
|
-
#
|
1004
|
+
# Dump a representation of a module to stderr.
|
1005
|
+
#
|
1006
|
+
# @see Module::dump()
|
780
1007
|
#
|
781
1008
|
# @method dump_module(m)
|
782
1009
|
# @param [OpaqueModule] m
|
@@ -784,7 +1011,33 @@ module RLTK::CG::Bindings
|
|
784
1011
|
# @scope class
|
785
1012
|
attach_function :dump_module, :LLVMDumpModule, [OpaqueModule], :void
|
786
1013
|
|
787
|
-
#
|
1014
|
+
# Print a representation of a module to a file. The ErrorMessage needs to be
|
1015
|
+
# disposed with LLVMDisposeMessage. Returns 0 on success, 1 otherwise.
|
1016
|
+
#
|
1017
|
+
# @see Module::print()
|
1018
|
+
#
|
1019
|
+
# @method print_module_to_file(m, filename, error_message)
|
1020
|
+
# @param [OpaqueModule] m
|
1021
|
+
# @param [String] filename
|
1022
|
+
# @param [FFI::Pointer(**CharS)] error_message
|
1023
|
+
# @return [Integer]
|
1024
|
+
# @scope class
|
1025
|
+
attach_function :print_module_to_file, :LLVMPrintModuleToFile, [OpaqueModule, :string, :pointer], :int
|
1026
|
+
|
1027
|
+
# Return a string representation of the module. Use
|
1028
|
+
# LLVMDisposeMessage to free the string.
|
1029
|
+
#
|
1030
|
+
# @see Module::print()
|
1031
|
+
#
|
1032
|
+
# @method print_module_to_string(m)
|
1033
|
+
# @param [OpaqueModule] m
|
1034
|
+
# @return [String]
|
1035
|
+
# @scope class
|
1036
|
+
attach_function :print_module_to_string, :LLVMPrintModuleToString, [OpaqueModule], :string
|
1037
|
+
|
1038
|
+
# Set inline assembly for a module.
|
1039
|
+
#
|
1040
|
+
# @see Module::setModuleInlineAsm()
|
788
1041
|
#
|
789
1042
|
# @method set_module_inline_asm(m, asm)
|
790
1043
|
# @param [OpaqueModule] m
|
@@ -793,7 +1046,9 @@ module RLTK::CG::Bindings
|
|
793
1046
|
# @scope class
|
794
1047
|
attach_function :set_module_inline_asm, :LLVMSetModuleInlineAsm, [OpaqueModule, :string], :void
|
795
1048
|
|
796
|
-
#
|
1049
|
+
# Obtain the context to which this module is associated.
|
1050
|
+
#
|
1051
|
+
# @see Module::getContext()
|
797
1052
|
#
|
798
1053
|
# @method get_module_context(m)
|
799
1054
|
# @param [OpaqueModule] m
|
@@ -801,7 +1056,127 @@ module RLTK::CG::Bindings
|
|
801
1056
|
# @scope class
|
802
1057
|
attach_function :get_module_context, :LLVMGetModuleContext, [OpaqueModule], OpaqueContext
|
803
1058
|
|
804
|
-
#
|
1059
|
+
# Obtain a Type from a module by its registered name.
|
1060
|
+
#
|
1061
|
+
# @method get_type_by_name(m, name)
|
1062
|
+
# @param [OpaqueModule] m
|
1063
|
+
# @param [String] name
|
1064
|
+
# @return [OpaqueType]
|
1065
|
+
# @scope class
|
1066
|
+
attach_function :get_type_by_name, :LLVMGetTypeByName, [OpaqueModule, :string], OpaqueType
|
1067
|
+
|
1068
|
+
# Obtain the number of operands for named metadata in a module.
|
1069
|
+
#
|
1070
|
+
# @see llvm::Module::getNamedMetadata()
|
1071
|
+
#
|
1072
|
+
# @method get_named_metadata_num_operands(m, name)
|
1073
|
+
# @param [OpaqueModule] m
|
1074
|
+
# @param [String] name
|
1075
|
+
# @return [Integer]
|
1076
|
+
# @scope class
|
1077
|
+
attach_function :get_named_metadata_num_operands, :LLVMGetNamedMetadataNumOperands, [OpaqueModule, :string], :uint
|
1078
|
+
|
1079
|
+
# Obtain the named metadata operands for a module.
|
1080
|
+
#
|
1081
|
+
# The passed LLVMValueRef pointer should refer to an array of
|
1082
|
+
# LLVMValueRef at least LLVMGetNamedMetadataNumOperands long. This
|
1083
|
+
# array will be populated with the LLVMValueRef instances. Each
|
1084
|
+
# instance corresponds to a llvm::MDNode.
|
1085
|
+
#
|
1086
|
+
# @see llvm::Module::getNamedMetadata()
|
1087
|
+
# @see llvm::MDNode::getOperand()
|
1088
|
+
#
|
1089
|
+
# @method get_named_metadata_operands(m, name, dest)
|
1090
|
+
# @param [OpaqueModule] m
|
1091
|
+
# @param [String] name
|
1092
|
+
# @param [FFI::Pointer(*ValueRef)] dest
|
1093
|
+
# @return [nil]
|
1094
|
+
# @scope class
|
1095
|
+
attach_function :get_named_metadata_operands, :LLVMGetNamedMetadataOperands, [OpaqueModule, :string, :pointer], :void
|
1096
|
+
|
1097
|
+
# Add an operand to named metadata.
|
1098
|
+
#
|
1099
|
+
# @see llvm::Module::getNamedMetadata()
|
1100
|
+
# @see llvm::MDNode::addOperand()
|
1101
|
+
#
|
1102
|
+
# @method add_named_metadata_operand(m, name, val)
|
1103
|
+
# @param [OpaqueModule] m
|
1104
|
+
# @param [String] name
|
1105
|
+
# @param [OpaqueValue] val
|
1106
|
+
# @return [nil]
|
1107
|
+
# @scope class
|
1108
|
+
attach_function :add_named_metadata_operand, :LLVMAddNamedMetadataOperand, [OpaqueModule, :string, OpaqueValue], :void
|
1109
|
+
|
1110
|
+
# Add a function to a module under a specified name.
|
1111
|
+
#
|
1112
|
+
# @see llvm::Function::Create()
|
1113
|
+
#
|
1114
|
+
# @method add_function(m, name, function_ty)
|
1115
|
+
# @param [OpaqueModule] m
|
1116
|
+
# @param [String] name
|
1117
|
+
# @param [OpaqueType] function_ty
|
1118
|
+
# @return [OpaqueValue]
|
1119
|
+
# @scope class
|
1120
|
+
attach_function :add_function, :LLVMAddFunction, [OpaqueModule, :string, OpaqueType], OpaqueValue
|
1121
|
+
|
1122
|
+
# Obtain a Function value from a Module by its name.
|
1123
|
+
#
|
1124
|
+
# The returned value corresponds to a llvm::Function value.
|
1125
|
+
#
|
1126
|
+
# @see llvm::Module::getFunction()
|
1127
|
+
#
|
1128
|
+
# @method get_named_function(m, name)
|
1129
|
+
# @param [OpaqueModule] m
|
1130
|
+
# @param [String] name
|
1131
|
+
# @return [OpaqueValue]
|
1132
|
+
# @scope class
|
1133
|
+
attach_function :get_named_function, :LLVMGetNamedFunction, [OpaqueModule, :string], OpaqueValue
|
1134
|
+
|
1135
|
+
# Obtain an iterator to the first Function in a Module.
|
1136
|
+
#
|
1137
|
+
# @see llvm::Module::begin()
|
1138
|
+
#
|
1139
|
+
# @method get_first_function(m)
|
1140
|
+
# @param [OpaqueModule] m
|
1141
|
+
# @return [OpaqueValue]
|
1142
|
+
# @scope class
|
1143
|
+
attach_function :get_first_function, :LLVMGetFirstFunction, [OpaqueModule], OpaqueValue
|
1144
|
+
|
1145
|
+
# Obtain an iterator to the last Function in a Module.
|
1146
|
+
#
|
1147
|
+
# @see llvm::Module::end()
|
1148
|
+
#
|
1149
|
+
# @method get_last_function(m)
|
1150
|
+
# @param [OpaqueModule] m
|
1151
|
+
# @return [OpaqueValue]
|
1152
|
+
# @scope class
|
1153
|
+
attach_function :get_last_function, :LLVMGetLastFunction, [OpaqueModule], OpaqueValue
|
1154
|
+
|
1155
|
+
# Advance a Function iterator to the next Function.
|
1156
|
+
#
|
1157
|
+
# Returns NULL if the iterator was already at the end and there are no more
|
1158
|
+
# functions.
|
1159
|
+
#
|
1160
|
+
# @method get_next_function(fn)
|
1161
|
+
# @param [OpaqueValue] fn
|
1162
|
+
# @return [OpaqueValue]
|
1163
|
+
# @scope class
|
1164
|
+
attach_function :get_next_function, :LLVMGetNextFunction, [OpaqueValue], OpaqueValue
|
1165
|
+
|
1166
|
+
# Decrement a Function iterator to the previous Function.
|
1167
|
+
#
|
1168
|
+
# Returns NULL if the iterator was already at the beginning and there are
|
1169
|
+
# no previous functions.
|
1170
|
+
#
|
1171
|
+
# @method get_previous_function(fn)
|
1172
|
+
# @param [OpaqueValue] fn
|
1173
|
+
# @return [OpaqueValue]
|
1174
|
+
# @scope class
|
1175
|
+
attach_function :get_previous_function, :LLVMGetPreviousFunction, [OpaqueValue], OpaqueValue
|
1176
|
+
|
1177
|
+
# Obtain the enumerated type of a Type instance.
|
1178
|
+
#
|
1179
|
+
# @see llvm::Type:getTypeID()
|
805
1180
|
#
|
806
1181
|
# @method get_type_kind(ty)
|
807
1182
|
# @param [OpaqueType] ty
|
@@ -809,7 +1184,11 @@ module RLTK::CG::Bindings
|
|
809
1184
|
# @scope class
|
810
1185
|
attach_function :get_type_kind, :LLVMGetTypeKind, [OpaqueType], :type_kind
|
811
1186
|
|
812
|
-
#
|
1187
|
+
# Whether the type has a known size.
|
1188
|
+
#
|
1189
|
+
# Things that don't have a size are abstract types, labels, and void.a
|
1190
|
+
#
|
1191
|
+
# @see llvm::Type::isSized()
|
813
1192
|
#
|
814
1193
|
# @method type_is_sized(ty)
|
815
1194
|
# @param [OpaqueType] ty
|
@@ -817,7 +1196,9 @@ module RLTK::CG::Bindings
|
|
817
1196
|
# @scope class
|
818
1197
|
attach_function :type_is_sized, :LLVMTypeIsSized, [OpaqueType], :int
|
819
1198
|
|
820
|
-
#
|
1199
|
+
# Obtain the context to which this type instance is associated.
|
1200
|
+
#
|
1201
|
+
# @see llvm::Type::getContext()
|
821
1202
|
#
|
822
1203
|
# @method get_type_context(ty)
|
823
1204
|
# @param [OpaqueType] ty
|
@@ -825,7 +1206,28 @@ module RLTK::CG::Bindings
|
|
825
1206
|
# @scope class
|
826
1207
|
attach_function :get_type_context, :LLVMGetTypeContext, [OpaqueType], OpaqueContext
|
827
1208
|
|
828
|
-
#
|
1209
|
+
# Dump a representation of a type to stderr.
|
1210
|
+
#
|
1211
|
+
# @see llvm::Type::dump()
|
1212
|
+
#
|
1213
|
+
# @method dump_type(val)
|
1214
|
+
# @param [OpaqueType] val
|
1215
|
+
# @return [nil]
|
1216
|
+
# @scope class
|
1217
|
+
attach_function :dump_type, :LLVMDumpType, [OpaqueType], :void
|
1218
|
+
|
1219
|
+
# Return a string representation of the type. Use
|
1220
|
+
# LLVMDisposeMessage to free the string.
|
1221
|
+
#
|
1222
|
+
# @see llvm::Type::print()
|
1223
|
+
#
|
1224
|
+
# @method print_type_to_string(val)
|
1225
|
+
# @param [OpaqueType] val
|
1226
|
+
# @return [String]
|
1227
|
+
# @scope class
|
1228
|
+
attach_function :print_type_to_string, :LLVMPrintTypeToString, [OpaqueType], :string
|
1229
|
+
|
1230
|
+
# Obtain an integer type from a context with specified bit width.
|
829
1231
|
#
|
830
1232
|
# @method int1_type_in_context(c)
|
831
1233
|
# @param [OpaqueContext] c
|
@@ -874,7 +1276,8 @@ module RLTK::CG::Bindings
|
|
874
1276
|
# @scope class
|
875
1277
|
attach_function :int_type_in_context, :LLVMIntTypeInContext, [OpaqueContext, :uint], OpaqueType
|
876
1278
|
|
877
|
-
#
|
1279
|
+
# Obtain an integer type from the global context with a specified bit
|
1280
|
+
# width.
|
878
1281
|
#
|
879
1282
|
# @method int1_type()
|
880
1283
|
# @return [OpaqueType]
|
@@ -925,7 +1328,15 @@ module RLTK::CG::Bindings
|
|
925
1328
|
# @scope class
|
926
1329
|
attach_function :get_int_type_width, :LLVMGetIntTypeWidth, [OpaqueType], :uint
|
927
1330
|
|
928
|
-
#
|
1331
|
+
# Obtain a 16-bit floating point type from a context.
|
1332
|
+
#
|
1333
|
+
# @method half_type_in_context(c)
|
1334
|
+
# @param [OpaqueContext] c
|
1335
|
+
# @return [OpaqueType]
|
1336
|
+
# @scope class
|
1337
|
+
attach_function :half_type_in_context, :LLVMHalfTypeInContext, [OpaqueContext], OpaqueType
|
1338
|
+
|
1339
|
+
# Obtain a 32-bit floating point type from a context.
|
929
1340
|
#
|
930
1341
|
# @method float_type_in_context(c)
|
931
1342
|
# @param [OpaqueContext] c
|
@@ -933,7 +1344,7 @@ module RLTK::CG::Bindings
|
|
933
1344
|
# @scope class
|
934
1345
|
attach_function :float_type_in_context, :LLVMFloatTypeInContext, [OpaqueContext], OpaqueType
|
935
1346
|
|
936
|
-
#
|
1347
|
+
# Obtain a 64-bit floating point type from a context.
|
937
1348
|
#
|
938
1349
|
# @method double_type_in_context(c)
|
939
1350
|
# @param [OpaqueContext] c
|
@@ -941,7 +1352,7 @@ module RLTK::CG::Bindings
|
|
941
1352
|
# @scope class
|
942
1353
|
attach_function :double_type_in_context, :LLVMDoubleTypeInContext, [OpaqueContext], OpaqueType
|
943
1354
|
|
944
|
-
# (
|
1355
|
+
# Obtain a 80-bit floating point type (X87) from a context.
|
945
1356
|
#
|
946
1357
|
# @method x86fp80_type_in_context(c)
|
947
1358
|
# @param [OpaqueContext] c
|
@@ -949,7 +1360,8 @@ module RLTK::CG::Bindings
|
|
949
1360
|
# @scope class
|
950
1361
|
attach_function :x86fp80_type_in_context, :LLVMX86FP80TypeInContext, [OpaqueContext], OpaqueType
|
951
1362
|
|
952
|
-
# (
|
1363
|
+
# Obtain a 128-bit floating point type (112-bit mantissa) from a
|
1364
|
+
# context.
|
953
1365
|
#
|
954
1366
|
# @method fp128_type_in_context(c)
|
955
1367
|
# @param [OpaqueContext] c
|
@@ -957,7 +1369,7 @@ module RLTK::CG::Bindings
|
|
957
1369
|
# @scope class
|
958
1370
|
attach_function :fp128_type_in_context, :LLVMFP128TypeInContext, [OpaqueContext], OpaqueType
|
959
1371
|
|
960
|
-
# (
|
1372
|
+
# Obtain a 128-bit floating point type (two 64-bits) from a context.
|
961
1373
|
#
|
962
1374
|
# @method ppcfp128_type_in_context(c)
|
963
1375
|
# @param [OpaqueContext] c
|
@@ -965,6 +1377,15 @@ module RLTK::CG::Bindings
|
|
965
1377
|
# @scope class
|
966
1378
|
attach_function :ppcfp128_type_in_context, :LLVMPPCFP128TypeInContext, [OpaqueContext], OpaqueType
|
967
1379
|
|
1380
|
+
# Obtain a floating point type from the global context.
|
1381
|
+
#
|
1382
|
+
# These map to the functions in this group of the same name.
|
1383
|
+
#
|
1384
|
+
# @method half_type()
|
1385
|
+
# @return [OpaqueType]
|
1386
|
+
# @scope class
|
1387
|
+
attach_function :half_type, :LLVMHalfType, [], OpaqueType
|
1388
|
+
|
968
1389
|
# (Not documented)
|
969
1390
|
#
|
970
1391
|
# @method float_type()
|
@@ -1000,7 +1421,10 @@ module RLTK::CG::Bindings
|
|
1000
1421
|
# @scope class
|
1001
1422
|
attach_function :ppcfp128_type, :LLVMPPCFP128Type, [], OpaqueType
|
1002
1423
|
|
1003
|
-
#
|
1424
|
+
# Obtain a function type consisting of a specified signature.
|
1425
|
+
#
|
1426
|
+
# The function is defined as a tuple of a return Type, a list of
|
1427
|
+
# parameter types, and whether the function is variadic.
|
1004
1428
|
#
|
1005
1429
|
# @method function_type(return_type, param_types, param_count, is_var_arg)
|
1006
1430
|
# @param [OpaqueType] return_type
|
@@ -1011,7 +1435,7 @@ module RLTK::CG::Bindings
|
|
1011
1435
|
# @scope class
|
1012
1436
|
attach_function :function_type, :LLVMFunctionType, [OpaqueType, :pointer, :uint, :int], OpaqueType
|
1013
1437
|
|
1014
|
-
#
|
1438
|
+
# Returns whether a function type is variadic.
|
1015
1439
|
#
|
1016
1440
|
# @method is_function_var_arg(function_ty)
|
1017
1441
|
# @param [OpaqueType] function_ty
|
@@ -1019,7 +1443,7 @@ module RLTK::CG::Bindings
|
|
1019
1443
|
# @scope class
|
1020
1444
|
attach_function :is_function_var_arg, :LLVMIsFunctionVarArg, [OpaqueType], :int
|
1021
1445
|
|
1022
|
-
#
|
1446
|
+
# Obtain the Type this function Type returns.
|
1023
1447
|
#
|
1024
1448
|
# @method get_return_type(function_ty)
|
1025
1449
|
# @param [OpaqueType] function_ty
|
@@ -1027,7 +1451,7 @@ module RLTK::CG::Bindings
|
|
1027
1451
|
# @scope class
|
1028
1452
|
attach_function :get_return_type, :LLVMGetReturnType, [OpaqueType], OpaqueType
|
1029
1453
|
|
1030
|
-
#
|
1454
|
+
# Obtain the number of parameters this function accepts.
|
1031
1455
|
#
|
1032
1456
|
# @method count_param_types(function_ty)
|
1033
1457
|
# @param [OpaqueType] function_ty
|
@@ -1035,7 +1459,15 @@ module RLTK::CG::Bindings
|
|
1035
1459
|
# @scope class
|
1036
1460
|
attach_function :count_param_types, :LLVMCountParamTypes, [OpaqueType], :uint
|
1037
1461
|
|
1038
|
-
#
|
1462
|
+
# Obtain the types of a function's parameters.
|
1463
|
+
#
|
1464
|
+
# The Dest parameter should point to a pre-allocated array of
|
1465
|
+
# LLVMTypeRef at least LLVMCountParamTypes() large. On return, the
|
1466
|
+
# first LLVMCountParamTypes() entries in the array will be populated
|
1467
|
+
# with LLVMTypeRef instances.
|
1468
|
+
#
|
1469
|
+
# @param FunctionTy The function type to operate on.
|
1470
|
+
# @param Dest Memory address of an array to be filled with result.
|
1039
1471
|
#
|
1040
1472
|
# @method get_param_types(function_ty, dest)
|
1041
1473
|
# @param [OpaqueType] function_ty
|
@@ -1044,7 +1476,12 @@ module RLTK::CG::Bindings
|
|
1044
1476
|
# @scope class
|
1045
1477
|
attach_function :get_param_types, :LLVMGetParamTypes, [OpaqueType, :pointer], :void
|
1046
1478
|
|
1047
|
-
#
|
1479
|
+
# Create a new structure type in a context.
|
1480
|
+
#
|
1481
|
+
# A structure is specified by a list of inner elements/types and
|
1482
|
+
# whether these can be packed together.
|
1483
|
+
#
|
1484
|
+
# @see llvm::StructType::create()
|
1048
1485
|
#
|
1049
1486
|
# @method struct_type_in_context(c, element_types, element_count, packed)
|
1050
1487
|
# @param [OpaqueContext] c
|
@@ -1055,7 +1492,9 @@ module RLTK::CG::Bindings
|
|
1055
1492
|
# @scope class
|
1056
1493
|
attach_function :struct_type_in_context, :LLVMStructTypeInContext, [OpaqueContext, :pointer, :uint, :int], OpaqueType
|
1057
1494
|
|
1058
|
-
#
|
1495
|
+
# Create a new structure type in the global context.
|
1496
|
+
#
|
1497
|
+
# @see llvm::StructType::create()
|
1059
1498
|
#
|
1060
1499
|
# @method struct_type(element_types, element_count, packed)
|
1061
1500
|
# @param [FFI::Pointer(*TypeRef)] element_types
|
@@ -1065,7 +1504,9 @@ module RLTK::CG::Bindings
|
|
1065
1504
|
# @scope class
|
1066
1505
|
attach_function :struct_type, :LLVMStructType, [:pointer, :uint, :int], OpaqueType
|
1067
1506
|
|
1068
|
-
#
|
1507
|
+
# Create an empty structure in a context having a specified name.
|
1508
|
+
#
|
1509
|
+
# @see llvm::StructType::create()
|
1069
1510
|
#
|
1070
1511
|
# @method struct_create_named(c, name)
|
1071
1512
|
# @param [OpaqueContext] c
|
@@ -1074,7 +1515,9 @@ module RLTK::CG::Bindings
|
|
1074
1515
|
# @scope class
|
1075
1516
|
attach_function :struct_create_named, :LLVMStructCreateNamed, [OpaqueContext, :string], OpaqueType
|
1076
1517
|
|
1077
|
-
#
|
1518
|
+
# Obtain the name of a structure.
|
1519
|
+
#
|
1520
|
+
# @see llvm::StructType::getName()
|
1078
1521
|
#
|
1079
1522
|
# @method get_struct_name(ty)
|
1080
1523
|
# @param [OpaqueType] ty
|
@@ -1082,7 +1525,9 @@ module RLTK::CG::Bindings
|
|
1082
1525
|
# @scope class
|
1083
1526
|
attach_function :get_struct_name, :LLVMGetStructName, [OpaqueType], :string
|
1084
1527
|
|
1085
|
-
#
|
1528
|
+
# Set the contents of a structure type.
|
1529
|
+
#
|
1530
|
+
# @see llvm::StructType::setBody()
|
1086
1531
|
#
|
1087
1532
|
# @method struct_set_body(struct_ty, element_types, element_count, packed)
|
1088
1533
|
# @param [OpaqueType] struct_ty
|
@@ -1093,7 +1538,9 @@ module RLTK::CG::Bindings
|
|
1093
1538
|
# @scope class
|
1094
1539
|
attach_function :struct_set_body, :LLVMStructSetBody, [OpaqueType, :pointer, :uint, :int], :void
|
1095
1540
|
|
1096
|
-
#
|
1541
|
+
# Get the number of elements defined inside the structure.
|
1542
|
+
#
|
1543
|
+
# @see llvm::StructType::getNumElements()
|
1097
1544
|
#
|
1098
1545
|
# @method count_struct_element_types(struct_ty)
|
1099
1546
|
# @param [OpaqueType] struct_ty
|
@@ -1101,7 +1548,14 @@ module RLTK::CG::Bindings
|
|
1101
1548
|
# @scope class
|
1102
1549
|
attach_function :count_struct_element_types, :LLVMCountStructElementTypes, [OpaqueType], :uint
|
1103
1550
|
|
1104
|
-
#
|
1551
|
+
# Get the elements within a structure.
|
1552
|
+
#
|
1553
|
+
# The function is passed the address of a pre-allocated array of
|
1554
|
+
# LLVMTypeRef at least LLVMCountStructElementTypes() long. After
|
1555
|
+
# invocation, this array will be populated with the structure's
|
1556
|
+
# elements. The objects in the destination array will have a lifetime
|
1557
|
+
# of the structure type itself, which is the lifetime of the context it
|
1558
|
+
# is contained in.
|
1105
1559
|
#
|
1106
1560
|
# @method get_struct_element_types(struct_ty, dest)
|
1107
1561
|
# @param [OpaqueType] struct_ty
|
@@ -1110,7 +1564,9 @@ module RLTK::CG::Bindings
|
|
1110
1564
|
# @scope class
|
1111
1565
|
attach_function :get_struct_element_types, :LLVMGetStructElementTypes, [OpaqueType, :pointer], :void
|
1112
1566
|
|
1113
|
-
#
|
1567
|
+
# Determine whether a structure is packed.
|
1568
|
+
#
|
1569
|
+
# @see llvm::StructType::isPacked()
|
1114
1570
|
#
|
1115
1571
|
# @method is_packed_struct(struct_ty)
|
1116
1572
|
# @param [OpaqueType] struct_ty
|
@@ -1118,7 +1574,9 @@ module RLTK::CG::Bindings
|
|
1118
1574
|
# @scope class
|
1119
1575
|
attach_function :is_packed_struct, :LLVMIsPackedStruct, [OpaqueType], :int
|
1120
1576
|
|
1121
|
-
#
|
1577
|
+
# Determine whether a structure is opaque.
|
1578
|
+
#
|
1579
|
+
# @see llvm::StructType::isOpaque()
|
1122
1580
|
#
|
1123
1581
|
# @method is_opaque_struct(struct_ty)
|
1124
1582
|
# @param [OpaqueType] struct_ty
|
@@ -1126,16 +1584,24 @@ module RLTK::CG::Bindings
|
|
1126
1584
|
# @scope class
|
1127
1585
|
attach_function :is_opaque_struct, :LLVMIsOpaqueStruct, [OpaqueType], :int
|
1128
1586
|
|
1129
|
-
#
|
1587
|
+
# Obtain the type of elements within a sequential type.
|
1130
1588
|
#
|
1131
|
-
#
|
1132
|
-
#
|
1133
|
-
# @
|
1589
|
+
# This works on array, vector, and pointer types.
|
1590
|
+
#
|
1591
|
+
# @see llvm::SequentialType::getElementType()
|
1592
|
+
#
|
1593
|
+
# @method get_element_type(ty)
|
1594
|
+
# @param [OpaqueType] ty
|
1134
1595
|
# @return [OpaqueType]
|
1135
1596
|
# @scope class
|
1136
|
-
attach_function :
|
1597
|
+
attach_function :get_element_type, :LLVMGetElementType, [OpaqueType], OpaqueType
|
1137
1598
|
|
1138
|
-
#
|
1599
|
+
# Create a fixed size array type that refers to a specific type.
|
1600
|
+
#
|
1601
|
+
# The created type will exist in the context that its element type
|
1602
|
+
# exists in.
|
1603
|
+
#
|
1604
|
+
# @see llvm::ArrayType::get()
|
1139
1605
|
#
|
1140
1606
|
# @method array_type(element_type, element_count)
|
1141
1607
|
# @param [OpaqueType] element_type
|
@@ -1144,7 +1610,24 @@ module RLTK::CG::Bindings
|
|
1144
1610
|
# @scope class
|
1145
1611
|
attach_function :array_type, :LLVMArrayType, [OpaqueType, :uint], OpaqueType
|
1146
1612
|
|
1147
|
-
#
|
1613
|
+
# Obtain the length of an array type.
|
1614
|
+
#
|
1615
|
+
# This only works on types that represent arrays.
|
1616
|
+
#
|
1617
|
+
# @see llvm::ArrayType::getNumElements()
|
1618
|
+
#
|
1619
|
+
# @method get_array_length(array_ty)
|
1620
|
+
# @param [OpaqueType] array_ty
|
1621
|
+
# @return [Integer]
|
1622
|
+
# @scope class
|
1623
|
+
attach_function :get_array_length, :LLVMGetArrayLength, [OpaqueType], :uint
|
1624
|
+
|
1625
|
+
# Create a pointer type that points to a defined type.
|
1626
|
+
#
|
1627
|
+
# The created type will exist in the context that its pointee type
|
1628
|
+
# exists in.
|
1629
|
+
#
|
1630
|
+
# @see llvm::PointerType::get()
|
1148
1631
|
#
|
1149
1632
|
# @method pointer_type(element_type, address_space)
|
1150
1633
|
# @param [OpaqueType] element_type
|
@@ -1153,7 +1636,25 @@ module RLTK::CG::Bindings
|
|
1153
1636
|
# @scope class
|
1154
1637
|
attach_function :pointer_type, :LLVMPointerType, [OpaqueType, :uint], OpaqueType
|
1155
1638
|
|
1156
|
-
#
|
1639
|
+
# Obtain the address space of a pointer type.
|
1640
|
+
#
|
1641
|
+
# This only works on types that represent pointers.
|
1642
|
+
#
|
1643
|
+
# @see llvm::PointerType::getAddressSpace()
|
1644
|
+
#
|
1645
|
+
# @method get_pointer_address_space(pointer_ty)
|
1646
|
+
# @param [OpaqueType] pointer_ty
|
1647
|
+
# @return [Integer]
|
1648
|
+
# @scope class
|
1649
|
+
attach_function :get_pointer_address_space, :LLVMGetPointerAddressSpace, [OpaqueType], :uint
|
1650
|
+
|
1651
|
+
# Create a vector type that contains a defined type and has a specific
|
1652
|
+
# number of elements.
|
1653
|
+
#
|
1654
|
+
# The created type will exist in the context thats its element type
|
1655
|
+
# exists in.
|
1656
|
+
#
|
1657
|
+
# @see llvm::VectorType::get()
|
1157
1658
|
#
|
1158
1659
|
# @method vector_type(element_type, element_count)
|
1159
1660
|
# @param [OpaqueType] element_type
|
@@ -1162,31 +1663,11 @@ module RLTK::CG::Bindings
|
|
1162
1663
|
# @scope class
|
1163
1664
|
attach_function :vector_type, :LLVMVectorType, [OpaqueType, :uint], OpaqueType
|
1164
1665
|
|
1165
|
-
#
|
1166
|
-
#
|
1167
|
-
# @method get_element_type(ty)
|
1168
|
-
# @param [OpaqueType] ty
|
1169
|
-
# @return [OpaqueType]
|
1170
|
-
# @scope class
|
1171
|
-
attach_function :get_element_type, :LLVMGetElementType, [OpaqueType], OpaqueType
|
1172
|
-
|
1173
|
-
# (Not documented)
|
1666
|
+
# Obtain the number of elements in a vector type.
|
1174
1667
|
#
|
1175
|
-
#
|
1176
|
-
# @param [OpaqueType] array_ty
|
1177
|
-
# @return [Integer]
|
1178
|
-
# @scope class
|
1179
|
-
attach_function :get_array_length, :LLVMGetArrayLength, [OpaqueType], :uint
|
1180
|
-
|
1181
|
-
# (Not documented)
|
1668
|
+
# This only works on types that represent vectors.
|
1182
1669
|
#
|
1183
|
-
# @
|
1184
|
-
# @param [OpaqueType] pointer_ty
|
1185
|
-
# @return [Integer]
|
1186
|
-
# @scope class
|
1187
|
-
attach_function :get_pointer_address_space, :LLVMGetPointerAddressSpace, [OpaqueType], :uint
|
1188
|
-
|
1189
|
-
# (Not documented)
|
1670
|
+
# @see llvm::VectorType::getNumElements()
|
1190
1671
|
#
|
1191
1672
|
# @method get_vector_size(vector_ty)
|
1192
1673
|
# @param [OpaqueType] vector_ty
|
@@ -1194,7 +1675,7 @@ module RLTK::CG::Bindings
|
|
1194
1675
|
# @scope class
|
1195
1676
|
attach_function :get_vector_size, :LLVMGetVectorSize, [OpaqueType], :uint
|
1196
1677
|
|
1197
|
-
#
|
1678
|
+
# Create a void type in a context.
|
1198
1679
|
#
|
1199
1680
|
# @method void_type_in_context(c)
|
1200
1681
|
# @param [OpaqueContext] c
|
@@ -1202,7 +1683,7 @@ module RLTK::CG::Bindings
|
|
1202
1683
|
# @scope class
|
1203
1684
|
attach_function :void_type_in_context, :LLVMVoidTypeInContext, [OpaqueContext], OpaqueType
|
1204
1685
|
|
1205
|
-
#
|
1686
|
+
# Create a label type in a context.
|
1206
1687
|
#
|
1207
1688
|
# @method label_type_in_context(c)
|
1208
1689
|
# @param [OpaqueContext] c
|
@@ -1210,7 +1691,7 @@ module RLTK::CG::Bindings
|
|
1210
1691
|
# @scope class
|
1211
1692
|
attach_function :label_type_in_context, :LLVMLabelTypeInContext, [OpaqueContext], OpaqueType
|
1212
1693
|
|
1213
|
-
#
|
1694
|
+
# Create a X86 MMX type in a context.
|
1214
1695
|
#
|
1215
1696
|
# @method x86mmx_type_in_context(c)
|
1216
1697
|
# @param [OpaqueContext] c
|
@@ -1218,7 +1699,8 @@ module RLTK::CG::Bindings
|
|
1218
1699
|
# @scope class
|
1219
1700
|
attach_function :x86mmx_type_in_context, :LLVMX86MMXTypeInContext, [OpaqueContext], OpaqueType
|
1220
1701
|
|
1221
|
-
#
|
1702
|
+
# These are similar to the above functions except they operate on the
|
1703
|
+
# global context.
|
1222
1704
|
#
|
1223
1705
|
# @method void_type()
|
1224
1706
|
# @return [OpaqueType]
|
@@ -1239,7 +1721,9 @@ module RLTK::CG::Bindings
|
|
1239
1721
|
# @scope class
|
1240
1722
|
attach_function :x86mmx_type, :LLVMX86MMXType, [], OpaqueType
|
1241
1723
|
|
1242
|
-
#
|
1724
|
+
# Obtain the type of a value.
|
1725
|
+
#
|
1726
|
+
# @see llvm::Value::getType()
|
1243
1727
|
#
|
1244
1728
|
# @method type_of(val)
|
1245
1729
|
# @param [OpaqueValue] val
|
@@ -1247,7 +1731,9 @@ module RLTK::CG::Bindings
|
|
1247
1731
|
# @scope class
|
1248
1732
|
attach_function :type_of, :LLVMTypeOf, [OpaqueValue], OpaqueType
|
1249
1733
|
|
1250
|
-
#
|
1734
|
+
# Obtain the string name of a value.
|
1735
|
+
#
|
1736
|
+
# @see llvm::Value::getName()
|
1251
1737
|
#
|
1252
1738
|
# @method get_value_name(val)
|
1253
1739
|
# @param [OpaqueValue] val
|
@@ -1255,7 +1741,9 @@ module RLTK::CG::Bindings
|
|
1255
1741
|
# @scope class
|
1256
1742
|
attach_function :get_value_name, :LLVMGetValueName, [OpaqueValue], :string
|
1257
1743
|
|
1258
|
-
#
|
1744
|
+
# Set the string name of a value.
|
1745
|
+
#
|
1746
|
+
# @see llvm::Value::setName()
|
1259
1747
|
#
|
1260
1748
|
# @method set_value_name(val, name)
|
1261
1749
|
# @param [OpaqueValue] val
|
@@ -1264,7 +1752,9 @@ module RLTK::CG::Bindings
|
|
1264
1752
|
# @scope class
|
1265
1753
|
attach_function :set_value_name, :LLVMSetValueName, [OpaqueValue, :string], :void
|
1266
1754
|
|
1267
|
-
#
|
1755
|
+
# Dump a representation of a value to stderr.
|
1756
|
+
#
|
1757
|
+
# @see llvm::Value::dump()
|
1268
1758
|
#
|
1269
1759
|
# @method dump_value(val)
|
1270
1760
|
# @param [OpaqueValue] val
|
@@ -1272,7 +1762,20 @@ module RLTK::CG::Bindings
|
|
1272
1762
|
# @scope class
|
1273
1763
|
attach_function :dump_value, :LLVMDumpValue, [OpaqueValue], :void
|
1274
1764
|
|
1275
|
-
#
|
1765
|
+
# Return a string representation of the value. Use
|
1766
|
+
# LLVMDisposeMessage to free the string.
|
1767
|
+
#
|
1768
|
+
# @see llvm::Value::print()
|
1769
|
+
#
|
1770
|
+
# @method print_value_to_string(val)
|
1771
|
+
# @param [OpaqueValue] val
|
1772
|
+
# @return [String]
|
1773
|
+
# @scope class
|
1774
|
+
attach_function :print_value_to_string, :LLVMPrintValueToString, [OpaqueValue], :string
|
1775
|
+
|
1776
|
+
# Replace all uses of a value with another one.
|
1777
|
+
#
|
1778
|
+
# @see llvm::Value::replaceAllUsesWith()
|
1276
1779
|
#
|
1277
1780
|
# @method replace_all_uses_with(old_val, new_val)
|
1278
1781
|
# @param [OpaqueValue] old_val
|
@@ -1281,34 +1784,31 @@ module RLTK::CG::Bindings
|
|
1281
1784
|
# @scope class
|
1282
1785
|
attach_function :replace_all_uses_with, :LLVMReplaceAllUsesWith, [OpaqueValue, OpaqueValue], :void
|
1283
1786
|
|
1284
|
-
#
|
1787
|
+
# Determine whether the specified constant instance is constant.
|
1285
1788
|
#
|
1286
|
-
# @method
|
1789
|
+
# @method is_constant(val)
|
1287
1790
|
# @param [OpaqueValue] val
|
1288
1791
|
# @return [Integer]
|
1289
1792
|
# @scope class
|
1290
|
-
attach_function :
|
1793
|
+
attach_function :is_constant, :LLVMIsConstant, [OpaqueValue], :int
|
1291
1794
|
|
1292
|
-
#
|
1795
|
+
# Determine whether a value instance is undefined.
|
1293
1796
|
#
|
1294
|
-
# @method
|
1797
|
+
# @method is_undef(val)
|
1295
1798
|
# @param [OpaqueValue] val
|
1296
|
-
# @
|
1297
|
-
# @return [OpaqueValue]
|
1799
|
+
# @return [Integer]
|
1298
1800
|
# @scope class
|
1299
|
-
attach_function :
|
1801
|
+
attach_function :is_undef, :LLVMIsUndef, [OpaqueValue], :int
|
1300
1802
|
|
1301
|
-
#
|
1803
|
+
# Convert value instances between types.
|
1302
1804
|
#
|
1303
|
-
#
|
1304
|
-
#
|
1305
|
-
#
|
1306
|
-
#
|
1307
|
-
#
|
1308
|
-
#
|
1309
|
-
|
1310
|
-
|
1311
|
-
# (Not documented)
|
1805
|
+
# Internally, an LLVMValueRef is "pinned" to a specific type. This
|
1806
|
+
# series of functions allows you to cast an instance to a specific
|
1807
|
+
# type.
|
1808
|
+
#
|
1809
|
+
# If the cast is not valid for the specified type, NULL is returned.
|
1810
|
+
#
|
1811
|
+
# @see llvm::dyn_cast_or_null<>
|
1312
1812
|
#
|
1313
1813
|
# @method is_a_argument(val)
|
1314
1814
|
# @param [OpaqueValue] val
|
@@ -1316,7 +1816,7 @@ module RLTK::CG::Bindings
|
|
1316
1816
|
# @scope class
|
1317
1817
|
attach_function :is_a_argument, :LLVMIsAArgument, [OpaqueValue], OpaqueValue
|
1318
1818
|
|
1319
|
-
#
|
1819
|
+
# @}
|
1320
1820
|
#
|
1321
1821
|
# @method is_a_basic_block(val)
|
1322
1822
|
# @param [OpaqueValue] val
|
@@ -1324,7 +1824,7 @@ module RLTK::CG::Bindings
|
|
1324
1824
|
# @scope class
|
1325
1825
|
attach_function :is_a_basic_block, :LLVMIsABasicBlock, [OpaqueValue], OpaqueValue
|
1326
1826
|
|
1327
|
-
#
|
1827
|
+
# @}
|
1328
1828
|
#
|
1329
1829
|
# @method is_a_inline_asm(val)
|
1330
1830
|
# @param [OpaqueValue] val
|
@@ -1332,7 +1832,7 @@ module RLTK::CG::Bindings
|
|
1332
1832
|
# @scope class
|
1333
1833
|
attach_function :is_a_inline_asm, :LLVMIsAInlineAsm, [OpaqueValue], OpaqueValue
|
1334
1834
|
|
1335
|
-
#
|
1835
|
+
# @}
|
1336
1836
|
#
|
1337
1837
|
# @method is_amd_node(val)
|
1338
1838
|
# @param [OpaqueValue] val
|
@@ -1340,7 +1840,7 @@ module RLTK::CG::Bindings
|
|
1340
1840
|
# @scope class
|
1341
1841
|
attach_function :is_amd_node, :LLVMIsAMDNode, [OpaqueValue], OpaqueValue
|
1342
1842
|
|
1343
|
-
#
|
1843
|
+
# @}
|
1344
1844
|
#
|
1345
1845
|
# @method is_amd_string(val)
|
1346
1846
|
# @param [OpaqueValue] val
|
@@ -1348,7 +1848,7 @@ module RLTK::CG::Bindings
|
|
1348
1848
|
# @scope class
|
1349
1849
|
attach_function :is_amd_string, :LLVMIsAMDString, [OpaqueValue], OpaqueValue
|
1350
1850
|
|
1351
|
-
#
|
1851
|
+
# @}
|
1352
1852
|
#
|
1353
1853
|
# @method is_a_user(val)
|
1354
1854
|
# @param [OpaqueValue] val
|
@@ -1356,7 +1856,7 @@ module RLTK::CG::Bindings
|
|
1356
1856
|
# @scope class
|
1357
1857
|
attach_function :is_a_user, :LLVMIsAUser, [OpaqueValue], OpaqueValue
|
1358
1858
|
|
1359
|
-
#
|
1859
|
+
# @}
|
1360
1860
|
#
|
1361
1861
|
# @method is_a_constant(val)
|
1362
1862
|
# @param [OpaqueValue] val
|
@@ -1364,7 +1864,7 @@ module RLTK::CG::Bindings
|
|
1364
1864
|
# @scope class
|
1365
1865
|
attach_function :is_a_constant, :LLVMIsAConstant, [OpaqueValue], OpaqueValue
|
1366
1866
|
|
1367
|
-
#
|
1867
|
+
# @}
|
1368
1868
|
#
|
1369
1869
|
# @method is_a_block_address(val)
|
1370
1870
|
# @param [OpaqueValue] val
|
@@ -1372,7 +1872,7 @@ module RLTK::CG::Bindings
|
|
1372
1872
|
# @scope class
|
1373
1873
|
attach_function :is_a_block_address, :LLVMIsABlockAddress, [OpaqueValue], OpaqueValue
|
1374
1874
|
|
1375
|
-
#
|
1875
|
+
# @}
|
1376
1876
|
#
|
1377
1877
|
# @method is_a_constant_aggregate_zero(val)
|
1378
1878
|
# @param [OpaqueValue] val
|
@@ -1380,7 +1880,7 @@ module RLTK::CG::Bindings
|
|
1380
1880
|
# @scope class
|
1381
1881
|
attach_function :is_a_constant_aggregate_zero, :LLVMIsAConstantAggregateZero, [OpaqueValue], OpaqueValue
|
1382
1882
|
|
1383
|
-
#
|
1883
|
+
# @}
|
1384
1884
|
#
|
1385
1885
|
# @method is_a_constant_array(val)
|
1386
1886
|
# @param [OpaqueValue] val
|
@@ -1388,7 +1888,31 @@ module RLTK::CG::Bindings
|
|
1388
1888
|
# @scope class
|
1389
1889
|
attach_function :is_a_constant_array, :LLVMIsAConstantArray, [OpaqueValue], OpaqueValue
|
1390
1890
|
|
1391
|
-
#
|
1891
|
+
# @}
|
1892
|
+
#
|
1893
|
+
# @method is_a_constant_data_sequential(val)
|
1894
|
+
# @param [OpaqueValue] val
|
1895
|
+
# @return [OpaqueValue]
|
1896
|
+
# @scope class
|
1897
|
+
attach_function :is_a_constant_data_sequential, :LLVMIsAConstantDataSequential, [OpaqueValue], OpaqueValue
|
1898
|
+
|
1899
|
+
# @}
|
1900
|
+
#
|
1901
|
+
# @method is_a_constant_data_array(val)
|
1902
|
+
# @param [OpaqueValue] val
|
1903
|
+
# @return [OpaqueValue]
|
1904
|
+
# @scope class
|
1905
|
+
attach_function :is_a_constant_data_array, :LLVMIsAConstantDataArray, [OpaqueValue], OpaqueValue
|
1906
|
+
|
1907
|
+
# @}
|
1908
|
+
#
|
1909
|
+
# @method is_a_constant_data_vector(val)
|
1910
|
+
# @param [OpaqueValue] val
|
1911
|
+
# @return [OpaqueValue]
|
1912
|
+
# @scope class
|
1913
|
+
attach_function :is_a_constant_data_vector, :LLVMIsAConstantDataVector, [OpaqueValue], OpaqueValue
|
1914
|
+
|
1915
|
+
# @}
|
1392
1916
|
#
|
1393
1917
|
# @method is_a_constant_expr(val)
|
1394
1918
|
# @param [OpaqueValue] val
|
@@ -1396,7 +1920,7 @@ module RLTK::CG::Bindings
|
|
1396
1920
|
# @scope class
|
1397
1921
|
attach_function :is_a_constant_expr, :LLVMIsAConstantExpr, [OpaqueValue], OpaqueValue
|
1398
1922
|
|
1399
|
-
#
|
1923
|
+
# @}
|
1400
1924
|
#
|
1401
1925
|
# @method is_a_constant_fp(val)
|
1402
1926
|
# @param [OpaqueValue] val
|
@@ -1404,7 +1928,7 @@ module RLTK::CG::Bindings
|
|
1404
1928
|
# @scope class
|
1405
1929
|
attach_function :is_a_constant_fp, :LLVMIsAConstantFP, [OpaqueValue], OpaqueValue
|
1406
1930
|
|
1407
|
-
#
|
1931
|
+
# @}
|
1408
1932
|
#
|
1409
1933
|
# @method is_a_constant_int(val)
|
1410
1934
|
# @param [OpaqueValue] val
|
@@ -1412,7 +1936,7 @@ module RLTK::CG::Bindings
|
|
1412
1936
|
# @scope class
|
1413
1937
|
attach_function :is_a_constant_int, :LLVMIsAConstantInt, [OpaqueValue], OpaqueValue
|
1414
1938
|
|
1415
|
-
#
|
1939
|
+
# @}
|
1416
1940
|
#
|
1417
1941
|
# @method is_a_constant_pointer_null(val)
|
1418
1942
|
# @param [OpaqueValue] val
|
@@ -1420,7 +1944,7 @@ module RLTK::CG::Bindings
|
|
1420
1944
|
# @scope class
|
1421
1945
|
attach_function :is_a_constant_pointer_null, :LLVMIsAConstantPointerNull, [OpaqueValue], OpaqueValue
|
1422
1946
|
|
1423
|
-
#
|
1947
|
+
# @}
|
1424
1948
|
#
|
1425
1949
|
# @method is_a_constant_struct(val)
|
1426
1950
|
# @param [OpaqueValue] val
|
@@ -1428,7 +1952,7 @@ module RLTK::CG::Bindings
|
|
1428
1952
|
# @scope class
|
1429
1953
|
attach_function :is_a_constant_struct, :LLVMIsAConstantStruct, [OpaqueValue], OpaqueValue
|
1430
1954
|
|
1431
|
-
#
|
1955
|
+
# @}
|
1432
1956
|
#
|
1433
1957
|
# @method is_a_constant_vector(val)
|
1434
1958
|
# @param [OpaqueValue] val
|
@@ -1436,7 +1960,7 @@ module RLTK::CG::Bindings
|
|
1436
1960
|
# @scope class
|
1437
1961
|
attach_function :is_a_constant_vector, :LLVMIsAConstantVector, [OpaqueValue], OpaqueValue
|
1438
1962
|
|
1439
|
-
#
|
1963
|
+
# @}
|
1440
1964
|
#
|
1441
1965
|
# @method is_a_global_value(val)
|
1442
1966
|
# @param [OpaqueValue] val
|
@@ -1444,7 +1968,7 @@ module RLTK::CG::Bindings
|
|
1444
1968
|
# @scope class
|
1445
1969
|
attach_function :is_a_global_value, :LLVMIsAGlobalValue, [OpaqueValue], OpaqueValue
|
1446
1970
|
|
1447
|
-
#
|
1971
|
+
# @}
|
1448
1972
|
#
|
1449
1973
|
# @method is_a_function(val)
|
1450
1974
|
# @param [OpaqueValue] val
|
@@ -1452,7 +1976,7 @@ module RLTK::CG::Bindings
|
|
1452
1976
|
# @scope class
|
1453
1977
|
attach_function :is_a_function, :LLVMIsAFunction, [OpaqueValue], OpaqueValue
|
1454
1978
|
|
1455
|
-
#
|
1979
|
+
# @}
|
1456
1980
|
#
|
1457
1981
|
# @method is_a_global_alias(val)
|
1458
1982
|
# @param [OpaqueValue] val
|
@@ -1460,7 +1984,7 @@ module RLTK::CG::Bindings
|
|
1460
1984
|
# @scope class
|
1461
1985
|
attach_function :is_a_global_alias, :LLVMIsAGlobalAlias, [OpaqueValue], OpaqueValue
|
1462
1986
|
|
1463
|
-
#
|
1987
|
+
# @}
|
1464
1988
|
#
|
1465
1989
|
# @method is_a_global_variable(val)
|
1466
1990
|
# @param [OpaqueValue] val
|
@@ -1468,7 +1992,7 @@ module RLTK::CG::Bindings
|
|
1468
1992
|
# @scope class
|
1469
1993
|
attach_function :is_a_global_variable, :LLVMIsAGlobalVariable, [OpaqueValue], OpaqueValue
|
1470
1994
|
|
1471
|
-
#
|
1995
|
+
# @}
|
1472
1996
|
#
|
1473
1997
|
# @method is_a_undef_value(val)
|
1474
1998
|
# @param [OpaqueValue] val
|
@@ -1476,7 +2000,7 @@ module RLTK::CG::Bindings
|
|
1476
2000
|
# @scope class
|
1477
2001
|
attach_function :is_a_undef_value, :LLVMIsAUndefValue, [OpaqueValue], OpaqueValue
|
1478
2002
|
|
1479
|
-
#
|
2003
|
+
# @}
|
1480
2004
|
#
|
1481
2005
|
# @method is_a_instruction(val)
|
1482
2006
|
# @param [OpaqueValue] val
|
@@ -1484,7 +2008,7 @@ module RLTK::CG::Bindings
|
|
1484
2008
|
# @scope class
|
1485
2009
|
attach_function :is_a_instruction, :LLVMIsAInstruction, [OpaqueValue], OpaqueValue
|
1486
2010
|
|
1487
|
-
#
|
2011
|
+
# @}
|
1488
2012
|
#
|
1489
2013
|
# @method is_a_binary_operator(val)
|
1490
2014
|
# @param [OpaqueValue] val
|
@@ -1492,7 +2016,7 @@ module RLTK::CG::Bindings
|
|
1492
2016
|
# @scope class
|
1493
2017
|
attach_function :is_a_binary_operator, :LLVMIsABinaryOperator, [OpaqueValue], OpaqueValue
|
1494
2018
|
|
1495
|
-
#
|
2019
|
+
# @}
|
1496
2020
|
#
|
1497
2021
|
# @method is_a_call_inst(val)
|
1498
2022
|
# @param [OpaqueValue] val
|
@@ -1500,7 +2024,7 @@ module RLTK::CG::Bindings
|
|
1500
2024
|
# @scope class
|
1501
2025
|
attach_function :is_a_call_inst, :LLVMIsACallInst, [OpaqueValue], OpaqueValue
|
1502
2026
|
|
1503
|
-
#
|
2027
|
+
# @}
|
1504
2028
|
#
|
1505
2029
|
# @method is_a_intrinsic_inst(val)
|
1506
2030
|
# @param [OpaqueValue] val
|
@@ -1508,7 +2032,7 @@ module RLTK::CG::Bindings
|
|
1508
2032
|
# @scope class
|
1509
2033
|
attach_function :is_a_intrinsic_inst, :LLVMIsAIntrinsicInst, [OpaqueValue], OpaqueValue
|
1510
2034
|
|
1511
|
-
#
|
2035
|
+
# @}
|
1512
2036
|
#
|
1513
2037
|
# @method is_a_dbg_info_intrinsic(val)
|
1514
2038
|
# @param [OpaqueValue] val
|
@@ -1516,7 +2040,7 @@ module RLTK::CG::Bindings
|
|
1516
2040
|
# @scope class
|
1517
2041
|
attach_function :is_a_dbg_info_intrinsic, :LLVMIsADbgInfoIntrinsic, [OpaqueValue], OpaqueValue
|
1518
2042
|
|
1519
|
-
#
|
2043
|
+
# @}
|
1520
2044
|
#
|
1521
2045
|
# @method is_a_dbg_declare_inst(val)
|
1522
2046
|
# @param [OpaqueValue] val
|
@@ -1524,23 +2048,7 @@ module RLTK::CG::Bindings
|
|
1524
2048
|
# @scope class
|
1525
2049
|
attach_function :is_a_dbg_declare_inst, :LLVMIsADbgDeclareInst, [OpaqueValue], OpaqueValue
|
1526
2050
|
|
1527
|
-
#
|
1528
|
-
#
|
1529
|
-
# @method is_aeh_exception_inst(val)
|
1530
|
-
# @param [OpaqueValue] val
|
1531
|
-
# @return [OpaqueValue]
|
1532
|
-
# @scope class
|
1533
|
-
attach_function :is_aeh_exception_inst, :LLVMIsAEHExceptionInst, [OpaqueValue], OpaqueValue
|
1534
|
-
|
1535
|
-
# (Not documented)
|
1536
|
-
#
|
1537
|
-
# @method is_aeh_selector_inst(val)
|
1538
|
-
# @param [OpaqueValue] val
|
1539
|
-
# @return [OpaqueValue]
|
1540
|
-
# @scope class
|
1541
|
-
attach_function :is_aeh_selector_inst, :LLVMIsAEHSelectorInst, [OpaqueValue], OpaqueValue
|
1542
|
-
|
1543
|
-
# (Not documented)
|
2051
|
+
# @}
|
1544
2052
|
#
|
1545
2053
|
# @method is_a_mem_intrinsic(val)
|
1546
2054
|
# @param [OpaqueValue] val
|
@@ -1548,7 +2056,7 @@ module RLTK::CG::Bindings
|
|
1548
2056
|
# @scope class
|
1549
2057
|
attach_function :is_a_mem_intrinsic, :LLVMIsAMemIntrinsic, [OpaqueValue], OpaqueValue
|
1550
2058
|
|
1551
|
-
#
|
2059
|
+
# @}
|
1552
2060
|
#
|
1553
2061
|
# @method is_a_mem_cpy_inst(val)
|
1554
2062
|
# @param [OpaqueValue] val
|
@@ -1556,7 +2064,7 @@ module RLTK::CG::Bindings
|
|
1556
2064
|
# @scope class
|
1557
2065
|
attach_function :is_a_mem_cpy_inst, :LLVMIsAMemCpyInst, [OpaqueValue], OpaqueValue
|
1558
2066
|
|
1559
|
-
#
|
2067
|
+
# @}
|
1560
2068
|
#
|
1561
2069
|
# @method is_a_mem_move_inst(val)
|
1562
2070
|
# @param [OpaqueValue] val
|
@@ -1564,7 +2072,7 @@ module RLTK::CG::Bindings
|
|
1564
2072
|
# @scope class
|
1565
2073
|
attach_function :is_a_mem_move_inst, :LLVMIsAMemMoveInst, [OpaqueValue], OpaqueValue
|
1566
2074
|
|
1567
|
-
#
|
2075
|
+
# @}
|
1568
2076
|
#
|
1569
2077
|
# @method is_a_mem_set_inst(val)
|
1570
2078
|
# @param [OpaqueValue] val
|
@@ -1572,7 +2080,7 @@ module RLTK::CG::Bindings
|
|
1572
2080
|
# @scope class
|
1573
2081
|
attach_function :is_a_mem_set_inst, :LLVMIsAMemSetInst, [OpaqueValue], OpaqueValue
|
1574
2082
|
|
1575
|
-
#
|
2083
|
+
# @}
|
1576
2084
|
#
|
1577
2085
|
# @method is_a_cmp_inst(val)
|
1578
2086
|
# @param [OpaqueValue] val
|
@@ -1580,7 +2088,7 @@ module RLTK::CG::Bindings
|
|
1580
2088
|
# @scope class
|
1581
2089
|
attach_function :is_a_cmp_inst, :LLVMIsACmpInst, [OpaqueValue], OpaqueValue
|
1582
2090
|
|
1583
|
-
#
|
2091
|
+
# @}
|
1584
2092
|
#
|
1585
2093
|
# @method is_af_cmp_inst(val)
|
1586
2094
|
# @param [OpaqueValue] val
|
@@ -1588,7 +2096,7 @@ module RLTK::CG::Bindings
|
|
1588
2096
|
# @scope class
|
1589
2097
|
attach_function :is_af_cmp_inst, :LLVMIsAFCmpInst, [OpaqueValue], OpaqueValue
|
1590
2098
|
|
1591
|
-
#
|
2099
|
+
# @}
|
1592
2100
|
#
|
1593
2101
|
# @method is_ai_cmp_inst(val)
|
1594
2102
|
# @param [OpaqueValue] val
|
@@ -1596,7 +2104,7 @@ module RLTK::CG::Bindings
|
|
1596
2104
|
# @scope class
|
1597
2105
|
attach_function :is_ai_cmp_inst, :LLVMIsAICmpInst, [OpaqueValue], OpaqueValue
|
1598
2106
|
|
1599
|
-
#
|
2107
|
+
# @}
|
1600
2108
|
#
|
1601
2109
|
# @method is_a_extract_element_inst(val)
|
1602
2110
|
# @param [OpaqueValue] val
|
@@ -1604,7 +2112,7 @@ module RLTK::CG::Bindings
|
|
1604
2112
|
# @scope class
|
1605
2113
|
attach_function :is_a_extract_element_inst, :LLVMIsAExtractElementInst, [OpaqueValue], OpaqueValue
|
1606
2114
|
|
1607
|
-
#
|
2115
|
+
# @}
|
1608
2116
|
#
|
1609
2117
|
# @method is_a_get_element_ptr_inst(val)
|
1610
2118
|
# @param [OpaqueValue] val
|
@@ -1612,7 +2120,7 @@ module RLTK::CG::Bindings
|
|
1612
2120
|
# @scope class
|
1613
2121
|
attach_function :is_a_get_element_ptr_inst, :LLVMIsAGetElementPtrInst, [OpaqueValue], OpaqueValue
|
1614
2122
|
|
1615
|
-
#
|
2123
|
+
# @}
|
1616
2124
|
#
|
1617
2125
|
# @method is_a_insert_element_inst(val)
|
1618
2126
|
# @param [OpaqueValue] val
|
@@ -1620,7 +2128,7 @@ module RLTK::CG::Bindings
|
|
1620
2128
|
# @scope class
|
1621
2129
|
attach_function :is_a_insert_element_inst, :LLVMIsAInsertElementInst, [OpaqueValue], OpaqueValue
|
1622
2130
|
|
1623
|
-
#
|
2131
|
+
# @}
|
1624
2132
|
#
|
1625
2133
|
# @method is_a_insert_value_inst(val)
|
1626
2134
|
# @param [OpaqueValue] val
|
@@ -1628,7 +2136,7 @@ module RLTK::CG::Bindings
|
|
1628
2136
|
# @scope class
|
1629
2137
|
attach_function :is_a_insert_value_inst, :LLVMIsAInsertValueInst, [OpaqueValue], OpaqueValue
|
1630
2138
|
|
1631
|
-
#
|
2139
|
+
# @}
|
1632
2140
|
#
|
1633
2141
|
# @method is_a_landing_pad_inst(val)
|
1634
2142
|
# @param [OpaqueValue] val
|
@@ -1636,7 +2144,7 @@ module RLTK::CG::Bindings
|
|
1636
2144
|
# @scope class
|
1637
2145
|
attach_function :is_a_landing_pad_inst, :LLVMIsALandingPadInst, [OpaqueValue], OpaqueValue
|
1638
2146
|
|
1639
|
-
#
|
2147
|
+
# @}
|
1640
2148
|
#
|
1641
2149
|
# @method is_aphi_node(val)
|
1642
2150
|
# @param [OpaqueValue] val
|
@@ -1644,7 +2152,7 @@ module RLTK::CG::Bindings
|
|
1644
2152
|
# @scope class
|
1645
2153
|
attach_function :is_aphi_node, :LLVMIsAPHINode, [OpaqueValue], OpaqueValue
|
1646
2154
|
|
1647
|
-
#
|
2155
|
+
# @}
|
1648
2156
|
#
|
1649
2157
|
# @method is_a_select_inst(val)
|
1650
2158
|
# @param [OpaqueValue] val
|
@@ -1652,7 +2160,7 @@ module RLTK::CG::Bindings
|
|
1652
2160
|
# @scope class
|
1653
2161
|
attach_function :is_a_select_inst, :LLVMIsASelectInst, [OpaqueValue], OpaqueValue
|
1654
2162
|
|
1655
|
-
#
|
2163
|
+
# @}
|
1656
2164
|
#
|
1657
2165
|
# @method is_a_shuffle_vector_inst(val)
|
1658
2166
|
# @param [OpaqueValue] val
|
@@ -1660,7 +2168,7 @@ module RLTK::CG::Bindings
|
|
1660
2168
|
# @scope class
|
1661
2169
|
attach_function :is_a_shuffle_vector_inst, :LLVMIsAShuffleVectorInst, [OpaqueValue], OpaqueValue
|
1662
2170
|
|
1663
|
-
#
|
2171
|
+
# @}
|
1664
2172
|
#
|
1665
2173
|
# @method is_a_store_inst(val)
|
1666
2174
|
# @param [OpaqueValue] val
|
@@ -1668,7 +2176,7 @@ module RLTK::CG::Bindings
|
|
1668
2176
|
# @scope class
|
1669
2177
|
attach_function :is_a_store_inst, :LLVMIsAStoreInst, [OpaqueValue], OpaqueValue
|
1670
2178
|
|
1671
|
-
#
|
2179
|
+
# @}
|
1672
2180
|
#
|
1673
2181
|
# @method is_a_terminator_inst(val)
|
1674
2182
|
# @param [OpaqueValue] val
|
@@ -1676,7 +2184,7 @@ module RLTK::CG::Bindings
|
|
1676
2184
|
# @scope class
|
1677
2185
|
attach_function :is_a_terminator_inst, :LLVMIsATerminatorInst, [OpaqueValue], OpaqueValue
|
1678
2186
|
|
1679
|
-
#
|
2187
|
+
# @}
|
1680
2188
|
#
|
1681
2189
|
# @method is_a_branch_inst(val)
|
1682
2190
|
# @param [OpaqueValue] val
|
@@ -1684,7 +2192,7 @@ module RLTK::CG::Bindings
|
|
1684
2192
|
# @scope class
|
1685
2193
|
attach_function :is_a_branch_inst, :LLVMIsABranchInst, [OpaqueValue], OpaqueValue
|
1686
2194
|
|
1687
|
-
#
|
2195
|
+
# @}
|
1688
2196
|
#
|
1689
2197
|
# @method is_a_indirect_br_inst(val)
|
1690
2198
|
# @param [OpaqueValue] val
|
@@ -1692,7 +2200,7 @@ module RLTK::CG::Bindings
|
|
1692
2200
|
# @scope class
|
1693
2201
|
attach_function :is_a_indirect_br_inst, :LLVMIsAIndirectBrInst, [OpaqueValue], OpaqueValue
|
1694
2202
|
|
1695
|
-
#
|
2203
|
+
# @}
|
1696
2204
|
#
|
1697
2205
|
# @method is_a_invoke_inst(val)
|
1698
2206
|
# @param [OpaqueValue] val
|
@@ -1700,7 +2208,7 @@ module RLTK::CG::Bindings
|
|
1700
2208
|
# @scope class
|
1701
2209
|
attach_function :is_a_invoke_inst, :LLVMIsAInvokeInst, [OpaqueValue], OpaqueValue
|
1702
2210
|
|
1703
|
-
#
|
2211
|
+
# @}
|
1704
2212
|
#
|
1705
2213
|
# @method is_a_return_inst(val)
|
1706
2214
|
# @param [OpaqueValue] val
|
@@ -1708,7 +2216,7 @@ module RLTK::CG::Bindings
|
|
1708
2216
|
# @scope class
|
1709
2217
|
attach_function :is_a_return_inst, :LLVMIsAReturnInst, [OpaqueValue], OpaqueValue
|
1710
2218
|
|
1711
|
-
#
|
2219
|
+
# @}
|
1712
2220
|
#
|
1713
2221
|
# @method is_a_switch_inst(val)
|
1714
2222
|
# @param [OpaqueValue] val
|
@@ -1716,7 +2224,7 @@ module RLTK::CG::Bindings
|
|
1716
2224
|
# @scope class
|
1717
2225
|
attach_function :is_a_switch_inst, :LLVMIsASwitchInst, [OpaqueValue], OpaqueValue
|
1718
2226
|
|
1719
|
-
#
|
2227
|
+
# @}
|
1720
2228
|
#
|
1721
2229
|
# @method is_a_unreachable_inst(val)
|
1722
2230
|
# @param [OpaqueValue] val
|
@@ -1724,7 +2232,7 @@ module RLTK::CG::Bindings
|
|
1724
2232
|
# @scope class
|
1725
2233
|
attach_function :is_a_unreachable_inst, :LLVMIsAUnreachableInst, [OpaqueValue], OpaqueValue
|
1726
2234
|
|
1727
|
-
#
|
2235
|
+
# @}
|
1728
2236
|
#
|
1729
2237
|
# @method is_a_resume_inst(val)
|
1730
2238
|
# @param [OpaqueValue] val
|
@@ -1732,7 +2240,7 @@ module RLTK::CG::Bindings
|
|
1732
2240
|
# @scope class
|
1733
2241
|
attach_function :is_a_resume_inst, :LLVMIsAResumeInst, [OpaqueValue], OpaqueValue
|
1734
2242
|
|
1735
|
-
#
|
2243
|
+
# @}
|
1736
2244
|
#
|
1737
2245
|
# @method is_a_unary_instruction(val)
|
1738
2246
|
# @param [OpaqueValue] val
|
@@ -1740,7 +2248,7 @@ module RLTK::CG::Bindings
|
|
1740
2248
|
# @scope class
|
1741
2249
|
attach_function :is_a_unary_instruction, :LLVMIsAUnaryInstruction, [OpaqueValue], OpaqueValue
|
1742
2250
|
|
1743
|
-
#
|
2251
|
+
# @}
|
1744
2252
|
#
|
1745
2253
|
# @method is_a_alloca_inst(val)
|
1746
2254
|
# @param [OpaqueValue] val
|
@@ -1748,7 +2256,7 @@ module RLTK::CG::Bindings
|
|
1748
2256
|
# @scope class
|
1749
2257
|
attach_function :is_a_alloca_inst, :LLVMIsAAllocaInst, [OpaqueValue], OpaqueValue
|
1750
2258
|
|
1751
|
-
#
|
2259
|
+
# @}
|
1752
2260
|
#
|
1753
2261
|
# @method is_a_cast_inst(val)
|
1754
2262
|
# @param [OpaqueValue] val
|
@@ -1756,7 +2264,15 @@ module RLTK::CG::Bindings
|
|
1756
2264
|
# @scope class
|
1757
2265
|
attach_function :is_a_cast_inst, :LLVMIsACastInst, [OpaqueValue], OpaqueValue
|
1758
2266
|
|
1759
|
-
#
|
2267
|
+
# @}
|
2268
|
+
#
|
2269
|
+
# @method is_a_addr_space_cast_inst(val)
|
2270
|
+
# @param [OpaqueValue] val
|
2271
|
+
# @return [OpaqueValue]
|
2272
|
+
# @scope class
|
2273
|
+
attach_function :is_a_addr_space_cast_inst, :LLVMIsAAddrSpaceCastInst, [OpaqueValue], OpaqueValue
|
2274
|
+
|
2275
|
+
# @}
|
1760
2276
|
#
|
1761
2277
|
# @method is_a_bit_cast_inst(val)
|
1762
2278
|
# @param [OpaqueValue] val
|
@@ -1764,7 +2280,7 @@ module RLTK::CG::Bindings
|
|
1764
2280
|
# @scope class
|
1765
2281
|
attach_function :is_a_bit_cast_inst, :LLVMIsABitCastInst, [OpaqueValue], OpaqueValue
|
1766
2282
|
|
1767
|
-
#
|
2283
|
+
# @}
|
1768
2284
|
#
|
1769
2285
|
# @method is_afp_ext_inst(val)
|
1770
2286
|
# @param [OpaqueValue] val
|
@@ -1772,7 +2288,7 @@ module RLTK::CG::Bindings
|
|
1772
2288
|
# @scope class
|
1773
2289
|
attach_function :is_afp_ext_inst, :LLVMIsAFPExtInst, [OpaqueValue], OpaqueValue
|
1774
2290
|
|
1775
|
-
#
|
2291
|
+
# @}
|
1776
2292
|
#
|
1777
2293
|
# @method is_afp_to_si_inst(val)
|
1778
2294
|
# @param [OpaqueValue] val
|
@@ -1780,7 +2296,7 @@ module RLTK::CG::Bindings
|
|
1780
2296
|
# @scope class
|
1781
2297
|
attach_function :is_afp_to_si_inst, :LLVMIsAFPToSIInst, [OpaqueValue], OpaqueValue
|
1782
2298
|
|
1783
|
-
#
|
2299
|
+
# @}
|
1784
2300
|
#
|
1785
2301
|
# @method is_afp_to_ui_inst(val)
|
1786
2302
|
# @param [OpaqueValue] val
|
@@ -1788,7 +2304,7 @@ module RLTK::CG::Bindings
|
|
1788
2304
|
# @scope class
|
1789
2305
|
attach_function :is_afp_to_ui_inst, :LLVMIsAFPToUIInst, [OpaqueValue], OpaqueValue
|
1790
2306
|
|
1791
|
-
#
|
2307
|
+
# @}
|
1792
2308
|
#
|
1793
2309
|
# @method is_afp_trunc_inst(val)
|
1794
2310
|
# @param [OpaqueValue] val
|
@@ -1796,7 +2312,7 @@ module RLTK::CG::Bindings
|
|
1796
2312
|
# @scope class
|
1797
2313
|
attach_function :is_afp_trunc_inst, :LLVMIsAFPTruncInst, [OpaqueValue], OpaqueValue
|
1798
2314
|
|
1799
|
-
#
|
2315
|
+
# @}
|
1800
2316
|
#
|
1801
2317
|
# @method is_a_int_to_ptr_inst(val)
|
1802
2318
|
# @param [OpaqueValue] val
|
@@ -1804,7 +2320,7 @@ module RLTK::CG::Bindings
|
|
1804
2320
|
# @scope class
|
1805
2321
|
attach_function :is_a_int_to_ptr_inst, :LLVMIsAIntToPtrInst, [OpaqueValue], OpaqueValue
|
1806
2322
|
|
1807
|
-
#
|
2323
|
+
# @}
|
1808
2324
|
#
|
1809
2325
|
# @method is_a_ptr_to_int_inst(val)
|
1810
2326
|
# @param [OpaqueValue] val
|
@@ -1812,7 +2328,7 @@ module RLTK::CG::Bindings
|
|
1812
2328
|
# @scope class
|
1813
2329
|
attach_function :is_a_ptr_to_int_inst, :LLVMIsAPtrToIntInst, [OpaqueValue], OpaqueValue
|
1814
2330
|
|
1815
|
-
#
|
2331
|
+
# @}
|
1816
2332
|
#
|
1817
2333
|
# @method is_as_ext_inst(val)
|
1818
2334
|
# @param [OpaqueValue] val
|
@@ -1820,7 +2336,7 @@ module RLTK::CG::Bindings
|
|
1820
2336
|
# @scope class
|
1821
2337
|
attach_function :is_as_ext_inst, :LLVMIsASExtInst, [OpaqueValue], OpaqueValue
|
1822
2338
|
|
1823
|
-
#
|
2339
|
+
# @}
|
1824
2340
|
#
|
1825
2341
|
# @method is_asi_to_fp_inst(val)
|
1826
2342
|
# @param [OpaqueValue] val
|
@@ -1828,7 +2344,7 @@ module RLTK::CG::Bindings
|
|
1828
2344
|
# @scope class
|
1829
2345
|
attach_function :is_asi_to_fp_inst, :LLVMIsASIToFPInst, [OpaqueValue], OpaqueValue
|
1830
2346
|
|
1831
|
-
#
|
2347
|
+
# @}
|
1832
2348
|
#
|
1833
2349
|
# @method is_a_trunc_inst(val)
|
1834
2350
|
# @param [OpaqueValue] val
|
@@ -1836,7 +2352,7 @@ module RLTK::CG::Bindings
|
|
1836
2352
|
# @scope class
|
1837
2353
|
attach_function :is_a_trunc_inst, :LLVMIsATruncInst, [OpaqueValue], OpaqueValue
|
1838
2354
|
|
1839
|
-
#
|
2355
|
+
# @}
|
1840
2356
|
#
|
1841
2357
|
# @method is_aui_to_fp_inst(val)
|
1842
2358
|
# @param [OpaqueValue] val
|
@@ -1844,7 +2360,7 @@ module RLTK::CG::Bindings
|
|
1844
2360
|
# @scope class
|
1845
2361
|
attach_function :is_aui_to_fp_inst, :LLVMIsAUIToFPInst, [OpaqueValue], OpaqueValue
|
1846
2362
|
|
1847
|
-
#
|
2363
|
+
# @}
|
1848
2364
|
#
|
1849
2365
|
# @method is_az_ext_inst(val)
|
1850
2366
|
# @param [OpaqueValue] val
|
@@ -1852,7 +2368,7 @@ module RLTK::CG::Bindings
|
|
1852
2368
|
# @scope class
|
1853
2369
|
attach_function :is_az_ext_inst, :LLVMIsAZExtInst, [OpaqueValue], OpaqueValue
|
1854
2370
|
|
1855
|
-
#
|
2371
|
+
# @}
|
1856
2372
|
#
|
1857
2373
|
# @method is_a_extract_value_inst(val)
|
1858
2374
|
# @param [OpaqueValue] val
|
@@ -1860,7 +2376,7 @@ module RLTK::CG::Bindings
|
|
1860
2376
|
# @scope class
|
1861
2377
|
attach_function :is_a_extract_value_inst, :LLVMIsAExtractValueInst, [OpaqueValue], OpaqueValue
|
1862
2378
|
|
1863
|
-
#
|
2379
|
+
# @}
|
1864
2380
|
#
|
1865
2381
|
# @method is_a_load_inst(val)
|
1866
2382
|
# @param [OpaqueValue] val
|
@@ -1868,7 +2384,7 @@ module RLTK::CG::Bindings
|
|
1868
2384
|
# @scope class
|
1869
2385
|
attach_function :is_a_load_inst, :LLVMIsALoadInst, [OpaqueValue], OpaqueValue
|
1870
2386
|
|
1871
|
-
#
|
2387
|
+
# @}
|
1872
2388
|
#
|
1873
2389
|
# @method is_ava_arg_inst(val)
|
1874
2390
|
# @param [OpaqueValue] val
|
@@ -1876,7 +2392,14 @@ module RLTK::CG::Bindings
|
|
1876
2392
|
# @scope class
|
1877
2393
|
attach_function :is_ava_arg_inst, :LLVMIsAVAArgInst, [OpaqueValue], OpaqueValue
|
1878
2394
|
|
1879
|
-
#
|
2395
|
+
# Obtain the first use of a value.
|
2396
|
+
#
|
2397
|
+
# Uses are obtained in an iterator fashion. First, call this function
|
2398
|
+
# to obtain a reference to the first use. Then, call LLVMGetNextUse()
|
2399
|
+
# on that instance and all subsequently obtained instances until
|
2400
|
+
# LLVMGetNextUse() returns NULL.
|
2401
|
+
#
|
2402
|
+
# @see llvm::Value::use_begin()
|
1880
2403
|
#
|
1881
2404
|
# @method get_first_use(val)
|
1882
2405
|
# @param [OpaqueValue] val
|
@@ -1884,7 +2407,10 @@ module RLTK::CG::Bindings
|
|
1884
2407
|
# @scope class
|
1885
2408
|
attach_function :get_first_use, :LLVMGetFirstUse, [OpaqueValue], OpaqueUse
|
1886
2409
|
|
1887
|
-
#
|
2410
|
+
# Obtain the next use of a value.
|
2411
|
+
#
|
2412
|
+
# This effectively advances the iterator. It returns NULL if you are on
|
2413
|
+
# the final use and no more are available.
|
1888
2414
|
#
|
1889
2415
|
# @method get_next_use(u)
|
1890
2416
|
# @param [OpaqueUse] u
|
@@ -1892,7 +2418,11 @@ module RLTK::CG::Bindings
|
|
1892
2418
|
# @scope class
|
1893
2419
|
attach_function :get_next_use, :LLVMGetNextUse, [OpaqueUse], OpaqueUse
|
1894
2420
|
|
1895
|
-
#
|
2421
|
+
# Obtain the user value for a user.
|
2422
|
+
#
|
2423
|
+
# The returned value corresponds to a llvm::User type.
|
2424
|
+
#
|
2425
|
+
# @see llvm::Use::getUser()
|
1896
2426
|
#
|
1897
2427
|
# @method get_user(u)
|
1898
2428
|
# @param [OpaqueUse] u
|
@@ -1900,7 +2430,9 @@ module RLTK::CG::Bindings
|
|
1900
2430
|
# @scope class
|
1901
2431
|
attach_function :get_user, :LLVMGetUser, [OpaqueUse], OpaqueValue
|
1902
2432
|
|
1903
|
-
#
|
2433
|
+
# Obtain the value this use corresponds to.
|
2434
|
+
#
|
2435
|
+
# @see llvm::Use::get().
|
1904
2436
|
#
|
1905
2437
|
# @method get_used_value(u)
|
1906
2438
|
# @param [OpaqueUse] u
|
@@ -1908,7 +2440,9 @@ module RLTK::CG::Bindings
|
|
1908
2440
|
# @scope class
|
1909
2441
|
attach_function :get_used_value, :LLVMGetUsedValue, [OpaqueUse], OpaqueValue
|
1910
2442
|
|
1911
|
-
#
|
2443
|
+
# Obtain an operand at a specific index in a llvm::User value.
|
2444
|
+
#
|
2445
|
+
# @see llvm::User::getOperand()
|
1912
2446
|
#
|
1913
2447
|
# @method get_operand(val, index)
|
1914
2448
|
# @param [OpaqueValue] val
|
@@ -1917,7 +2451,9 @@ module RLTK::CG::Bindings
|
|
1917
2451
|
# @scope class
|
1918
2452
|
attach_function :get_operand, :LLVMGetOperand, [OpaqueValue, :uint], OpaqueValue
|
1919
2453
|
|
1920
|
-
#
|
2454
|
+
# Set an operand at a specific index in a llvm::User value.
|
2455
|
+
#
|
2456
|
+
# @see llvm::User::setOperand()
|
1921
2457
|
#
|
1922
2458
|
# @method set_operand(user, index, val)
|
1923
2459
|
# @param [OpaqueValue] user
|
@@ -1927,7 +2463,9 @@ module RLTK::CG::Bindings
|
|
1927
2463
|
# @scope class
|
1928
2464
|
attach_function :set_operand, :LLVMSetOperand, [OpaqueValue, :uint, OpaqueValue], :void
|
1929
2465
|
|
1930
|
-
#
|
2466
|
+
# Obtain the number of operands in a llvm::User value.
|
2467
|
+
#
|
2468
|
+
# @see llvm::User::getNumOperands()
|
1931
2469
|
#
|
1932
2470
|
# @method get_num_operands(val)
|
1933
2471
|
# @param [OpaqueValue] val
|
@@ -1935,7 +2473,9 @@ module RLTK::CG::Bindings
|
|
1935
2473
|
# @scope class
|
1936
2474
|
attach_function :get_num_operands, :LLVMGetNumOperands, [OpaqueValue], :int
|
1937
2475
|
|
1938
|
-
#
|
2476
|
+
# Obtain a constant value referring to the null instance of a type.
|
2477
|
+
#
|
2478
|
+
# @see llvm::Constant::getNullValue()
|
1939
2479
|
#
|
1940
2480
|
# @method const_null(ty)
|
1941
2481
|
# @param [OpaqueType] ty
|
@@ -1943,7 +2483,12 @@ module RLTK::CG::Bindings
|
|
1943
2483
|
# @scope class
|
1944
2484
|
attach_function :const_null, :LLVMConstNull, [OpaqueType], OpaqueValue
|
1945
2485
|
|
1946
|
-
#
|
2486
|
+
# Obtain a constant value referring to the instance of a type
|
2487
|
+
# consisting of all ones.
|
2488
|
+
#
|
2489
|
+
# This is only valid for integer types.
|
2490
|
+
#
|
2491
|
+
# @see llvm::Constant::getAllOnesValue()
|
1947
2492
|
#
|
1948
2493
|
# @method const_all_ones(ty)
|
1949
2494
|
# @param [OpaqueType] ty
|
@@ -1951,7 +2496,9 @@ module RLTK::CG::Bindings
|
|
1951
2496
|
# @scope class
|
1952
2497
|
attach_function :const_all_ones, :LLVMConstAllOnes, [OpaqueType], OpaqueValue
|
1953
2498
|
|
1954
|
-
#
|
2499
|
+
# Obtain a constant value referring to an undefined value of a type.
|
2500
|
+
#
|
2501
|
+
# @see llvm::UndefValue::get()
|
1955
2502
|
#
|
1956
2503
|
# @method get_undef(ty)
|
1957
2504
|
# @param [OpaqueType] ty
|
@@ -1959,15 +2506,9 @@ module RLTK::CG::Bindings
|
|
1959
2506
|
# @scope class
|
1960
2507
|
attach_function :get_undef, :LLVMGetUndef, [OpaqueType], OpaqueValue
|
1961
2508
|
|
1962
|
-
#
|
2509
|
+
# Determine whether a value instance is null.
|
1963
2510
|
#
|
1964
|
-
# @
|
1965
|
-
# @param [OpaqueValue] val
|
1966
|
-
# @return [Integer]
|
1967
|
-
# @scope class
|
1968
|
-
attach_function :is_constant, :LLVMIsConstant, [OpaqueValue], :int
|
1969
|
-
|
1970
|
-
# (Not documented)
|
2511
|
+
# @see llvm::Constant::isNullValue()
|
1971
2512
|
#
|
1972
2513
|
# @method is_null(val)
|
1973
2514
|
# @param [OpaqueValue] val
|
@@ -1975,15 +2516,8 @@ module RLTK::CG::Bindings
|
|
1975
2516
|
# @scope class
|
1976
2517
|
attach_function :is_null, :LLVMIsNull, [OpaqueValue], :int
|
1977
2518
|
|
1978
|
-
#
|
1979
|
-
#
|
1980
|
-
# @method is_undef(val)
|
1981
|
-
# @param [OpaqueValue] val
|
1982
|
-
# @return [Integer]
|
1983
|
-
# @scope class
|
1984
|
-
attach_function :is_undef, :LLVMIsUndef, [OpaqueValue], :int
|
1985
|
-
|
1986
|
-
# (Not documented)
|
2519
|
+
# Obtain a constant that is a constant pointer pointing to NULL for a
|
2520
|
+
# specified type.
|
1987
2521
|
#
|
1988
2522
|
# @method const_pointer_null(ty)
|
1989
2523
|
# @param [OpaqueType] ty
|
@@ -1991,110 +2525,43 @@ module RLTK::CG::Bindings
|
|
1991
2525
|
# @scope class
|
1992
2526
|
attach_function :const_pointer_null, :LLVMConstPointerNull, [OpaqueType], OpaqueValue
|
1993
2527
|
|
1994
|
-
#
|
2528
|
+
# Obtain a constant value for an integer type.
|
1995
2529
|
#
|
1996
|
-
#
|
1997
|
-
#
|
1998
|
-
# @
|
1999
|
-
#
|
2530
|
+
# The returned value corresponds to a llvm::ConstantInt.
|
2531
|
+
#
|
2532
|
+
# @see llvm::ConstantInt::get()
|
2533
|
+
#
|
2534
|
+
# @param IntTy Integer type to obtain value of.
|
2535
|
+
# @param N The value the returned instance should refer to.
|
2536
|
+
# @param SignExtend Whether to sign extend the produced value.
|
2537
|
+
#
|
2538
|
+
# @method const_int(int_ty, n, sign_extend)
|
2539
|
+
# @param [OpaqueType] int_ty
|
2540
|
+
# @param [Integer] n
|
2541
|
+
# @param [Integer] sign_extend
|
2000
2542
|
# @return [OpaqueValue]
|
2001
2543
|
# @scope class
|
2002
|
-
attach_function :
|
2544
|
+
attach_function :const_int, :LLVMConstInt, [OpaqueType, :ulong_long, :int], OpaqueValue
|
2003
2545
|
|
2004
|
-
#
|
2546
|
+
# Obtain a constant value for an integer of arbitrary precision.
|
2005
2547
|
#
|
2006
|
-
# @
|
2007
|
-
# @param [String] str
|
2008
|
-
# @param [Integer] s_len
|
2009
|
-
# @return [OpaqueValue]
|
2010
|
-
# @scope class
|
2011
|
-
attach_function :md_string, :LLVMMDString, [:string, :uint], OpaqueValue
|
2012
|
-
|
2013
|
-
# (Not documented)
|
2014
|
-
#
|
2015
|
-
# @method md_node_in_context(c, vals, count)
|
2016
|
-
# @param [OpaqueContext] c
|
2017
|
-
# @param [FFI::Pointer(*ValueRef)] vals
|
2018
|
-
# @param [Integer] count
|
2019
|
-
# @return [OpaqueValue]
|
2020
|
-
# @scope class
|
2021
|
-
attach_function :md_node_in_context, :LLVMMDNodeInContext, [OpaqueContext, :pointer, :uint], OpaqueValue
|
2022
|
-
|
2023
|
-
# (Not documented)
|
2024
|
-
#
|
2025
|
-
# @method md_node(vals, count)
|
2026
|
-
# @param [FFI::Pointer(*ValueRef)] vals
|
2027
|
-
# @param [Integer] count
|
2028
|
-
# @return [OpaqueValue]
|
2029
|
-
# @scope class
|
2030
|
-
attach_function :md_node, :LLVMMDNode, [:pointer, :uint], OpaqueValue
|
2031
|
-
|
2032
|
-
# (Not documented)
|
2033
|
-
#
|
2034
|
-
# @method get_md_string(v, len)
|
2035
|
-
# @param [OpaqueValue] v
|
2036
|
-
# @param [FFI::Pointer(*UInt)] len
|
2037
|
-
# @return [String]
|
2038
|
-
# @scope class
|
2039
|
-
attach_function :get_md_string, :LLVMGetMDString, [OpaqueValue, :pointer], :string
|
2040
|
-
|
2041
|
-
# (Not documented)
|
2042
|
-
#
|
2043
|
-
# @method get_md_node_num_operands(v)
|
2044
|
-
# @param [OpaqueValue] v
|
2045
|
-
# @return [Integer]
|
2046
|
-
# @scope class
|
2047
|
-
attach_function :get_md_node_num_operands, :LLVMGetMDNodeNumOperands, [OpaqueValue], :int
|
2048
|
-
|
2049
|
-
# (Not documented)
|
2050
|
-
#
|
2051
|
-
# @method get_md_node_operand(v, i)
|
2052
|
-
# @param [OpaqueValue] v
|
2053
|
-
# @param [Integer] i
|
2054
|
-
# @return [FFI::Pointer(*ValueRef)]
|
2055
|
-
# @scope class
|
2056
|
-
attach_function :get_md_node_operand, :LLVMGetMDNodeOperand, [OpaqueValue, :uint], :pointer
|
2057
|
-
|
2058
|
-
# (Not documented)
|
2059
|
-
#
|
2060
|
-
# @method get_named_metadata_num_operands(m, name)
|
2061
|
-
# @param [OpaqueModule] m
|
2062
|
-
# @param [String] name
|
2063
|
-
# @return [Integer]
|
2064
|
-
# @scope class
|
2065
|
-
attach_function :get_named_metadata_num_operands, :LLVMGetNamedMetadataNumOperands, [OpaqueModule, :string], :uint
|
2066
|
-
|
2067
|
-
# (Not documented)
|
2068
|
-
#
|
2069
|
-
# @method get_named_metadata_operands(m, name, dest)
|
2070
|
-
# @param [OpaqueModule] m
|
2071
|
-
# @param [String] name
|
2072
|
-
# @param [FFI::Pointer(*ValueRef)] dest
|
2073
|
-
# @return [nil]
|
2074
|
-
# @scope class
|
2075
|
-
attach_function :get_named_metadata_operands, :LLVMGetNamedMetadataOperands, [OpaqueModule, :string, :pointer], :void
|
2076
|
-
|
2077
|
-
# Operations on scalar constants
|
2078
|
-
#
|
2079
|
-
# @method const_int(int_ty, n, sign_extend)
|
2080
|
-
# @param [OpaqueType] int_ty
|
2081
|
-
# @param [Integer] n
|
2082
|
-
# @param [Integer] sign_extend
|
2083
|
-
# @return [OpaqueValue]
|
2084
|
-
# @scope class
|
2085
|
-
attach_function :const_int, :LLVMConstInt, [OpaqueType, :ulong_long, :int], OpaqueValue
|
2086
|
-
|
2087
|
-
# (Not documented)
|
2548
|
+
# @see llvm::ConstantInt::get()
|
2088
2549
|
#
|
2089
2550
|
# @method const_int_of_arbitrary_precision(int_ty, num_words, words)
|
2090
2551
|
# @param [OpaqueType] int_ty
|
2091
2552
|
# @param [Integer] num_words
|
2092
|
-
# @param [
|
2553
|
+
# @param [unexposed] words
|
2093
2554
|
# @return [OpaqueValue]
|
2094
2555
|
# @scope class
|
2095
|
-
attach_function :const_int_of_arbitrary_precision, :LLVMConstIntOfArbitraryPrecision, [OpaqueType, :uint, :
|
2556
|
+
attach_function :const_int_of_arbitrary_precision, :LLVMConstIntOfArbitraryPrecision, [OpaqueType, :uint, :char], OpaqueValue
|
2096
2557
|
|
2097
|
-
#
|
2558
|
+
# Obtain a constant value for an integer parsed from a string.
|
2559
|
+
#
|
2560
|
+
# A similar API, LLVMConstIntOfStringAndSize is also available. If the
|
2561
|
+
# string's length is available, it is preferred to call that function
|
2562
|
+
# instead.
|
2563
|
+
#
|
2564
|
+
# @see llvm::ConstantInt::get()
|
2098
2565
|
#
|
2099
2566
|
# @method const_int_of_string(int_ty, text, radix)
|
2100
2567
|
# @param [OpaqueType] int_ty
|
@@ -2104,7 +2571,10 @@ module RLTK::CG::Bindings
|
|
2104
2571
|
# @scope class
|
2105
2572
|
attach_function :const_int_of_string, :LLVMConstIntOfString, [OpaqueType, :string, :uchar], OpaqueValue
|
2106
2573
|
|
2107
|
-
#
|
2574
|
+
# Obtain a constant value for an integer parsed from a string with
|
2575
|
+
# specified length.
|
2576
|
+
#
|
2577
|
+
# @see llvm::ConstantInt::get()
|
2108
2578
|
#
|
2109
2579
|
# @method const_int_of_string_and_size(int_ty, text, s_len, radix)
|
2110
2580
|
# @param [OpaqueType] int_ty
|
@@ -2115,7 +2585,7 @@ module RLTK::CG::Bindings
|
|
2115
2585
|
# @scope class
|
2116
2586
|
attach_function :const_int_of_string_and_size, :LLVMConstIntOfStringAndSize, [OpaqueType, :string, :uint, :uchar], OpaqueValue
|
2117
2587
|
|
2118
|
-
#
|
2588
|
+
# Obtain a constant value referring to a double floating point value.
|
2119
2589
|
#
|
2120
2590
|
# @method const_real(real_ty, n)
|
2121
2591
|
# @param [OpaqueType] real_ty
|
@@ -2124,7 +2594,10 @@ module RLTK::CG::Bindings
|
|
2124
2594
|
# @scope class
|
2125
2595
|
attach_function :const_real, :LLVMConstReal, [OpaqueType, :double], OpaqueValue
|
2126
2596
|
|
2127
|
-
#
|
2597
|
+
# Obtain a constant for a floating point value parsed from a string.
|
2598
|
+
#
|
2599
|
+
# A similar API, LLVMConstRealOfStringAndSize is also available. It
|
2600
|
+
# should be used if the input string's length is known.
|
2128
2601
|
#
|
2129
2602
|
# @method const_real_of_string(real_ty, text)
|
2130
2603
|
# @param [OpaqueType] real_ty
|
@@ -2133,7 +2606,7 @@ module RLTK::CG::Bindings
|
|
2133
2606
|
# @scope class
|
2134
2607
|
attach_function :const_real_of_string, :LLVMConstRealOfString, [OpaqueType, :string], OpaqueValue
|
2135
2608
|
|
2136
|
-
#
|
2609
|
+
# Obtain a constant for a floating point value parsed from a string.
|
2137
2610
|
#
|
2138
2611
|
# @method const_real_of_string_and_size(real_ty, text, s_len)
|
2139
2612
|
# @param [OpaqueType] real_ty
|
@@ -2143,7 +2616,9 @@ module RLTK::CG::Bindings
|
|
2143
2616
|
# @scope class
|
2144
2617
|
attach_function :const_real_of_string_and_size, :LLVMConstRealOfStringAndSize, [OpaqueType, :string, :uint], OpaqueValue
|
2145
2618
|
|
2146
|
-
#
|
2619
|
+
# Obtain the zero extended value for an integer constant value.
|
2620
|
+
#
|
2621
|
+
# @see llvm::ConstantInt::getZExtValue()
|
2147
2622
|
#
|
2148
2623
|
# @method const_int_get_z_ext_value(constant_val)
|
2149
2624
|
# @param [OpaqueValue] constant_val
|
@@ -2151,7 +2626,9 @@ module RLTK::CG::Bindings
|
|
2151
2626
|
# @scope class
|
2152
2627
|
attach_function :const_int_get_z_ext_value, :LLVMConstIntGetZExtValue, [OpaqueValue], :ulong_long
|
2153
2628
|
|
2154
|
-
#
|
2629
|
+
# Obtain the sign extended value for an integer constant value.
|
2630
|
+
#
|
2631
|
+
# @see llvm::ConstantInt::getSExtValue()
|
2155
2632
|
#
|
2156
2633
|
# @method const_int_get_s_ext_value(constant_val)
|
2157
2634
|
# @param [OpaqueValue] constant_val
|
@@ -2159,7 +2636,9 @@ module RLTK::CG::Bindings
|
|
2159
2636
|
# @scope class
|
2160
2637
|
attach_function :const_int_get_s_ext_value, :LLVMConstIntGetSExtValue, [OpaqueValue], :long_long
|
2161
2638
|
|
2162
|
-
#
|
2639
|
+
# Create a ConstantDataSequential and initialize it with a string.
|
2640
|
+
#
|
2641
|
+
# @see llvm::ConstantDataArray::getString()
|
2163
2642
|
#
|
2164
2643
|
# @method const_string_in_context(c, str, length, dont_null_terminate)
|
2165
2644
|
# @param [OpaqueContext] c
|
@@ -2170,18 +2649,13 @@ module RLTK::CG::Bindings
|
|
2170
2649
|
# @scope class
|
2171
2650
|
attach_function :const_string_in_context, :LLVMConstStringInContext, [OpaqueContext, :string, :uint, :int], OpaqueValue
|
2172
2651
|
|
2173
|
-
#
|
2652
|
+
# Create a ConstantDataSequential with string content in the global context.
|
2174
2653
|
#
|
2175
|
-
#
|
2176
|
-
#
|
2177
|
-
#
|
2178
|
-
# @
|
2179
|
-
# @
|
2180
|
-
# @return [OpaqueValue]
|
2181
|
-
# @scope class
|
2182
|
-
attach_function :const_struct_in_context, :LLVMConstStructInContext, [OpaqueContext, :pointer, :uint, :int], OpaqueValue
|
2183
|
-
|
2184
|
-
# (Not documented)
|
2654
|
+
# This is the same as LLVMConstStringInContext except it operates on the
|
2655
|
+
# global context.
|
2656
|
+
#
|
2657
|
+
# @see LLVMConstStringInContext()
|
2658
|
+
# @see llvm::ConstantDataArray::getString()
|
2185
2659
|
#
|
2186
2660
|
# @method const_string(str, length, dont_null_terminate)
|
2187
2661
|
# @param [String] str
|
@@ -2191,17 +2665,25 @@ module RLTK::CG::Bindings
|
|
2191
2665
|
# @scope class
|
2192
2666
|
attach_function :const_string, :LLVMConstString, [:string, :uint, :int], OpaqueValue
|
2193
2667
|
|
2194
|
-
#
|
2668
|
+
# Create an anonymous ConstantStruct with the specified values.
|
2195
2669
|
#
|
2196
|
-
# @
|
2197
|
-
#
|
2670
|
+
# @see llvm::ConstantStruct::getAnon()
|
2671
|
+
#
|
2672
|
+
# @method const_struct_in_context(c, constant_vals, count, packed)
|
2673
|
+
# @param [OpaqueContext] c
|
2198
2674
|
# @param [FFI::Pointer(*ValueRef)] constant_vals
|
2199
|
-
# @param [Integer]
|
2675
|
+
# @param [Integer] count
|
2676
|
+
# @param [Integer] packed
|
2200
2677
|
# @return [OpaqueValue]
|
2201
2678
|
# @scope class
|
2202
|
-
attach_function :
|
2679
|
+
attach_function :const_struct_in_context, :LLVMConstStructInContext, [OpaqueContext, :pointer, :uint, :int], OpaqueValue
|
2203
2680
|
|
2204
|
-
#
|
2681
|
+
# Create a ConstantStruct in the global Context.
|
2682
|
+
#
|
2683
|
+
# This is the same as LLVMConstStructInContext except it operates on the
|
2684
|
+
# global Context.
|
2685
|
+
#
|
2686
|
+
# @see LLVMConstStructInContext()
|
2205
2687
|
#
|
2206
2688
|
# @method const_struct(constant_vals, count, packed)
|
2207
2689
|
# @param [FFI::Pointer(*ValueRef)] constant_vals
|
@@ -2211,7 +2693,21 @@ module RLTK::CG::Bindings
|
|
2211
2693
|
# @scope class
|
2212
2694
|
attach_function :const_struct, :LLVMConstStruct, [:pointer, :uint, :int], OpaqueValue
|
2213
2695
|
|
2214
|
-
#
|
2696
|
+
# Create a ConstantArray from values.
|
2697
|
+
#
|
2698
|
+
# @see llvm::ConstantArray::get()
|
2699
|
+
#
|
2700
|
+
# @method const_array(element_ty, constant_vals, length)
|
2701
|
+
# @param [OpaqueType] element_ty
|
2702
|
+
# @param [FFI::Pointer(*ValueRef)] constant_vals
|
2703
|
+
# @param [Integer] length
|
2704
|
+
# @return [OpaqueValue]
|
2705
|
+
# @scope class
|
2706
|
+
attach_function :const_array, :LLVMConstArray, [OpaqueType, :pointer, :uint], OpaqueValue
|
2707
|
+
|
2708
|
+
# Create a non-anonymous ConstantStruct from values.
|
2709
|
+
#
|
2710
|
+
# @see llvm::ConstantStruct::get()
|
2215
2711
|
#
|
2216
2712
|
# @method const_named_struct(struct_ty, constant_vals, count)
|
2217
2713
|
# @param [OpaqueType] struct_ty
|
@@ -2221,7 +2717,9 @@ module RLTK::CG::Bindings
|
|
2221
2717
|
# @scope class
|
2222
2718
|
attach_function :const_named_struct, :LLVMConstNamedStruct, [OpaqueType, :pointer, :uint], OpaqueValue
|
2223
2719
|
|
2224
|
-
#
|
2720
|
+
# Create a ConstantVector from values.
|
2721
|
+
#
|
2722
|
+
# @see llvm::ConstantVector::get()
|
2225
2723
|
#
|
2226
2724
|
# @method const_vector(scalar_constant_vals, size)
|
2227
2725
|
# @param [FFI::Pointer(*ValueRef)] scalar_constant_vals
|
@@ -2230,7 +2728,13 @@ module RLTK::CG::Bindings
|
|
2230
2728
|
# @scope class
|
2231
2729
|
attach_function :const_vector, :LLVMConstVector, [:pointer, :uint], OpaqueValue
|
2232
2730
|
|
2233
|
-
# Constant
|
2731
|
+
# @defgroup LLVMCCoreValueConstantExpressions Constant Expressions
|
2732
|
+
#
|
2733
|
+
# Functions in this group correspond to APIs on llvm::ConstantExpr.
|
2734
|
+
#
|
2735
|
+
# @see llvm::ConstantExpr.
|
2736
|
+
#
|
2737
|
+
# @{
|
2234
2738
|
#
|
2235
2739
|
# @method get_const_opcode(constant_val)
|
2236
2740
|
# @param [OpaqueValue] constant_val
|
@@ -2667,6 +3171,15 @@ module RLTK::CG::Bindings
|
|
2667
3171
|
# @scope class
|
2668
3172
|
attach_function :const_bit_cast, :LLVMConstBitCast, [OpaqueValue, OpaqueType], OpaqueValue
|
2669
3173
|
|
3174
|
+
# (Not documented)
|
3175
|
+
#
|
3176
|
+
# @method const_addr_space_cast(constant_val, to_type)
|
3177
|
+
# @param [OpaqueValue] constant_val
|
3178
|
+
# @param [OpaqueType] to_type
|
3179
|
+
# @return [OpaqueValue]
|
3180
|
+
# @scope class
|
3181
|
+
attach_function :const_addr_space_cast, :LLVMConstAddrSpaceCast, [OpaqueValue, OpaqueType], OpaqueValue
|
3182
|
+
|
2670
3183
|
# (Not documented)
|
2671
3184
|
#
|
2672
3185
|
# @method const_z_ext_or_bit_cast(constant_val, to_type)
|
@@ -2803,7 +3316,14 @@ module RLTK::CG::Bindings
|
|
2803
3316
|
# @scope class
|
2804
3317
|
attach_function :block_address, :LLVMBlockAddress, [OpaqueValue, OpaqueBasicBlock], OpaqueValue
|
2805
3318
|
|
2806
|
-
#
|
3319
|
+
# @defgroup LLVMCCoreValueConstantGlobals Global Values
|
3320
|
+
#
|
3321
|
+
# This group contains functions that operate on global values. Functions in
|
3322
|
+
# this group relate to functions in the llvm::GlobalValue class tree.
|
3323
|
+
#
|
3324
|
+
# @see llvm::GlobalValue
|
3325
|
+
#
|
3326
|
+
# @{
|
2807
3327
|
#
|
2808
3328
|
# @method get_global_parent(global)
|
2809
3329
|
# @param [OpaqueValue] global
|
@@ -2870,24 +3390,36 @@ module RLTK::CG::Bindings
|
|
2870
3390
|
# @scope class
|
2871
3391
|
attach_function :set_visibility, :LLVMSetVisibility, [OpaqueValue, :visibility], :void
|
2872
3392
|
|
2873
|
-
#
|
3393
|
+
# Obtain the preferred alignment of the value.
|
3394
|
+
# @see llvm::LoadInst::getAlignment()
|
3395
|
+
# @see llvm::StoreInst::getAlignment()
|
3396
|
+
# @see llvm::GlobalValue::getAlignment()
|
2874
3397
|
#
|
2875
|
-
# @method get_alignment(
|
2876
|
-
# @param [OpaqueValue]
|
3398
|
+
# @method get_alignment(v)
|
3399
|
+
# @param [OpaqueValue] v
|
2877
3400
|
# @return [Integer]
|
2878
3401
|
# @scope class
|
2879
3402
|
attach_function :get_alignment, :LLVMGetAlignment, [OpaqueValue], :uint
|
2880
3403
|
|
2881
|
-
#
|
3404
|
+
# Set the preferred alignment of the value.
|
3405
|
+
# @see llvm::LoadInst::setAlignment()
|
3406
|
+
# @see llvm::StoreInst::setAlignment()
|
3407
|
+
# @see llvm::GlobalValue::setAlignment()
|
2882
3408
|
#
|
2883
|
-
# @method set_alignment(
|
2884
|
-
# @param [OpaqueValue]
|
3409
|
+
# @method set_alignment(v, bytes)
|
3410
|
+
# @param [OpaqueValue] v
|
2885
3411
|
# @param [Integer] bytes
|
2886
3412
|
# @return [nil]
|
2887
3413
|
# @scope class
|
2888
3414
|
attach_function :set_alignment, :LLVMSetAlignment, [OpaqueValue, :uint], :void
|
2889
3415
|
|
2890
|
-
#
|
3416
|
+
# @defgroup LLVMCoreValueConstantGlobalVariable Global Variables
|
3417
|
+
#
|
3418
|
+
# This group contains functions that operate on global variable values.
|
3419
|
+
#
|
3420
|
+
# @see llvm::GlobalVariable
|
3421
|
+
#
|
3422
|
+
# @{
|
2891
3423
|
#
|
2892
3424
|
# @method add_global(m, ty, name)
|
2893
3425
|
# @param [OpaqueModule] m
|
@@ -3008,69 +3540,60 @@ module RLTK::CG::Bindings
|
|
3008
3540
|
# @scope class
|
3009
3541
|
attach_function :set_global_constant, :LLVMSetGlobalConstant, [OpaqueValue, :int], :void
|
3010
3542
|
|
3011
|
-
# Operations on aliases
|
3012
|
-
#
|
3013
|
-
# @method add_alias(m, ty, aliasee, name)
|
3014
|
-
# @param [OpaqueModule] m
|
3015
|
-
# @param [OpaqueType] ty
|
3016
|
-
# @param [OpaqueValue] aliasee
|
3017
|
-
# @param [String] name
|
3018
|
-
# @return [OpaqueValue]
|
3019
|
-
# @scope class
|
3020
|
-
attach_function :add_alias, :LLVMAddAlias, [OpaqueModule, OpaqueType, OpaqueValue, :string], OpaqueValue
|
3021
|
-
|
3022
|
-
# Operations on functions
|
3023
|
-
#
|
3024
|
-
# @method add_function(m, name, function_ty)
|
3025
|
-
# @param [OpaqueModule] m
|
3026
|
-
# @param [String] name
|
3027
|
-
# @param [OpaqueType] function_ty
|
3028
|
-
# @return [OpaqueValue]
|
3029
|
-
# @scope class
|
3030
|
-
attach_function :add_function, :LLVMAddFunction, [OpaqueModule, :string, OpaqueType], OpaqueValue
|
3031
|
-
|
3032
3543
|
# (Not documented)
|
3033
3544
|
#
|
3034
|
-
# @method
|
3035
|
-
# @param [
|
3036
|
-
# @
|
3037
|
-
# @return [OpaqueValue]
|
3545
|
+
# @method get_thread_local_mode(global_var)
|
3546
|
+
# @param [OpaqueValue] global_var
|
3547
|
+
# @return [Symbol from _enum_thread_local_mode_]
|
3038
3548
|
# @scope class
|
3039
|
-
attach_function :
|
3549
|
+
attach_function :get_thread_local_mode, :LLVMGetThreadLocalMode, [OpaqueValue], :thread_local_mode
|
3040
3550
|
|
3041
3551
|
# (Not documented)
|
3042
3552
|
#
|
3043
|
-
# @method
|
3044
|
-
# @param [
|
3045
|
-
# @
|
3553
|
+
# @method set_thread_local_mode(global_var, mode)
|
3554
|
+
# @param [OpaqueValue] global_var
|
3555
|
+
# @param [Symbol from _enum_thread_local_mode_] mode
|
3556
|
+
# @return [nil]
|
3046
3557
|
# @scope class
|
3047
|
-
attach_function :
|
3558
|
+
attach_function :set_thread_local_mode, :LLVMSetThreadLocalMode, [OpaqueValue, :thread_local_mode], :void
|
3048
3559
|
|
3049
3560
|
# (Not documented)
|
3050
3561
|
#
|
3051
|
-
# @method
|
3052
|
-
# @param [
|
3053
|
-
# @return [
|
3562
|
+
# @method is_externally_initialized(global_var)
|
3563
|
+
# @param [OpaqueValue] global_var
|
3564
|
+
# @return [Integer]
|
3054
3565
|
# @scope class
|
3055
|
-
attach_function :
|
3566
|
+
attach_function :is_externally_initialized, :LLVMIsExternallyInitialized, [OpaqueValue], :int
|
3056
3567
|
|
3057
3568
|
# (Not documented)
|
3058
3569
|
#
|
3059
|
-
# @method
|
3060
|
-
# @param [OpaqueValue]
|
3061
|
-
# @
|
3570
|
+
# @method set_externally_initialized(global_var, is_ext_init)
|
3571
|
+
# @param [OpaqueValue] global_var
|
3572
|
+
# @param [Integer] is_ext_init
|
3573
|
+
# @return [nil]
|
3062
3574
|
# @scope class
|
3063
|
-
attach_function :
|
3575
|
+
attach_function :set_externally_initialized, :LLVMSetExternallyInitialized, [OpaqueValue, :int], :void
|
3064
3576
|
|
3065
|
-
#
|
3577
|
+
# @defgroup LLVMCoreValueConstantGlobalAlias Global Aliases
|
3066
3578
|
#
|
3067
|
-
#
|
3068
|
-
#
|
3579
|
+
# This group contains function that operate on global alias values.
|
3580
|
+
#
|
3581
|
+
# @see llvm::GlobalAlias
|
3582
|
+
#
|
3583
|
+
# @{
|
3584
|
+
#
|
3585
|
+
# @method add_alias(m, ty, aliasee, name)
|
3586
|
+
# @param [OpaqueModule] m
|
3587
|
+
# @param [OpaqueType] ty
|
3588
|
+
# @param [OpaqueValue] aliasee
|
3589
|
+
# @param [String] name
|
3069
3590
|
# @return [OpaqueValue]
|
3070
3591
|
# @scope class
|
3071
|
-
attach_function :
|
3592
|
+
attach_function :add_alias, :LLVMAddAlias, [OpaqueModule, OpaqueType, OpaqueValue, :string], OpaqueValue
|
3072
3593
|
|
3073
|
-
#
|
3594
|
+
# Remove a function from its containing module and deletes it.
|
3595
|
+
#
|
3596
|
+
# @see llvm::Function::eraseFromParent()
|
3074
3597
|
#
|
3075
3598
|
# @method delete_function(fn)
|
3076
3599
|
# @param [OpaqueValue] fn
|
@@ -3078,7 +3601,9 @@ module RLTK::CG::Bindings
|
|
3078
3601
|
# @scope class
|
3079
3602
|
attach_function :delete_function, :LLVMDeleteFunction, [OpaqueValue], :void
|
3080
3603
|
|
3081
|
-
#
|
3604
|
+
# Obtain the ID number from a function instance.
|
3605
|
+
#
|
3606
|
+
# @see llvm::Function::getIntrinsicID()
|
3082
3607
|
#
|
3083
3608
|
# @method get_intrinsic_id(fn)
|
3084
3609
|
# @param [OpaqueValue] fn
|
@@ -3086,7 +3611,11 @@ module RLTK::CG::Bindings
|
|
3086
3611
|
# @scope class
|
3087
3612
|
attach_function :get_intrinsic_id, :LLVMGetIntrinsicID, [OpaqueValue], :uint
|
3088
3613
|
|
3089
|
-
#
|
3614
|
+
# Obtain the calling function of a function.
|
3615
|
+
#
|
3616
|
+
# The returned value corresponds to the LLVMCallConv enumeration.
|
3617
|
+
#
|
3618
|
+
# @see llvm::Function::getCallingConv()
|
3090
3619
|
#
|
3091
3620
|
# @method get_function_call_conv(fn)
|
3092
3621
|
# @param [OpaqueValue] fn
|
@@ -3094,7 +3623,12 @@ module RLTK::CG::Bindings
|
|
3094
3623
|
# @scope class
|
3095
3624
|
attach_function :get_function_call_conv, :LLVMGetFunctionCallConv, [OpaqueValue], :uint
|
3096
3625
|
|
3097
|
-
#
|
3626
|
+
# Set the calling convention of a function.
|
3627
|
+
#
|
3628
|
+
# @see llvm::Function::setCallingConv()
|
3629
|
+
#
|
3630
|
+
# @param Fn Function to operate on
|
3631
|
+
# @param CC LLVMCallConv to set calling convention to
|
3098
3632
|
#
|
3099
3633
|
# @method set_function_call_conv(fn, cc)
|
3100
3634
|
# @param [OpaqueValue] fn
|
@@ -3103,7 +3637,10 @@ module RLTK::CG::Bindings
|
|
3103
3637
|
# @scope class
|
3104
3638
|
attach_function :set_function_call_conv, :LLVMSetFunctionCallConv, [OpaqueValue, :uint], :void
|
3105
3639
|
|
3106
|
-
#
|
3640
|
+
# Obtain the name of the garbage collector to use during code
|
3641
|
+
# generation.
|
3642
|
+
#
|
3643
|
+
# @see llvm::Function::getGC()
|
3107
3644
|
#
|
3108
3645
|
# @method get_gc(fn)
|
3109
3646
|
# @param [OpaqueValue] fn
|
@@ -3111,7 +3648,9 @@ module RLTK::CG::Bindings
|
|
3111
3648
|
# @scope class
|
3112
3649
|
attach_function :get_gc, :LLVMGetGC, [OpaqueValue], :string
|
3113
3650
|
|
3114
|
-
#
|
3651
|
+
# Define the garbage collector to use during code generation.
|
3652
|
+
#
|
3653
|
+
# @see llvm::Function::setGC()
|
3115
3654
|
#
|
3116
3655
|
# @method set_gc(fn, name)
|
3117
3656
|
# @param [OpaqueValue] fn
|
@@ -3120,7 +3659,9 @@ module RLTK::CG::Bindings
|
|
3120
3659
|
# @scope class
|
3121
3660
|
attach_function :set_gc, :LLVMSetGC, [OpaqueValue, :string], :void
|
3122
3661
|
|
3123
|
-
#
|
3662
|
+
# Add an attribute to a function.
|
3663
|
+
#
|
3664
|
+
# @see llvm::Function::addAttribute()
|
3124
3665
|
#
|
3125
3666
|
# @method add_function_attr(fn, pa)
|
3126
3667
|
# @param [OpaqueValue] fn
|
@@ -3129,7 +3670,20 @@ module RLTK::CG::Bindings
|
|
3129
3670
|
# @scope class
|
3130
3671
|
attach_function :add_function_attr, :LLVMAddFunctionAttr, [OpaqueValue, :attribute], :void
|
3131
3672
|
|
3132
|
-
#
|
3673
|
+
# Add a target-dependent attribute to a fuction
|
3674
|
+
# @see llvm::AttrBuilder::addAttribute()
|
3675
|
+
#
|
3676
|
+
# @method add_target_dependent_function_attr(fn, a, v)
|
3677
|
+
# @param [OpaqueValue] fn
|
3678
|
+
# @param [String] a
|
3679
|
+
# @param [String] v
|
3680
|
+
# @return [nil]
|
3681
|
+
# @scope class
|
3682
|
+
attach_function :add_target_dependent_function_attr, :LLVMAddTargetDependentFunctionAttr, [OpaqueValue, :string, :string], :void
|
3683
|
+
|
3684
|
+
# Obtain an attribute from a function.
|
3685
|
+
#
|
3686
|
+
# @see llvm::Function::getAttributes()
|
3133
3687
|
#
|
3134
3688
|
# @method get_function_attr(fn)
|
3135
3689
|
# @param [OpaqueValue] fn
|
@@ -3137,7 +3691,7 @@ module RLTK::CG::Bindings
|
|
3137
3691
|
# @scope class
|
3138
3692
|
attach_function :get_function_attr, :LLVMGetFunctionAttr, [OpaqueValue], :attribute
|
3139
3693
|
|
3140
|
-
#
|
3694
|
+
# Remove an attribute from a function.
|
3141
3695
|
#
|
3142
3696
|
# @method remove_function_attr(fn, pa)
|
3143
3697
|
# @param [OpaqueValue] fn
|
@@ -3146,7 +3700,9 @@ module RLTK::CG::Bindings
|
|
3146
3700
|
# @scope class
|
3147
3701
|
attach_function :remove_function_attr, :LLVMRemoveFunctionAttr, [OpaqueValue, :attribute], :void
|
3148
3702
|
|
3149
|
-
#
|
3703
|
+
# Obtain the number of parameters in a function.
|
3704
|
+
#
|
3705
|
+
# @see llvm::Function::arg_size()
|
3150
3706
|
#
|
3151
3707
|
# @method count_params(fn)
|
3152
3708
|
# @param [OpaqueValue] fn
|
@@ -3154,7 +3710,15 @@ module RLTK::CG::Bindings
|
|
3154
3710
|
# @scope class
|
3155
3711
|
attach_function :count_params, :LLVMCountParams, [OpaqueValue], :uint
|
3156
3712
|
|
3157
|
-
#
|
3713
|
+
# Obtain the parameters in a function.
|
3714
|
+
#
|
3715
|
+
# The takes a pointer to a pre-allocated array of LLVMValueRef that is
|
3716
|
+
# at least LLVMCountParams() long. This array will be filled with
|
3717
|
+
# LLVMValueRef instances which correspond to the parameters the
|
3718
|
+
# function receives. Each LLVMValueRef corresponds to a llvm::Argument
|
3719
|
+
# instance.
|
3720
|
+
#
|
3721
|
+
# @see llvm::Function::arg_begin()
|
3158
3722
|
#
|
3159
3723
|
# @method get_params(fn, params)
|
3160
3724
|
# @param [OpaqueValue] fn
|
@@ -3163,7 +3727,11 @@ module RLTK::CG::Bindings
|
|
3163
3727
|
# @scope class
|
3164
3728
|
attach_function :get_params, :LLVMGetParams, [OpaqueValue, :pointer], :void
|
3165
3729
|
|
3166
|
-
#
|
3730
|
+
# Obtain the parameter at the specified index.
|
3731
|
+
#
|
3732
|
+
# Parameters are indexed from 0.
|
3733
|
+
#
|
3734
|
+
# @see llvm::Function::arg_begin()
|
3167
3735
|
#
|
3168
3736
|
# @method get_param(fn, index)
|
3169
3737
|
# @param [OpaqueValue] fn
|
@@ -3172,7 +3740,13 @@ module RLTK::CG::Bindings
|
|
3172
3740
|
# @scope class
|
3173
3741
|
attach_function :get_param, :LLVMGetParam, [OpaqueValue, :uint], OpaqueValue
|
3174
3742
|
|
3175
|
-
#
|
3743
|
+
# Obtain the function to which this argument belongs.
|
3744
|
+
#
|
3745
|
+
# Unlike other functions in this group, this one takes an LLVMValueRef
|
3746
|
+
# that corresponds to a llvm::Attribute.
|
3747
|
+
#
|
3748
|
+
# The returned LLVMValueRef is the llvm::Function to which this
|
3749
|
+
# argument belongs.
|
3176
3750
|
#
|
3177
3751
|
# @method get_param_parent(inst)
|
3178
3752
|
# @param [OpaqueValue] inst
|
@@ -3180,7 +3754,9 @@ module RLTK::CG::Bindings
|
|
3180
3754
|
# @scope class
|
3181
3755
|
attach_function :get_param_parent, :LLVMGetParamParent, [OpaqueValue], OpaqueValue
|
3182
3756
|
|
3183
|
-
#
|
3757
|
+
# Obtain the first parameter to a function.
|
3758
|
+
#
|
3759
|
+
# @see llvm::Function::arg_begin()
|
3184
3760
|
#
|
3185
3761
|
# @method get_first_param(fn)
|
3186
3762
|
# @param [OpaqueValue] fn
|
@@ -3188,7 +3764,9 @@ module RLTK::CG::Bindings
|
|
3188
3764
|
# @scope class
|
3189
3765
|
attach_function :get_first_param, :LLVMGetFirstParam, [OpaqueValue], OpaqueValue
|
3190
3766
|
|
3191
|
-
#
|
3767
|
+
# Obtain the last parameter to a function.
|
3768
|
+
#
|
3769
|
+
# @see llvm::Function::arg_end()
|
3192
3770
|
#
|
3193
3771
|
# @method get_last_param(fn)
|
3194
3772
|
# @param [OpaqueValue] fn
|
@@ -3196,7 +3774,11 @@ module RLTK::CG::Bindings
|
|
3196
3774
|
# @scope class
|
3197
3775
|
attach_function :get_last_param, :LLVMGetLastParam, [OpaqueValue], OpaqueValue
|
3198
3776
|
|
3199
|
-
#
|
3777
|
+
# Obtain the next parameter to a function.
|
3778
|
+
#
|
3779
|
+
# This takes an LLVMValueRef obtained from LLVMGetFirstParam() (which is
|
3780
|
+
# actually a wrapped iterator) and obtains the next parameter from the
|
3781
|
+
# underlying iterator.
|
3200
3782
|
#
|
3201
3783
|
# @method get_next_param(arg)
|
3202
3784
|
# @param [OpaqueValue] arg
|
@@ -3204,7 +3786,9 @@ module RLTK::CG::Bindings
|
|
3204
3786
|
# @scope class
|
3205
3787
|
attach_function :get_next_param, :LLVMGetNextParam, [OpaqueValue], OpaqueValue
|
3206
3788
|
|
3207
|
-
#
|
3789
|
+
# Obtain the previous parameter to a function.
|
3790
|
+
#
|
3791
|
+
# This is the opposite of LLVMGetNextParam().
|
3208
3792
|
#
|
3209
3793
|
# @method get_previous_param(arg)
|
3210
3794
|
# @param [OpaqueValue] arg
|
@@ -3212,7 +3796,9 @@ module RLTK::CG::Bindings
|
|
3212
3796
|
# @scope class
|
3213
3797
|
attach_function :get_previous_param, :LLVMGetPreviousParam, [OpaqueValue], OpaqueValue
|
3214
3798
|
|
3215
|
-
#
|
3799
|
+
# Add an attribute to a function argument.
|
3800
|
+
#
|
3801
|
+
# @see llvm::Argument::addAttr()
|
3216
3802
|
#
|
3217
3803
|
# @method add_attribute(arg, pa)
|
3218
3804
|
# @param [OpaqueValue] arg
|
@@ -3221,7 +3807,9 @@ module RLTK::CG::Bindings
|
|
3221
3807
|
# @scope class
|
3222
3808
|
attach_function :add_attribute, :LLVMAddAttribute, [OpaqueValue, :attribute], :void
|
3223
3809
|
|
3224
|
-
#
|
3810
|
+
# Remove an attribute from a function argument.
|
3811
|
+
#
|
3812
|
+
# @see llvm::Argument::removeAttr()
|
3225
3813
|
#
|
3226
3814
|
# @method remove_attribute(arg, pa)
|
3227
3815
|
# @param [OpaqueValue] arg
|
@@ -3230,7 +3818,7 @@ module RLTK::CG::Bindings
|
|
3230
3818
|
# @scope class
|
3231
3819
|
attach_function :remove_attribute, :LLVMRemoveAttribute, [OpaqueValue, :attribute], :void
|
3232
3820
|
|
3233
|
-
#
|
3821
|
+
# Get an attribute from a function argument.
|
3234
3822
|
#
|
3235
3823
|
# @method get_attribute(arg)
|
3236
3824
|
# @param [OpaqueValue] arg
|
@@ -3238,7 +3826,10 @@ module RLTK::CG::Bindings
|
|
3238
3826
|
# @scope class
|
3239
3827
|
attach_function :get_attribute, :LLVMGetAttribute, [OpaqueValue], :attribute
|
3240
3828
|
|
3241
|
-
#
|
3829
|
+
# Set the alignment for a function parameter.
|
3830
|
+
#
|
3831
|
+
# @see llvm::Argument::addAttr()
|
3832
|
+
# @see llvm::AttrBuilder::addAlignmentAttr()
|
3242
3833
|
#
|
3243
3834
|
# @method set_param_alignment(arg, align)
|
3244
3835
|
# @param [OpaqueValue] arg
|
@@ -3247,7 +3838,94 @@ module RLTK::CG::Bindings
|
|
3247
3838
|
# @scope class
|
3248
3839
|
attach_function :set_param_alignment, :LLVMSetParamAlignment, [OpaqueValue, :uint], :void
|
3249
3840
|
|
3250
|
-
#
|
3841
|
+
# Obtain a MDString value from a context.
|
3842
|
+
#
|
3843
|
+
# The returned instance corresponds to the llvm::MDString class.
|
3844
|
+
#
|
3845
|
+
# The instance is specified by string data of a specified length. The
|
3846
|
+
# string content is copied, so the backing memory can be freed after
|
3847
|
+
# this function returns.
|
3848
|
+
#
|
3849
|
+
# @method md_string_in_context(c, str, s_len)
|
3850
|
+
# @param [OpaqueContext] c
|
3851
|
+
# @param [String] str
|
3852
|
+
# @param [Integer] s_len
|
3853
|
+
# @return [OpaqueValue]
|
3854
|
+
# @scope class
|
3855
|
+
attach_function :md_string_in_context, :LLVMMDStringInContext, [OpaqueContext, :string, :uint], OpaqueValue
|
3856
|
+
|
3857
|
+
# Obtain a MDString value from the global context.
|
3858
|
+
#
|
3859
|
+
# @method md_string(str, s_len)
|
3860
|
+
# @param [String] str
|
3861
|
+
# @param [Integer] s_len
|
3862
|
+
# @return [OpaqueValue]
|
3863
|
+
# @scope class
|
3864
|
+
attach_function :md_string, :LLVMMDString, [:string, :uint], OpaqueValue
|
3865
|
+
|
3866
|
+
# Obtain a MDNode value from a context.
|
3867
|
+
#
|
3868
|
+
# The returned value corresponds to the llvm::MDNode class.
|
3869
|
+
#
|
3870
|
+
# @method md_node_in_context(c, vals, count)
|
3871
|
+
# @param [OpaqueContext] c
|
3872
|
+
# @param [FFI::Pointer(*ValueRef)] vals
|
3873
|
+
# @param [Integer] count
|
3874
|
+
# @return [OpaqueValue]
|
3875
|
+
# @scope class
|
3876
|
+
attach_function :md_node_in_context, :LLVMMDNodeInContext, [OpaqueContext, :pointer, :uint], OpaqueValue
|
3877
|
+
|
3878
|
+
# Obtain a MDNode value from the global context.
|
3879
|
+
#
|
3880
|
+
# @method md_node(vals, count)
|
3881
|
+
# @param [FFI::Pointer(*ValueRef)] vals
|
3882
|
+
# @param [Integer] count
|
3883
|
+
# @return [OpaqueValue]
|
3884
|
+
# @scope class
|
3885
|
+
attach_function :md_node, :LLVMMDNode, [:pointer, :uint], OpaqueValue
|
3886
|
+
|
3887
|
+
# Obtain the underlying string from a MDString value.
|
3888
|
+
#
|
3889
|
+
# @param V Instance to obtain string from.
|
3890
|
+
# @param Len Memory address which will hold length of returned string.
|
3891
|
+
# @return String data in MDString.
|
3892
|
+
#
|
3893
|
+
# @method get_md_string(v, len)
|
3894
|
+
# @param [OpaqueValue] v
|
3895
|
+
# @param [FFI::Pointer(*UInt)] len
|
3896
|
+
# @return [String]
|
3897
|
+
# @scope class
|
3898
|
+
attach_function :get_md_string, :LLVMGetMDString, [OpaqueValue, :pointer], :string
|
3899
|
+
|
3900
|
+
# Obtain the number of operands from an MDNode value.
|
3901
|
+
#
|
3902
|
+
# @param V MDNode to get number of operands from.
|
3903
|
+
# @return Number of operands of the MDNode.
|
3904
|
+
#
|
3905
|
+
# @method get_md_node_num_operands(v)
|
3906
|
+
# @param [OpaqueValue] v
|
3907
|
+
# @return [Integer]
|
3908
|
+
# @scope class
|
3909
|
+
attach_function :get_md_node_num_operands, :LLVMGetMDNodeNumOperands, [OpaqueValue], :uint
|
3910
|
+
|
3911
|
+
# Obtain the given MDNode's operands.
|
3912
|
+
#
|
3913
|
+
# The passed LLVMValueRef pointer should point to enough memory to hold all of
|
3914
|
+
# the operands of the given MDNode (see LLVMGetMDNodeNumOperands) as
|
3915
|
+
# LLVMValueRefs. This memory will be populated with the LLVMValueRefs of the
|
3916
|
+
# MDNode's operands.
|
3917
|
+
#
|
3918
|
+
# @param V MDNode to get the operands from.
|
3919
|
+
# @param Dest Destination array for operands.
|
3920
|
+
#
|
3921
|
+
# @method get_md_node_operands(v, dest)
|
3922
|
+
# @param [OpaqueValue] v
|
3923
|
+
# @param [FFI::Pointer(*ValueRef)] dest
|
3924
|
+
# @return [nil]
|
3925
|
+
# @scope class
|
3926
|
+
attach_function :get_md_node_operands, :LLVMGetMDNodeOperands, [OpaqueValue, :pointer], :void
|
3927
|
+
|
3928
|
+
# Convert a basic block instance to a value type.
|
3251
3929
|
#
|
3252
3930
|
# @method basic_block_as_value(bb)
|
3253
3931
|
# @param [OpaqueBasicBlock] bb
|
@@ -3255,7 +3933,7 @@ module RLTK::CG::Bindings
|
|
3255
3933
|
# @scope class
|
3256
3934
|
attach_function :basic_block_as_value, :LLVMBasicBlockAsValue, [OpaqueBasicBlock], OpaqueValue
|
3257
3935
|
|
3258
|
-
#
|
3936
|
+
# Determine whether an LLVMValueRef is itself a basic block.
|
3259
3937
|
#
|
3260
3938
|
# @method value_is_basic_block(val)
|
3261
3939
|
# @param [OpaqueValue] val
|
@@ -3263,7 +3941,7 @@ module RLTK::CG::Bindings
|
|
3263
3941
|
# @scope class
|
3264
3942
|
attach_function :value_is_basic_block, :LLVMValueIsBasicBlock, [OpaqueValue], :int
|
3265
3943
|
|
3266
|
-
#
|
3944
|
+
# Convert an LLVMValueRef to an LLVMBasicBlockRef instance.
|
3267
3945
|
#
|
3268
3946
|
# @method value_as_basic_block(val)
|
3269
3947
|
# @param [OpaqueValue] val
|
@@ -3271,7 +3949,9 @@ module RLTK::CG::Bindings
|
|
3271
3949
|
# @scope class
|
3272
3950
|
attach_function :value_as_basic_block, :LLVMValueAsBasicBlock, [OpaqueValue], OpaqueBasicBlock
|
3273
3951
|
|
3274
|
-
#
|
3952
|
+
# Obtain the function to which a basic block belongs.
|
3953
|
+
#
|
3954
|
+
# @see llvm::BasicBlock::getParent()
|
3275
3955
|
#
|
3276
3956
|
# @method get_basic_block_parent(bb)
|
3277
3957
|
# @param [OpaqueBasicBlock] bb
|
@@ -3279,7 +3959,14 @@ module RLTK::CG::Bindings
|
|
3279
3959
|
# @scope class
|
3280
3960
|
attach_function :get_basic_block_parent, :LLVMGetBasicBlockParent, [OpaqueBasicBlock], OpaqueValue
|
3281
3961
|
|
3282
|
-
#
|
3962
|
+
# Obtain the terminator instruction for a basic block.
|
3963
|
+
#
|
3964
|
+
# If the basic block does not have a terminator (it is not well-formed
|
3965
|
+
# if it doesn't), then NULL is returned.
|
3966
|
+
#
|
3967
|
+
# The returned LLVMValueRef corresponds to a llvm::TerminatorInst.
|
3968
|
+
#
|
3969
|
+
# @see llvm::BasicBlock::getTerminator()
|
3283
3970
|
#
|
3284
3971
|
# @method get_basic_block_terminator(bb)
|
3285
3972
|
# @param [OpaqueBasicBlock] bb
|
@@ -3287,7 +3974,9 @@ module RLTK::CG::Bindings
|
|
3287
3974
|
# @scope class
|
3288
3975
|
attach_function :get_basic_block_terminator, :LLVMGetBasicBlockTerminator, [OpaqueBasicBlock], OpaqueValue
|
3289
3976
|
|
3290
|
-
#
|
3977
|
+
# Obtain the number of basic blocks in a function.
|
3978
|
+
#
|
3979
|
+
# @param Fn Function value to operate on.
|
3291
3980
|
#
|
3292
3981
|
# @method count_basic_blocks(fn)
|
3293
3982
|
# @param [OpaqueValue] fn
|
@@ -3295,7 +3984,12 @@ module RLTK::CG::Bindings
|
|
3295
3984
|
# @scope class
|
3296
3985
|
attach_function :count_basic_blocks, :LLVMCountBasicBlocks, [OpaqueValue], :uint
|
3297
3986
|
|
3298
|
-
#
|
3987
|
+
# Obtain all of the basic blocks in a function.
|
3988
|
+
#
|
3989
|
+
# This operates on a function value. The BasicBlocks parameter is a
|
3990
|
+
# pointer to a pre-allocated array of LLVMBasicBlockRef of at least
|
3991
|
+
# LLVMCountBasicBlocks() in length. This array is populated with
|
3992
|
+
# LLVMBasicBlockRef instances.
|
3299
3993
|
#
|
3300
3994
|
# @method get_basic_blocks(fn, basic_blocks)
|
3301
3995
|
# @param [OpaqueValue] fn
|
@@ -3304,7 +3998,12 @@ module RLTK::CG::Bindings
|
|
3304
3998
|
# @scope class
|
3305
3999
|
attach_function :get_basic_blocks, :LLVMGetBasicBlocks, [OpaqueValue, :pointer], :void
|
3306
4000
|
|
3307
|
-
#
|
4001
|
+
# Obtain the first basic block in a function.
|
4002
|
+
#
|
4003
|
+
# The returned basic block can be used as an iterator. You will likely
|
4004
|
+
# eventually call into LLVMGetNextBasicBlock() with it.
|
4005
|
+
#
|
4006
|
+
# @see llvm::Function::begin()
|
3308
4007
|
#
|
3309
4008
|
# @method get_first_basic_block(fn)
|
3310
4009
|
# @param [OpaqueValue] fn
|
@@ -3312,7 +4011,9 @@ module RLTK::CG::Bindings
|
|
3312
4011
|
# @scope class
|
3313
4012
|
attach_function :get_first_basic_block, :LLVMGetFirstBasicBlock, [OpaqueValue], OpaqueBasicBlock
|
3314
4013
|
|
3315
|
-
#
|
4014
|
+
# Obtain the last basic block in a function.
|
4015
|
+
#
|
4016
|
+
# @see llvm::Function::end()
|
3316
4017
|
#
|
3317
4018
|
# @method get_last_basic_block(fn)
|
3318
4019
|
# @param [OpaqueValue] fn
|
@@ -3320,7 +4021,7 @@ module RLTK::CG::Bindings
|
|
3320
4021
|
# @scope class
|
3321
4022
|
attach_function :get_last_basic_block, :LLVMGetLastBasicBlock, [OpaqueValue], OpaqueBasicBlock
|
3322
4023
|
|
3323
|
-
#
|
4024
|
+
# Advance a basic block iterator.
|
3324
4025
|
#
|
3325
4026
|
# @method get_next_basic_block(bb)
|
3326
4027
|
# @param [OpaqueBasicBlock] bb
|
@@ -3328,7 +4029,7 @@ module RLTK::CG::Bindings
|
|
3328
4029
|
# @scope class
|
3329
4030
|
attach_function :get_next_basic_block, :LLVMGetNextBasicBlock, [OpaqueBasicBlock], OpaqueBasicBlock
|
3330
4031
|
|
3331
|
-
#
|
4032
|
+
# Go backwards in a basic block iterator.
|
3332
4033
|
#
|
3333
4034
|
# @method get_previous_basic_block(bb)
|
3334
4035
|
# @param [OpaqueBasicBlock] bb
|
@@ -3336,7 +4037,10 @@ module RLTK::CG::Bindings
|
|
3336
4037
|
# @scope class
|
3337
4038
|
attach_function :get_previous_basic_block, :LLVMGetPreviousBasicBlock, [OpaqueBasicBlock], OpaqueBasicBlock
|
3338
4039
|
|
3339
|
-
#
|
4040
|
+
# Obtain the basic block that corresponds to the entry point of a
|
4041
|
+
# function.
|
4042
|
+
#
|
4043
|
+
# @see llvm::Function::getEntryBlock()
|
3340
4044
|
#
|
3341
4045
|
# @method get_entry_basic_block(fn)
|
3342
4046
|
# @param [OpaqueValue] fn
|
@@ -3344,7 +4048,9 @@ module RLTK::CG::Bindings
|
|
3344
4048
|
# @scope class
|
3345
4049
|
attach_function :get_entry_basic_block, :LLVMGetEntryBasicBlock, [OpaqueValue], OpaqueBasicBlock
|
3346
4050
|
|
3347
|
-
#
|
4051
|
+
# Append a basic block to the end of a function.
|
4052
|
+
#
|
4053
|
+
# @see llvm::BasicBlock::Create()
|
3348
4054
|
#
|
3349
4055
|
# @method append_basic_block_in_context(c, fn, name)
|
3350
4056
|
# @param [OpaqueContext] c
|
@@ -3354,26 +4060,36 @@ module RLTK::CG::Bindings
|
|
3354
4060
|
# @scope class
|
3355
4061
|
attach_function :append_basic_block_in_context, :LLVMAppendBasicBlockInContext, [OpaqueContext, OpaqueValue, :string], OpaqueBasicBlock
|
3356
4062
|
|
3357
|
-
#
|
4063
|
+
# Append a basic block to the end of a function using the global
|
4064
|
+
# context.
|
3358
4065
|
#
|
3359
|
-
# @
|
3360
|
-
#
|
3361
|
-
# @
|
4066
|
+
# @see llvm::BasicBlock::Create()
|
4067
|
+
#
|
4068
|
+
# @method append_basic_block(fn, name)
|
4069
|
+
# @param [OpaqueValue] fn
|
3362
4070
|
# @param [String] name
|
3363
4071
|
# @return [OpaqueBasicBlock]
|
3364
4072
|
# @scope class
|
3365
|
-
attach_function :
|
4073
|
+
attach_function :append_basic_block, :LLVMAppendBasicBlock, [OpaqueValue, :string], OpaqueBasicBlock
|
3366
4074
|
|
3367
|
-
#
|
4075
|
+
# Insert a basic block in a function before another basic block.
|
3368
4076
|
#
|
3369
|
-
#
|
3370
|
-
#
|
4077
|
+
# The function to add to is determined by the function of the
|
4078
|
+
# passed basic block.
|
4079
|
+
#
|
4080
|
+
# @see llvm::BasicBlock::Create()
|
4081
|
+
#
|
4082
|
+
# @method insert_basic_block_in_context(c, bb, name)
|
4083
|
+
# @param [OpaqueContext] c
|
4084
|
+
# @param [OpaqueBasicBlock] bb
|
3371
4085
|
# @param [String] name
|
3372
4086
|
# @return [OpaqueBasicBlock]
|
3373
4087
|
# @scope class
|
3374
|
-
attach_function :
|
4088
|
+
attach_function :insert_basic_block_in_context, :LLVMInsertBasicBlockInContext, [OpaqueContext, OpaqueBasicBlock, :string], OpaqueBasicBlock
|
3375
4089
|
|
3376
|
-
#
|
4090
|
+
# Insert a basic block in a function using the global context.
|
4091
|
+
#
|
4092
|
+
# @see llvm::BasicBlock::Create()
|
3377
4093
|
#
|
3378
4094
|
# @method insert_basic_block(insert_before_bb, name)
|
3379
4095
|
# @param [OpaqueBasicBlock] insert_before_bb
|
@@ -3382,7 +4098,12 @@ module RLTK::CG::Bindings
|
|
3382
4098
|
# @scope class
|
3383
4099
|
attach_function :insert_basic_block, :LLVMInsertBasicBlock, [OpaqueBasicBlock, :string], OpaqueBasicBlock
|
3384
4100
|
|
3385
|
-
#
|
4101
|
+
# Remove a basic block from a function and delete it.
|
4102
|
+
#
|
4103
|
+
# This deletes the basic block from its containing function and deletes
|
4104
|
+
# the basic block itself.
|
4105
|
+
#
|
4106
|
+
# @see llvm::BasicBlock::eraseFromParent()
|
3386
4107
|
#
|
3387
4108
|
# @method delete_basic_block(bb)
|
3388
4109
|
# @param [OpaqueBasicBlock] bb
|
@@ -3390,7 +4111,12 @@ module RLTK::CG::Bindings
|
|
3390
4111
|
# @scope class
|
3391
4112
|
attach_function :delete_basic_block, :LLVMDeleteBasicBlock, [OpaqueBasicBlock], :void
|
3392
4113
|
|
3393
|
-
#
|
4114
|
+
# Remove a basic block from a function.
|
4115
|
+
#
|
4116
|
+
# This deletes the basic block from its containing function but keep
|
4117
|
+
# the basic block alive.
|
4118
|
+
#
|
4119
|
+
# @see llvm::BasicBlock::removeFromParent()
|
3394
4120
|
#
|
3395
4121
|
# @method remove_basic_block_from_parent(bb)
|
3396
4122
|
# @param [OpaqueBasicBlock] bb
|
@@ -3398,7 +4124,9 @@ module RLTK::CG::Bindings
|
|
3398
4124
|
# @scope class
|
3399
4125
|
attach_function :remove_basic_block_from_parent, :LLVMRemoveBasicBlockFromParent, [OpaqueBasicBlock], :void
|
3400
4126
|
|
3401
|
-
#
|
4127
|
+
# Move a basic block to before another one.
|
4128
|
+
#
|
4129
|
+
# @see llvm::BasicBlock::moveBefore()
|
3402
4130
|
#
|
3403
4131
|
# @method move_basic_block_before(bb, move_pos)
|
3404
4132
|
# @param [OpaqueBasicBlock] bb
|
@@ -3407,7 +4135,9 @@ module RLTK::CG::Bindings
|
|
3407
4135
|
# @scope class
|
3408
4136
|
attach_function :move_basic_block_before, :LLVMMoveBasicBlockBefore, [OpaqueBasicBlock, OpaqueBasicBlock], :void
|
3409
4137
|
|
3410
|
-
#
|
4138
|
+
# Move a basic block to after another one.
|
4139
|
+
#
|
4140
|
+
# @see llvm::BasicBlock::moveAfter()
|
3411
4141
|
#
|
3412
4142
|
# @method move_basic_block_after(bb, move_pos)
|
3413
4143
|
# @param [OpaqueBasicBlock] bb
|
@@ -3416,7 +4146,10 @@ module RLTK::CG::Bindings
|
|
3416
4146
|
# @scope class
|
3417
4147
|
attach_function :move_basic_block_after, :LLVMMoveBasicBlockAfter, [OpaqueBasicBlock, OpaqueBasicBlock], :void
|
3418
4148
|
|
3419
|
-
#
|
4149
|
+
# Obtain the first instruction in a basic block.
|
4150
|
+
#
|
4151
|
+
# The returned LLVMValueRef corresponds to a llvm::Instruction
|
4152
|
+
# instance.
|
3420
4153
|
#
|
3421
4154
|
# @method get_first_instruction(bb)
|
3422
4155
|
# @param [OpaqueBasicBlock] bb
|
@@ -3424,7 +4157,9 @@ module RLTK::CG::Bindings
|
|
3424
4157
|
# @scope class
|
3425
4158
|
attach_function :get_first_instruction, :LLVMGetFirstInstruction, [OpaqueBasicBlock], OpaqueValue
|
3426
4159
|
|
3427
|
-
#
|
4160
|
+
# Obtain the last instruction in a basic block.
|
4161
|
+
#
|
4162
|
+
# The returned LLVMValueRef corresponds to an LLVM:Instruction.
|
3428
4163
|
#
|
3429
4164
|
# @method get_last_instruction(bb)
|
3430
4165
|
# @param [OpaqueBasicBlock] bb
|
@@ -3432,7 +4167,36 @@ module RLTK::CG::Bindings
|
|
3432
4167
|
# @scope class
|
3433
4168
|
attach_function :get_last_instruction, :LLVMGetLastInstruction, [OpaqueBasicBlock], OpaqueValue
|
3434
4169
|
|
3435
|
-
#
|
4170
|
+
# Determine whether an instruction has any metadata attached.
|
4171
|
+
#
|
4172
|
+
# @method has_metadata(val)
|
4173
|
+
# @param [OpaqueValue] val
|
4174
|
+
# @return [Integer]
|
4175
|
+
# @scope class
|
4176
|
+
attach_function :has_metadata, :LLVMHasMetadata, [OpaqueValue], :int
|
4177
|
+
|
4178
|
+
# Return metadata associated with an instruction value.
|
4179
|
+
#
|
4180
|
+
# @method get_metadata(val, kind_id)
|
4181
|
+
# @param [OpaqueValue] val
|
4182
|
+
# @param [Integer] kind_id
|
4183
|
+
# @return [OpaqueValue]
|
4184
|
+
# @scope class
|
4185
|
+
attach_function :get_metadata, :LLVMGetMetadata, [OpaqueValue, :uint], OpaqueValue
|
4186
|
+
|
4187
|
+
# Set metadata associated with an instruction value.
|
4188
|
+
#
|
4189
|
+
# @method set_metadata(val, kind_id, node)
|
4190
|
+
# @param [OpaqueValue] val
|
4191
|
+
# @param [Integer] kind_id
|
4192
|
+
# @param [OpaqueValue] node
|
4193
|
+
# @return [nil]
|
4194
|
+
# @scope class
|
4195
|
+
attach_function :set_metadata, :LLVMSetMetadata, [OpaqueValue, :uint, OpaqueValue], :void
|
4196
|
+
|
4197
|
+
# Obtain the basic block to which an instruction belongs.
|
4198
|
+
#
|
4199
|
+
# @see llvm::Instruction::getParent()
|
3436
4200
|
#
|
3437
4201
|
# @method get_instruction_parent(inst)
|
3438
4202
|
# @param [OpaqueValue] inst
|
@@ -3440,7 +4204,12 @@ module RLTK::CG::Bindings
|
|
3440
4204
|
# @scope class
|
3441
4205
|
attach_function :get_instruction_parent, :LLVMGetInstructionParent, [OpaqueValue], OpaqueBasicBlock
|
3442
4206
|
|
3443
|
-
#
|
4207
|
+
# Obtain the instruction that occurs after the one specified.
|
4208
|
+
#
|
4209
|
+
# The next instruction will be from the same basic block.
|
4210
|
+
#
|
4211
|
+
# If this is the last instruction in a basic block, NULL will be
|
4212
|
+
# returned.
|
3444
4213
|
#
|
3445
4214
|
# @method get_next_instruction(inst)
|
3446
4215
|
# @param [OpaqueValue] inst
|
@@ -3448,7 +4217,10 @@ module RLTK::CG::Bindings
|
|
3448
4217
|
# @scope class
|
3449
4218
|
attach_function :get_next_instruction, :LLVMGetNextInstruction, [OpaqueValue], OpaqueValue
|
3450
4219
|
|
3451
|
-
#
|
4220
|
+
# Obtain the instruction that occurred before this one.
|
4221
|
+
#
|
4222
|
+
# If the instruction is the first instruction in a basic block, NULL
|
4223
|
+
# will be returned.
|
3452
4224
|
#
|
3453
4225
|
# @method get_previous_instruction(inst)
|
3454
4226
|
# @param [OpaqueValue] inst
|
@@ -3456,7 +4228,12 @@ module RLTK::CG::Bindings
|
|
3456
4228
|
# @scope class
|
3457
4229
|
attach_function :get_previous_instruction, :LLVMGetPreviousInstruction, [OpaqueValue], OpaqueValue
|
3458
4230
|
|
3459
|
-
#
|
4231
|
+
# Remove and delete an instruction.
|
4232
|
+
#
|
4233
|
+
# The instruction specified is removed from its containing building
|
4234
|
+
# block and then deleted.
|
4235
|
+
#
|
4236
|
+
# @see llvm::Instruction::eraseFromParent()
|
3460
4237
|
#
|
3461
4238
|
# @method instruction_erase_from_parent(inst)
|
3462
4239
|
# @param [OpaqueValue] inst
|
@@ -3464,7 +4241,9 @@ module RLTK::CG::Bindings
|
|
3464
4241
|
# @scope class
|
3465
4242
|
attach_function :instruction_erase_from_parent, :LLVMInstructionEraseFromParent, [OpaqueValue], :void
|
3466
4243
|
|
3467
|
-
#
|
4244
|
+
# Obtain the code opcode for an individual instruction.
|
4245
|
+
#
|
4246
|
+
# @see llvm::Instruction::getOpCode()
|
3468
4247
|
#
|
3469
4248
|
# @method get_instruction_opcode(inst)
|
3470
4249
|
# @param [OpaqueValue] inst
|
@@ -3472,7 +4251,12 @@ module RLTK::CG::Bindings
|
|
3472
4251
|
# @scope class
|
3473
4252
|
attach_function :get_instruction_opcode, :LLVMGetInstructionOpcode, [OpaqueValue], :opcode
|
3474
4253
|
|
3475
|
-
#
|
4254
|
+
# Obtain the predicate of an instruction.
|
4255
|
+
#
|
4256
|
+
# This is only valid for instructions that correspond to llvm::ICmpInst
|
4257
|
+
# or llvm::ConstantExpr whose opcode is llvm::Instruction::ICmp.
|
4258
|
+
#
|
4259
|
+
# @see llvm::ICmpInst::getPredicate()
|
3476
4260
|
#
|
3477
4261
|
# @method get_i_cmp_predicate(inst)
|
3478
4262
|
# @param [OpaqueValue] inst
|
@@ -3480,7 +4264,13 @@ module RLTK::CG::Bindings
|
|
3480
4264
|
# @scope class
|
3481
4265
|
attach_function :get_i_cmp_predicate, :LLVMGetICmpPredicate, [OpaqueValue], :int_predicate
|
3482
4266
|
|
3483
|
-
#
|
4267
|
+
# Set the calling convention for a call instruction.
|
4268
|
+
#
|
4269
|
+
# This expects an LLVMValueRef that corresponds to a llvm::CallInst or
|
4270
|
+
# llvm::InvokeInst.
|
4271
|
+
#
|
4272
|
+
# @see llvm::CallInst::setCallingConv()
|
4273
|
+
# @see llvm::InvokeInst::setCallingConv()
|
3484
4274
|
#
|
3485
4275
|
# @method set_instruction_call_conv(instr, cc)
|
3486
4276
|
# @param [OpaqueValue] instr
|
@@ -3489,7 +4279,12 @@ module RLTK::CG::Bindings
|
|
3489
4279
|
# @scope class
|
3490
4280
|
attach_function :set_instruction_call_conv, :LLVMSetInstructionCallConv, [OpaqueValue, :uint], :void
|
3491
4281
|
|
3492
|
-
#
|
4282
|
+
# Obtain the calling convention for a call instruction.
|
4283
|
+
#
|
4284
|
+
# This is the opposite of LLVMSetInstructionCallConv(). Reads its
|
4285
|
+
# usage.
|
4286
|
+
#
|
4287
|
+
# @see LLVMSetInstructionCallConv()
|
3493
4288
|
#
|
3494
4289
|
# @method get_instruction_call_conv(instr)
|
3495
4290
|
# @param [OpaqueValue] instr
|
@@ -3527,7 +4322,11 @@ module RLTK::CG::Bindings
|
|
3527
4322
|
# @scope class
|
3528
4323
|
attach_function :set_instr_param_alignment, :LLVMSetInstrParamAlignment, [OpaqueValue, :uint, :uint], :void
|
3529
4324
|
|
3530
|
-
#
|
4325
|
+
# Obtain whether a call instruction is a tail call.
|
4326
|
+
#
|
4327
|
+
# This only works on llvm::CallInst instructions.
|
4328
|
+
#
|
4329
|
+
# @see llvm::CallInst::isTailCall()
|
3531
4330
|
#
|
3532
4331
|
# @method is_tail_call(call_inst)
|
3533
4332
|
# @param [OpaqueValue] call_inst
|
@@ -3535,7 +4334,11 @@ module RLTK::CG::Bindings
|
|
3535
4334
|
# @scope class
|
3536
4335
|
attach_function :is_tail_call, :LLVMIsTailCall, [OpaqueValue], :int
|
3537
4336
|
|
3538
|
-
#
|
4337
|
+
# Set whether a call instruction is a tail call.
|
4338
|
+
#
|
4339
|
+
# This only works on llvm::CallInst instructions.
|
4340
|
+
#
|
4341
|
+
# @see llvm::CallInst::setTailCall()
|
3539
4342
|
#
|
3540
4343
|
# @method set_tail_call(call_inst, is_tail_call)
|
3541
4344
|
# @param [OpaqueValue] call_inst
|
@@ -3544,7 +4347,11 @@ module RLTK::CG::Bindings
|
|
3544
4347
|
# @scope class
|
3545
4348
|
attach_function :set_tail_call, :LLVMSetTailCall, [OpaqueValue, :int], :void
|
3546
4349
|
|
3547
|
-
#
|
4350
|
+
# Obtain the default destination basic block of a switch instruction.
|
4351
|
+
#
|
4352
|
+
# This only works on llvm::SwitchInst instructions.
|
4353
|
+
#
|
4354
|
+
# @see llvm::SwitchInst::getDefaultDest()
|
3548
4355
|
#
|
3549
4356
|
# @method get_switch_default_dest(switch_instr)
|
3550
4357
|
# @param [OpaqueValue] switch_instr
|
@@ -3552,7 +4359,7 @@ module RLTK::CG::Bindings
|
|
3552
4359
|
# @scope class
|
3553
4360
|
attach_function :get_switch_default_dest, :LLVMGetSwitchDefaultDest, [OpaqueValue], OpaqueBasicBlock
|
3554
4361
|
|
3555
|
-
#
|
4362
|
+
# Add an incoming value to the end of a PHI list.
|
3556
4363
|
#
|
3557
4364
|
# @method add_incoming(phi_node, incoming_values, incoming_blocks, count)
|
3558
4365
|
# @param [OpaqueValue] phi_node
|
@@ -3563,7 +4370,7 @@ module RLTK::CG::Bindings
|
|
3563
4370
|
# @scope class
|
3564
4371
|
attach_function :add_incoming, :LLVMAddIncoming, [OpaqueValue, :pointer, :pointer, :uint], :void
|
3565
4372
|
|
3566
|
-
#
|
4373
|
+
# Obtain the number of incoming basic blocks to a PHI node.
|
3567
4374
|
#
|
3568
4375
|
# @method count_incoming(phi_node)
|
3569
4376
|
# @param [OpaqueValue] phi_node
|
@@ -3571,7 +4378,7 @@ module RLTK::CG::Bindings
|
|
3571
4378
|
# @scope class
|
3572
4379
|
attach_function :count_incoming, :LLVMCountIncoming, [OpaqueValue], :uint
|
3573
4380
|
|
3574
|
-
#
|
4381
|
+
# Obtain an incoming value to a PHI node as an LLVMValueRef.
|
3575
4382
|
#
|
3576
4383
|
# @method get_incoming_value(phi_node, index)
|
3577
4384
|
# @param [OpaqueValue] phi_node
|
@@ -3580,7 +4387,7 @@ module RLTK::CG::Bindings
|
|
3580
4387
|
# @scope class
|
3581
4388
|
attach_function :get_incoming_value, :LLVMGetIncomingValue, [OpaqueValue, :uint], OpaqueValue
|
3582
4389
|
|
3583
|
-
#
|
4390
|
+
# Obtain an incoming value to a PHI node as an LLVMBasicBlockRef.
|
3584
4391
|
#
|
3585
4392
|
# @method get_incoming_block(phi_node, index)
|
3586
4393
|
# @param [OpaqueValue] phi_node
|
@@ -3589,8 +4396,12 @@ module RLTK::CG::Bindings
|
|
3589
4396
|
# @scope class
|
3590
4397
|
attach_function :get_incoming_block, :LLVMGetIncomingBlock, [OpaqueValue, :uint], OpaqueBasicBlock
|
3591
4398
|
|
3592
|
-
#
|
3593
|
-
#
|
4399
|
+
# @defgroup LLVMCCoreInstructionBuilder Instruction Builders
|
4400
|
+
#
|
4401
|
+
# An instruction builder represents a point within a basic block and is
|
4402
|
+
# the exclusive means of building instructions using the C interface.
|
4403
|
+
#
|
4404
|
+
# @{
|
3594
4405
|
#
|
3595
4406
|
# @method create_builder_in_context(c)
|
3596
4407
|
# @param [OpaqueContext] c
|
@@ -4313,6 +5124,23 @@ module RLTK::CG::Bindings
|
|
4313
5124
|
# @scope class
|
4314
5125
|
attach_function :build_global_string_ptr, :LLVMBuildGlobalStringPtr, [OpaqueBuilder, :string, :string], OpaqueValue
|
4315
5126
|
|
5127
|
+
# (Not documented)
|
5128
|
+
#
|
5129
|
+
# @method get_volatile(memory_access_inst)
|
5130
|
+
# @param [OpaqueValue] memory_access_inst
|
5131
|
+
# @return [Integer]
|
5132
|
+
# @scope class
|
5133
|
+
attach_function :get_volatile, :LLVMGetVolatile, [OpaqueValue], :int
|
5134
|
+
|
5135
|
+
# (Not documented)
|
5136
|
+
#
|
5137
|
+
# @method set_volatile(memory_access_inst, is_volatile)
|
5138
|
+
# @param [OpaqueValue] memory_access_inst
|
5139
|
+
# @param [Integer] is_volatile
|
5140
|
+
# @return [nil]
|
5141
|
+
# @scope class
|
5142
|
+
attach_function :set_volatile, :LLVMSetVolatile, [OpaqueValue, :int], :void
|
5143
|
+
|
4316
5144
|
# Casts
|
4317
5145
|
#
|
4318
5146
|
# @method build_trunc(opaque_builder, val, dest_ty, name)
|
@@ -4445,6 +5273,17 @@ module RLTK::CG::Bindings
|
|
4445
5273
|
# @scope class
|
4446
5274
|
attach_function :build_bit_cast, :LLVMBuildBitCast, [OpaqueBuilder, OpaqueValue, OpaqueType, :string], OpaqueValue
|
4447
5275
|
|
5276
|
+
# (Not documented)
|
5277
|
+
#
|
5278
|
+
# @method build_addr_space_cast(opaque_builder, val, dest_ty, name)
|
5279
|
+
# @param [OpaqueBuilder] opaque_builder
|
5280
|
+
# @param [OpaqueValue] val
|
5281
|
+
# @param [OpaqueType] dest_ty
|
5282
|
+
# @param [String] name
|
5283
|
+
# @return [OpaqueValue]
|
5284
|
+
# @scope class
|
5285
|
+
attach_function :build_addr_space_cast, :LLVMBuildAddrSpaceCast, [OpaqueBuilder, OpaqueValue, OpaqueType, :string], OpaqueValue
|
5286
|
+
|
4448
5287
|
# (Not documented)
|
4449
5288
|
#
|
4450
5289
|
# @method build_z_ext_or_bit_cast(opaque_builder, val, dest_ty, name)
|
@@ -4681,6 +5520,19 @@ module RLTK::CG::Bindings
|
|
4681
5520
|
# @scope class
|
4682
5521
|
attach_function :build_ptr_diff, :LLVMBuildPtrDiff, [OpaqueBuilder, OpaqueValue, OpaqueValue, :string], OpaqueValue
|
4683
5522
|
|
5523
|
+
# (Not documented)
|
5524
|
+
#
|
5525
|
+
# @method build_atomic_rmw(b, op, ptr, val, ordering, single_thread)
|
5526
|
+
# @param [OpaqueBuilder] b
|
5527
|
+
# @param [Symbol from _enum_atomic_rmw_bin_op_] op
|
5528
|
+
# @param [OpaqueValue] ptr
|
5529
|
+
# @param [OpaqueValue] val
|
5530
|
+
# @param [Symbol from _enum_atomic_ordering_] ordering
|
5531
|
+
# @param [Integer] single_thread
|
5532
|
+
# @return [OpaqueValue]
|
5533
|
+
# @scope class
|
5534
|
+
attach_function :build_atomic_rmw, :LLVMBuildAtomicRMW, [OpaqueBuilder, :atomic_rmw_bin_op, OpaqueValue, OpaqueValue, :atomic_ordering, :int], OpaqueValue
|
5535
|
+
|
4684
5536
|
# Changes the type of M so it can be passed to FunctionPassManagers and the
|
4685
5537
|
# JIT. They take ModuleProviders for historical reasons.
|
4686
5538
|
#
|
@@ -4698,7 +5550,9 @@ module RLTK::CG::Bindings
|
|
4698
5550
|
# @scope class
|
4699
5551
|
attach_function :dispose_module_provider, :LLVMDisposeModuleProvider, [OpaqueModuleProvider], :void
|
4700
5552
|
|
4701
|
-
#
|
5553
|
+
# @defgroup LLVMCCoreMemoryBuffers Memory Buffers
|
5554
|
+
#
|
5555
|
+
# @{
|
4702
5556
|
#
|
4703
5557
|
# @method create_memory_buffer_with_contents_of_file(path, out_mem_buf, out_message)
|
4704
5558
|
# @param [String] path
|
@@ -4717,6 +5571,43 @@ module RLTK::CG::Bindings
|
|
4717
5571
|
# @scope class
|
4718
5572
|
attach_function :create_memory_buffer_with_stdin, :LLVMCreateMemoryBufferWithSTDIN, [:pointer, :pointer], :int
|
4719
5573
|
|
5574
|
+
# (Not documented)
|
5575
|
+
#
|
5576
|
+
# @method create_memory_buffer_with_memory_range(input_data, input_data_length, buffer_name, requires_null_terminator)
|
5577
|
+
# @param [String] input_data
|
5578
|
+
# @param [Integer] input_data_length
|
5579
|
+
# @param [String] buffer_name
|
5580
|
+
# @param [Integer] requires_null_terminator
|
5581
|
+
# @return [OpaqueMemoryBuffer]
|
5582
|
+
# @scope class
|
5583
|
+
attach_function :create_memory_buffer_with_memory_range, :LLVMCreateMemoryBufferWithMemoryRange, [:string, :ulong, :string, :int], OpaqueMemoryBuffer
|
5584
|
+
|
5585
|
+
# (Not documented)
|
5586
|
+
#
|
5587
|
+
# @method create_memory_buffer_with_memory_range_copy(input_data, input_data_length, buffer_name)
|
5588
|
+
# @param [String] input_data
|
5589
|
+
# @param [Integer] input_data_length
|
5590
|
+
# @param [String] buffer_name
|
5591
|
+
# @return [OpaqueMemoryBuffer]
|
5592
|
+
# @scope class
|
5593
|
+
attach_function :create_memory_buffer_with_memory_range_copy, :LLVMCreateMemoryBufferWithMemoryRangeCopy, [:string, :ulong, :string], OpaqueMemoryBuffer
|
5594
|
+
|
5595
|
+
# (Not documented)
|
5596
|
+
#
|
5597
|
+
# @method get_buffer_start(mem_buf)
|
5598
|
+
# @param [OpaqueMemoryBuffer] mem_buf
|
5599
|
+
# @return [String]
|
5600
|
+
# @scope class
|
5601
|
+
attach_function :get_buffer_start, :LLVMGetBufferStart, [OpaqueMemoryBuffer], :string
|
5602
|
+
|
5603
|
+
# (Not documented)
|
5604
|
+
#
|
5605
|
+
# @method get_buffer_size(mem_buf)
|
5606
|
+
# @param [OpaqueMemoryBuffer] mem_buf
|
5607
|
+
# @return [Integer]
|
5608
|
+
# @scope class
|
5609
|
+
attach_function :get_buffer_size, :LLVMGetBufferSize, [OpaqueMemoryBuffer], :ulong
|
5610
|
+
|
4720
5611
|
# (Not documented)
|
4721
5612
|
#
|
4722
5613
|
# @method dispose_memory_buffer(mem_buf)
|
@@ -4726,7 +5617,7 @@ module RLTK::CG::Bindings
|
|
4726
5617
|
attach_function :dispose_memory_buffer, :LLVMDisposeMemoryBuffer, [OpaqueMemoryBuffer], :void
|
4727
5618
|
|
4728
5619
|
# Return the global pass registry, for use with initialization functions.
|
4729
|
-
#
|
5620
|
+
# @see llvm::PassRegistry::getPassRegistry
|
4730
5621
|
#
|
4731
5622
|
# @method get_global_pass_registry()
|
4732
5623
|
# @return [OpaquePassRegistry]
|
@@ -4735,7 +5626,7 @@ module RLTK::CG::Bindings
|
|
4735
5626
|
|
4736
5627
|
# Constructs a new whole-module pass pipeline. This type of pipeline is
|
4737
5628
|
# suitable for link-time optimization and whole-module transformations.
|
4738
|
-
#
|
5629
|
+
# @see llvm::PassManager::PassManager
|
4739
5630
|
#
|
4740
5631
|
# @method create_pass_manager()
|
4741
5632
|
# @return [OpaquePassManager]
|
@@ -4745,7 +5636,7 @@ module RLTK::CG::Bindings
|
|
4745
5636
|
# Constructs a new function-by-function pass pipeline over the module
|
4746
5637
|
# provider. It does not take ownership of the module provider. This type of
|
4747
5638
|
# pipeline is suitable for code generation and JIT compilation tasks.
|
4748
|
-
#
|
5639
|
+
# @see llvm::FunctionPassManager::FunctionPassManager
|
4749
5640
|
#
|
4750
5641
|
# @method create_function_pass_manager_for_module(m)
|
4751
5642
|
# @param [OpaqueModule] m
|
@@ -4763,7 +5654,8 @@ module RLTK::CG::Bindings
|
|
4763
5654
|
|
4764
5655
|
# Initializes, executes on the provided module, and finalizes all of the
|
4765
5656
|
# passes scheduled in the pass manager. Returns 1 if any of the passes
|
4766
|
-
# modified the module, 0 otherwise.
|
5657
|
+
# modified the module, 0 otherwise.
|
5658
|
+
# @see llvm::PassManager::run(Module&)
|
4767
5659
|
#
|
4768
5660
|
# @method run_pass_manager(pm, m)
|
4769
5661
|
# @param [OpaquePassManager] pm
|
@@ -4774,7 +5666,7 @@ module RLTK::CG::Bindings
|
|
4774
5666
|
|
4775
5667
|
# Initializes all of the function passes scheduled in the function pass
|
4776
5668
|
# manager. Returns 1 if any of the passes modified the module, 0 otherwise.
|
4777
|
-
#
|
5669
|
+
# @see llvm::FunctionPassManager::doInitialization
|
4778
5670
|
#
|
4779
5671
|
# @method initialize_function_pass_manager(fpm)
|
4780
5672
|
# @param [OpaquePassManager] fpm
|
@@ -4785,7 +5677,7 @@ module RLTK::CG::Bindings
|
|
4785
5677
|
# Executes all of the function passes scheduled in the function pass manager
|
4786
5678
|
# on the provided function. Returns 1 if any of the passes modified the
|
4787
5679
|
# function, false otherwise.
|
4788
|
-
#
|
5680
|
+
# @see llvm::FunctionPassManager::run(Function&)
|
4789
5681
|
#
|
4790
5682
|
# @method run_function_pass_manager(fpm, f)
|
4791
5683
|
# @param [OpaquePassManager] fpm
|
@@ -4796,7 +5688,7 @@ module RLTK::CG::Bindings
|
|
4796
5688
|
|
4797
5689
|
# Finalizes all of the function passes scheduled in in the function pass
|
4798
5690
|
# manager. Returns 1 if any of the passes modified the module, 0 otherwise.
|
4799
|
-
#
|
5691
|
+
# @see llvm::FunctionPassManager::doFinalization
|
4800
5692
|
#
|
4801
5693
|
# @method finalize_function_pass_manager(fpm)
|
4802
5694
|
# @param [OpaquePassManager] fpm
|
@@ -4806,7 +5698,7 @@ module RLTK::CG::Bindings
|
|
4806
5698
|
|
4807
5699
|
# Frees the memory of a pass pipeline. For function pipelines, does not free
|
4808
5700
|
# the module provider.
|
4809
|
-
#
|
5701
|
+
# @see llvm::PassManagerBase::~PassManagerBase.
|
4810
5702
|
#
|
4811
5703
|
# @method dispose_pass_manager(pm)
|
4812
5704
|
# @param [OpaquePassManager] pm
|
@@ -4814,6 +5706,34 @@ module RLTK::CG::Bindings
|
|
4814
5706
|
# @scope class
|
4815
5707
|
attach_function :dispose_pass_manager, :LLVMDisposePassManager, [OpaquePassManager], :void
|
4816
5708
|
|
5709
|
+
# Allocate and initialize structures needed to make LLVM safe for
|
5710
|
+
# multithreading. The return value indicates whether multithreaded
|
5711
|
+
# initialization succeeded. Must be executed in isolation from all
|
5712
|
+
# other LLVM api calls.
|
5713
|
+
# @see llvm::llvm_start_multithreaded
|
5714
|
+
#
|
5715
|
+
# @method start_multithreaded()
|
5716
|
+
# @return [Integer]
|
5717
|
+
# @scope class
|
5718
|
+
attach_function :start_multithreaded, :LLVMStartMultithreaded, [], :int
|
5719
|
+
|
5720
|
+
# Deallocate structures necessary to make LLVM safe for multithreading.
|
5721
|
+
# Must be executed in isolation from all other LLVM api calls.
|
5722
|
+
# @see llvm::llvm_stop_multithreaded
|
5723
|
+
#
|
5724
|
+
# @method stop_multithreaded()
|
5725
|
+
# @return [nil]
|
5726
|
+
# @scope class
|
5727
|
+
attach_function :stop_multithreaded, :LLVMStopMultithreaded, [], :void
|
5728
|
+
|
5729
|
+
# Check whether LLVM is executing in thread-safe mode or not.
|
5730
|
+
# @see llvm::llvm_is_multithreaded
|
5731
|
+
#
|
5732
|
+
# @method is_multithreaded()
|
5733
|
+
# @return [Integer]
|
5734
|
+
# @scope class
|
5735
|
+
attach_function :is_multithreaded, :LLVMIsMultithreaded, [], :int
|
5736
|
+
|
4817
5737
|
# (Not documented)
|
4818
5738
|
#
|
4819
5739
|
# <em>This entry is only for documentation and no real method. The FFI::Enum can be accessed via #enum_type(:verifier_failure_action).</em>
|
@@ -4980,7 +5900,7 @@ module RLTK::CG::Bindings
|
|
4980
5900
|
# instruction are specified by the Offset parameter and its byte widith is the
|
4981
5901
|
# size parameter. For instructions sets with fixed widths and one symbolic
|
4982
5902
|
# operand per instruction, the Offset parameter will be zero and Size parameter
|
4983
|
-
# will be the instruction width. The information is returned in TagBuf and is
|
5903
|
+
# will be the instruction width. The information is returned in TagBuf and is
|
4984
5904
|
# Triple specific with its specific information defined by the value of
|
4985
5905
|
# TagType for that Triple. If symbolic information is returned the function
|
4986
5906
|
# returns 1, otherwise it returns 0.
|
@@ -5073,7 +5993,8 @@ module RLTK::CG::Bindings
|
|
5073
5993
|
# by passing a block of information in the DisInfo parameter and specifying the
|
5074
5994
|
# TagType and callback functions as described above. These can all be passed
|
5075
5995
|
# as NULL. If successful, this returns a disassembler context. If not, it
|
5076
|
-
# returns NULL.
|
5996
|
+
# returns NULL. This function is equivalent to calling LLVMCreateDisasmCPU()
|
5997
|
+
# with an empty CPU name.
|
5077
5998
|
#
|
5078
5999
|
# @method create_disasm(triple_name, dis_info, tag_type, get_op_info, symbol_look_up)
|
5079
6000
|
# @param [String] triple_name
|
@@ -5085,6 +6006,33 @@ module RLTK::CG::Bindings
|
|
5085
6006
|
# @scope class
|
5086
6007
|
attach_function :create_disasm, :LLVMCreateDisasm, [:string, :pointer, :int, :op_info_callback, :symbol_lookup_callback], :pointer
|
5087
6008
|
|
6009
|
+
# Create a disassembler for the TripleName and a specific CPU. Symbolic
|
6010
|
+
# disassembly is supported by passing a block of information in the DisInfo
|
6011
|
+
# parameter and specifying the TagType and callback functions as described
|
6012
|
+
# above. These can all be passed * as NULL. If successful, this returns a
|
6013
|
+
# disassembler context. If not, it returns NULL.
|
6014
|
+
#
|
6015
|
+
# @method create_disasm_cpu(triple, cpu, dis_info, tag_type, get_op_info, symbol_look_up)
|
6016
|
+
# @param [String] triple
|
6017
|
+
# @param [String] cpu
|
6018
|
+
# @param [FFI::Pointer(*Void)] dis_info
|
6019
|
+
# @param [Integer] tag_type
|
6020
|
+
# @param [Proc(_callback_op_info_callback_)] get_op_info
|
6021
|
+
# @param [Proc(_callback_symbol_lookup_callback_)] symbol_look_up
|
6022
|
+
# @return [FFI::Pointer(DisasmContextRef)]
|
6023
|
+
# @scope class
|
6024
|
+
attach_function :create_disasm_cpu, :LLVMCreateDisasmCPU, [:string, :string, :pointer, :int, :op_info_callback, :symbol_lookup_callback], :pointer
|
6025
|
+
|
6026
|
+
# Set the disassembler's options. Returns 1 if it can set the Options and 0
|
6027
|
+
# otherwise.
|
6028
|
+
#
|
6029
|
+
# @method set_disasm_options(dc, options)
|
6030
|
+
# @param [FFI::Pointer(DisasmContextRef)] dc
|
6031
|
+
# @param [Integer] options
|
6032
|
+
# @return [Integer]
|
6033
|
+
# @scope class
|
6034
|
+
attach_function :set_disasm_options, :LLVMSetDisasmOptions, [:pointer, :ulong], :int
|
6035
|
+
|
5088
6036
|
# Dispose of a disassembler context.
|
5089
6037
|
#
|
5090
6038
|
# @method disasm_dispose(dc)
|
@@ -5102,10 +6050,16 @@ module RLTK::CG::Bindings
|
|
5102
6050
|
# function returns the number of bytes in the instruction or zero if there was
|
5103
6051
|
# no valid instruction.
|
5104
6052
|
#
|
5105
|
-
# @method disasm_instruction()
|
6053
|
+
# @method disasm_instruction(dc, bytes, bytes_size, pc, out_string, out_string_size)
|
6054
|
+
# @param [FFI::Pointer(DisasmContextRef)] dc
|
6055
|
+
# @param [FFI::Pointer(*Uint8T)] bytes
|
6056
|
+
# @param [Integer] bytes_size
|
6057
|
+
# @param [Integer] pc
|
6058
|
+
# @param [String] out_string
|
6059
|
+
# @param [Integer] out_string_size
|
5106
6060
|
# @return [Integer]
|
5107
6061
|
# @scope class
|
5108
|
-
attach_function :disasm_instruction, :LLVMDisasmInstruction, [], :
|
6062
|
+
attach_function :disasm_instruction, :LLVMDisasmInstruction, [:pointer, :pointer, :ulong, :ulong, :string, :ulong], :ulong
|
5109
6063
|
|
5110
6064
|
# (Not documented)
|
5111
6065
|
#
|
@@ -5135,11 +6089,6 @@ module RLTK::CG::Bindings
|
|
5135
6089
|
layout :dummy, :char
|
5136
6090
|
end
|
5137
6091
|
|
5138
|
-
# (Not documented)
|
5139
|
-
class StructLayout < FFI::Struct
|
5140
|
-
layout :dummy, :char
|
5141
|
-
end
|
5142
|
-
|
5143
6092
|
# (Not documented)
|
5144
6093
|
#
|
5145
6094
|
# @method initialize_all_target_infos()
|
@@ -5156,8 +6105,44 @@ module RLTK::CG::Bindings
|
|
5156
6105
|
# @scope class
|
5157
6106
|
attach_function :initialize_all_targets, :LLVMInitializeAllTargets, [], :void
|
5158
6107
|
|
5159
|
-
#
|
5160
|
-
#
|
6108
|
+
# LLVMInitializeAllTargetMCs - The main program should call this function if
|
6109
|
+
# it wants access to all available target MC that LLVM is configured to
|
6110
|
+
# support.
|
6111
|
+
#
|
6112
|
+
# @method initialize_all_target_m_cs()
|
6113
|
+
# @return [nil]
|
6114
|
+
# @scope class
|
6115
|
+
attach_function :initialize_all_target_mcs, :LLVMInitializeAllTargetMCs, [], :void
|
6116
|
+
|
6117
|
+
# LLVMInitializeAllAsmPrinters - The main program should call this function if
|
6118
|
+
# it wants all asm printers that LLVM is configured to support, to make them
|
6119
|
+
# available via the TargetRegistry.
|
6120
|
+
#
|
6121
|
+
# @method initialize_all_asm_printers()
|
6122
|
+
# @return [nil]
|
6123
|
+
# @scope class
|
6124
|
+
attach_function :initialize_all_asm_printers, :LLVMInitializeAllAsmPrinters, [], :void
|
6125
|
+
|
6126
|
+
# LLVMInitializeAllAsmParsers - The main program should call this function if
|
6127
|
+
# it wants all asm parsers that LLVM is configured to support, to make them
|
6128
|
+
# available via the TargetRegistry.
|
6129
|
+
#
|
6130
|
+
# @method initialize_all_asm_parsers()
|
6131
|
+
# @return [nil]
|
6132
|
+
# @scope class
|
6133
|
+
attach_function :initialize_all_asm_parsers, :LLVMInitializeAllAsmParsers, [], :void
|
6134
|
+
|
6135
|
+
# LLVMInitializeAllDisassemblers - The main program should call this function
|
6136
|
+
# if it wants all disassemblers that LLVM is configured to support, to make
|
6137
|
+
# them available via the TargetRegistry.
|
6138
|
+
#
|
6139
|
+
# @method initialize_all_disassemblers()
|
6140
|
+
# @return [nil]
|
6141
|
+
# @scope class
|
6142
|
+
attach_function :initialize_all_disassemblers, :LLVMInitializeAllDisassemblers, [], :void
|
6143
|
+
|
6144
|
+
# LLVMInitializeNativeTarget - The main program should call this function to
|
6145
|
+
# initialize the native target corresponding to the host. This is useful
|
5161
6146
|
# for JIT applications to ensure that the target gets linked in correctly.
|
5162
6147
|
#
|
5163
6148
|
# @method initialize_native_target()
|
@@ -5165,8 +6150,35 @@ module RLTK::CG::Bindings
|
|
5165
6150
|
# @scope class
|
5166
6151
|
attach_function :initialize_native_target, :LLVMInitializeNativeTarget, [], :int
|
5167
6152
|
|
6153
|
+
# LLVMInitializeNativeTargetAsmParser - The main program should call this
|
6154
|
+
# function to initialize the parser for the native target corresponding to the
|
6155
|
+
# host.
|
6156
|
+
#
|
6157
|
+
# @method initialize_native_asm_parser()
|
6158
|
+
# @return [Integer]
|
6159
|
+
# @scope class
|
6160
|
+
attach_function :initialize_native_asm_parser, :LLVMInitializeNativeAsmParser, [], :int
|
6161
|
+
|
6162
|
+
# LLVMInitializeNativeTargetAsmPrinter - The main program should call this
|
6163
|
+
# function to initialize the printer for the native target corresponding to
|
6164
|
+
# the host.
|
6165
|
+
#
|
6166
|
+
# @method initialize_native_asm_printer()
|
6167
|
+
# @return [Integer]
|
6168
|
+
# @scope class
|
6169
|
+
attach_function :initialize_native_asm_printer, :LLVMInitializeNativeAsmPrinter, [], :int
|
6170
|
+
|
6171
|
+
# LLVMInitializeNativeTargetDisassembler - The main program should call this
|
6172
|
+
# function to initialize the disassembler for the native target corresponding
|
6173
|
+
# to the host.
|
6174
|
+
#
|
6175
|
+
# @method initialize_native_disassembler()
|
6176
|
+
# @return [Integer]
|
6177
|
+
# @scope class
|
6178
|
+
attach_function :initialize_native_disassembler, :LLVMInitializeNativeDisassembler, [], :int
|
6179
|
+
|
5168
6180
|
# Creates target data from a target layout string.
|
5169
|
-
# See the constructor llvm::
|
6181
|
+
# See the constructor llvm::DataLayout::DataLayout.
|
5170
6182
|
#
|
5171
6183
|
# @method create_target_data(string_rep)
|
5172
6184
|
# @param [String] string_rep
|
@@ -5178,9 +6190,9 @@ module RLTK::CG::Bindings
|
|
5178
6190
|
# of the target data.
|
5179
6191
|
# See the method llvm::PassManagerBase::add.
|
5180
6192
|
#
|
5181
|
-
# @method add_target_data(
|
5182
|
-
# @param [OpaqueTargetData]
|
5183
|
-
# @param [OpaquePassManager]
|
6193
|
+
# @method add_target_data(td, pm)
|
6194
|
+
# @param [OpaqueTargetData] td
|
6195
|
+
# @param [OpaquePassManager] pm
|
5184
6196
|
# @return [nil]
|
5185
6197
|
# @scope class
|
5186
6198
|
attach_function :add_target_data, :LLVMAddTargetData, [OpaqueTargetData, OpaquePassManager], :void
|
@@ -5189,116 +6201,160 @@ module RLTK::CG::Bindings
|
|
5189
6201
|
# ownership of the target library info.
|
5190
6202
|
# See the method llvm::PassManagerBase::add.
|
5191
6203
|
#
|
5192
|
-
# @method add_target_library_info(
|
5193
|
-
# @param [OpaqueTargetLibraryInfotData]
|
5194
|
-
# @param [OpaquePassManager]
|
6204
|
+
# @method add_target_library_info(tli, pm)
|
6205
|
+
# @param [OpaqueTargetLibraryInfotData] tli
|
6206
|
+
# @param [OpaquePassManager] pm
|
5195
6207
|
# @return [nil]
|
5196
6208
|
# @scope class
|
5197
6209
|
attach_function :add_target_library_info, :LLVMAddTargetLibraryInfo, [OpaqueTargetLibraryInfotData, OpaquePassManager], :void
|
5198
6210
|
|
5199
6211
|
# Converts target data to a target layout string. The string must be disposed
|
5200
6212
|
# with LLVMDisposeMessage.
|
5201
|
-
# See the constructor llvm::
|
6213
|
+
# See the constructor llvm::DataLayout::DataLayout.
|
5202
6214
|
#
|
5203
|
-
# @method copy_string_rep_of_target_data(
|
5204
|
-
# @param [OpaqueTargetData]
|
6215
|
+
# @method copy_string_rep_of_target_data(td)
|
6216
|
+
# @param [OpaqueTargetData] td
|
5205
6217
|
# @return [String]
|
5206
6218
|
# @scope class
|
5207
6219
|
attach_function :copy_string_rep_of_target_data, :LLVMCopyStringRepOfTargetData, [OpaqueTargetData], :string
|
5208
6220
|
|
5209
6221
|
# Returns the byte order of a target, either LLVMBigEndian or
|
5210
6222
|
# LLVMLittleEndian.
|
5211
|
-
# See the method llvm::
|
6223
|
+
# See the method llvm::DataLayout::isLittleEndian.
|
5212
6224
|
#
|
5213
|
-
# @method byte_order(
|
5214
|
-
# @param [OpaqueTargetData]
|
6225
|
+
# @method byte_order(td)
|
6226
|
+
# @param [OpaqueTargetData] td
|
5215
6227
|
# @return [Symbol from _enum_byte_ordering_]
|
5216
6228
|
# @scope class
|
5217
6229
|
attach_function :byte_order, :LLVMByteOrder, [OpaqueTargetData], :byte_ordering
|
5218
6230
|
|
5219
6231
|
# Returns the pointer size in bytes for a target.
|
5220
|
-
# See the method llvm::
|
6232
|
+
# See the method llvm::DataLayout::getPointerSize.
|
5221
6233
|
#
|
5222
|
-
# @method pointer_size(
|
5223
|
-
# @param [OpaqueTargetData]
|
6234
|
+
# @method pointer_size(td)
|
6235
|
+
# @param [OpaqueTargetData] td
|
5224
6236
|
# @return [Integer]
|
5225
6237
|
# @scope class
|
5226
6238
|
attach_function :pointer_size, :LLVMPointerSize, [OpaqueTargetData], :uint
|
5227
6239
|
|
6240
|
+
# Returns the pointer size in bytes for a target for a specified
|
6241
|
+
# address space.
|
6242
|
+
# See the method llvm::DataLayout::getPointerSize.
|
6243
|
+
#
|
6244
|
+
# @method pointer_size_for_as(td, as)
|
6245
|
+
# @param [OpaqueTargetData] td
|
6246
|
+
# @param [Integer] as
|
6247
|
+
# @return [Integer]
|
6248
|
+
# @scope class
|
6249
|
+
attach_function :pointer_size_for_as, :LLVMPointerSizeForAS, [OpaqueTargetData, :uint], :uint
|
6250
|
+
|
5228
6251
|
# Returns the integer type that is the same size as a pointer on a target.
|
5229
|
-
# See the method llvm::
|
6252
|
+
# See the method llvm::DataLayout::getIntPtrType.
|
5230
6253
|
#
|
5231
|
-
# @method int_ptr_type(
|
5232
|
-
# @param [OpaqueTargetData]
|
6254
|
+
# @method int_ptr_type(td)
|
6255
|
+
# @param [OpaqueTargetData] td
|
5233
6256
|
# @return [OpaqueType]
|
5234
6257
|
# @scope class
|
5235
6258
|
attach_function :int_ptr_type, :LLVMIntPtrType, [OpaqueTargetData], OpaqueType
|
5236
6259
|
|
6260
|
+
# Returns the integer type that is the same size as a pointer on a target.
|
6261
|
+
# This version allows the address space to be specified.
|
6262
|
+
# See the method llvm::DataLayout::getIntPtrType.
|
6263
|
+
#
|
6264
|
+
# @method int_ptr_type_for_as(td, as)
|
6265
|
+
# @param [OpaqueTargetData] td
|
6266
|
+
# @param [Integer] as
|
6267
|
+
# @return [OpaqueType]
|
6268
|
+
# @scope class
|
6269
|
+
attach_function :int_ptr_type_for_as, :LLVMIntPtrTypeForAS, [OpaqueTargetData, :uint], OpaqueType
|
6270
|
+
|
6271
|
+
# Returns the integer type that is the same size as a pointer on a target.
|
6272
|
+
# See the method llvm::DataLayout::getIntPtrType.
|
6273
|
+
#
|
6274
|
+
# @method int_ptr_type_in_context(c, td)
|
6275
|
+
# @param [OpaqueContext] c
|
6276
|
+
# @param [OpaqueTargetData] td
|
6277
|
+
# @return [OpaqueType]
|
6278
|
+
# @scope class
|
6279
|
+
attach_function :int_ptr_type_in_context, :LLVMIntPtrTypeInContext, [OpaqueContext, OpaqueTargetData], OpaqueType
|
6280
|
+
|
6281
|
+
# Returns the integer type that is the same size as a pointer on a target.
|
6282
|
+
# This version allows the address space to be specified.
|
6283
|
+
# See the method llvm::DataLayout::getIntPtrType.
|
6284
|
+
#
|
6285
|
+
# @method int_ptr_type_for_as_in_context(c, td, as)
|
6286
|
+
# @param [OpaqueContext] c
|
6287
|
+
# @param [OpaqueTargetData] td
|
6288
|
+
# @param [Integer] as
|
6289
|
+
# @return [OpaqueType]
|
6290
|
+
# @scope class
|
6291
|
+
attach_function :int_ptr_type_for_as_in_context, :LLVMIntPtrTypeForASInContext, [OpaqueContext, OpaqueTargetData, :uint], OpaqueType
|
6292
|
+
|
5237
6293
|
# Computes the size of a type in bytes for a target.
|
5238
|
-
# See the method llvm::
|
6294
|
+
# See the method llvm::DataLayout::getTypeSizeInBits.
|
5239
6295
|
#
|
5240
|
-
# @method size_of_type_in_bits(
|
5241
|
-
# @param [OpaqueTargetData]
|
5242
|
-
# @param [OpaqueType]
|
6296
|
+
# @method size_of_type_in_bits(td, ty)
|
6297
|
+
# @param [OpaqueTargetData] td
|
6298
|
+
# @param [OpaqueType] ty
|
5243
6299
|
# @return [Integer]
|
5244
6300
|
# @scope class
|
5245
6301
|
attach_function :size_of_type_in_bits, :LLVMSizeOfTypeInBits, [OpaqueTargetData, OpaqueType], :ulong_long
|
5246
6302
|
|
5247
6303
|
# Computes the storage size of a type in bytes for a target.
|
5248
|
-
# See the method llvm::
|
6304
|
+
# See the method llvm::DataLayout::getTypeStoreSize.
|
5249
6305
|
#
|
5250
|
-
# @method store_size_of_type(
|
5251
|
-
# @param [OpaqueTargetData]
|
5252
|
-
# @param [OpaqueType]
|
6306
|
+
# @method store_size_of_type(td, ty)
|
6307
|
+
# @param [OpaqueTargetData] td
|
6308
|
+
# @param [OpaqueType] ty
|
5253
6309
|
# @return [Integer]
|
5254
6310
|
# @scope class
|
5255
6311
|
attach_function :store_size_of_type, :LLVMStoreSizeOfType, [OpaqueTargetData, OpaqueType], :ulong_long
|
5256
6312
|
|
5257
6313
|
# Computes the ABI size of a type in bytes for a target.
|
5258
|
-
# See the method llvm::
|
6314
|
+
# See the method llvm::DataLayout::getTypeAllocSize.
|
5259
6315
|
#
|
5260
|
-
# @method abi_size_of_type(
|
5261
|
-
# @param [OpaqueTargetData]
|
5262
|
-
# @param [OpaqueType]
|
6316
|
+
# @method abi_size_of_type(td, ty)
|
6317
|
+
# @param [OpaqueTargetData] td
|
6318
|
+
# @param [OpaqueType] ty
|
5263
6319
|
# @return [Integer]
|
5264
6320
|
# @scope class
|
5265
6321
|
attach_function :abi_size_of_type, :LLVMABISizeOfType, [OpaqueTargetData, OpaqueType], :ulong_long
|
5266
6322
|
|
5267
6323
|
# Computes the ABI alignment of a type in bytes for a target.
|
5268
|
-
# See the method llvm::
|
6324
|
+
# See the method llvm::DataLayout::getTypeABISize.
|
5269
6325
|
#
|
5270
|
-
# @method abi_alignment_of_type(
|
5271
|
-
# @param [OpaqueTargetData]
|
5272
|
-
# @param [OpaqueType]
|
6326
|
+
# @method abi_alignment_of_type(td, ty)
|
6327
|
+
# @param [OpaqueTargetData] td
|
6328
|
+
# @param [OpaqueType] ty
|
5273
6329
|
# @return [Integer]
|
5274
6330
|
# @scope class
|
5275
6331
|
attach_function :abi_alignment_of_type, :LLVMABIAlignmentOfType, [OpaqueTargetData, OpaqueType], :uint
|
5276
6332
|
|
5277
6333
|
# Computes the call frame alignment of a type in bytes for a target.
|
5278
|
-
# See the method llvm::
|
6334
|
+
# See the method llvm::DataLayout::getTypeABISize.
|
5279
6335
|
#
|
5280
|
-
# @method call_frame_alignment_of_type(
|
5281
|
-
# @param [OpaqueTargetData]
|
5282
|
-
# @param [OpaqueType]
|
6336
|
+
# @method call_frame_alignment_of_type(td, ty)
|
6337
|
+
# @param [OpaqueTargetData] td
|
6338
|
+
# @param [OpaqueType] ty
|
5283
6339
|
# @return [Integer]
|
5284
6340
|
# @scope class
|
5285
6341
|
attach_function :call_frame_alignment_of_type, :LLVMCallFrameAlignmentOfType, [OpaqueTargetData, OpaqueType], :uint
|
5286
6342
|
|
5287
6343
|
# Computes the preferred alignment of a type in bytes for a target.
|
5288
|
-
# See the method llvm::
|
6344
|
+
# See the method llvm::DataLayout::getTypeABISize.
|
5289
6345
|
#
|
5290
|
-
# @method preferred_alignment_of_type(
|
5291
|
-
# @param [OpaqueTargetData]
|
5292
|
-
# @param [OpaqueType]
|
6346
|
+
# @method preferred_alignment_of_type(td, ty)
|
6347
|
+
# @param [OpaqueTargetData] td
|
6348
|
+
# @param [OpaqueType] ty
|
5293
6349
|
# @return [Integer]
|
5294
6350
|
# @scope class
|
5295
6351
|
attach_function :preferred_alignment_of_type, :LLVMPreferredAlignmentOfType, [OpaqueTargetData, OpaqueType], :uint
|
5296
6352
|
|
5297
6353
|
# Computes the preferred alignment of a global variable in bytes for a target.
|
5298
|
-
# See the method llvm::
|
6354
|
+
# See the method llvm::DataLayout::getPreferredAlignment.
|
5299
6355
|
#
|
5300
|
-
# @method preferred_alignment_of_global(
|
5301
|
-
# @param [OpaqueTargetData]
|
6356
|
+
# @method preferred_alignment_of_global(td, global_var)
|
6357
|
+
# @param [OpaqueTargetData] td
|
5302
6358
|
# @param [OpaqueValue] global_var
|
5303
6359
|
# @return [Integer]
|
5304
6360
|
# @scope class
|
@@ -5307,8 +6363,8 @@ module RLTK::CG::Bindings
|
|
5307
6363
|
# Computes the structure element that contains the byte offset for a target.
|
5308
6364
|
# See the method llvm::StructLayout::getElementContainingOffset.
|
5309
6365
|
#
|
5310
|
-
# @method element_at_offset(
|
5311
|
-
# @param [OpaqueTargetData]
|
6366
|
+
# @method element_at_offset(td, struct_ty, offset)
|
6367
|
+
# @param [OpaqueTargetData] td
|
5312
6368
|
# @param [OpaqueType] struct_ty
|
5313
6369
|
# @param [Integer] offset
|
5314
6370
|
# @return [Integer]
|
@@ -5318,8 +6374,8 @@ module RLTK::CG::Bindings
|
|
5318
6374
|
# Computes the byte offset of the indexed struct element for a target.
|
5319
6375
|
# See the method llvm::StructLayout::getElementContainingOffset.
|
5320
6376
|
#
|
5321
|
-
# @method offset_of_element(
|
5322
|
-
# @param [OpaqueTargetData]
|
6377
|
+
# @method offset_of_element(td, struct_ty, element)
|
6378
|
+
# @param [OpaqueTargetData] td
|
5323
6379
|
# @param [OpaqueType] struct_ty
|
5324
6380
|
# @param [Integer] element
|
5325
6381
|
# @return [Integer]
|
@@ -5327,14 +6383,323 @@ module RLTK::CG::Bindings
|
|
5327
6383
|
attach_function :offset_of_element, :LLVMOffsetOfElement, [OpaqueTargetData, OpaqueType, :uint], :ulong_long
|
5328
6384
|
|
5329
6385
|
# Deallocates a TargetData.
|
5330
|
-
# See the destructor llvm::
|
6386
|
+
# See the destructor llvm::DataLayout::~DataLayout.
|
5331
6387
|
#
|
5332
|
-
# @method dispose_target_data(
|
5333
|
-
# @param [OpaqueTargetData]
|
6388
|
+
# @method dispose_target_data(td)
|
6389
|
+
# @param [OpaqueTargetData] td
|
5334
6390
|
# @return [nil]
|
5335
6391
|
# @scope class
|
5336
6392
|
attach_function :dispose_target_data, :LLVMDisposeTargetData, [OpaqueTargetData], :void
|
5337
6393
|
|
6394
|
+
# (Not documented)
|
6395
|
+
class OpaqueTargetMachine < FFI::Struct
|
6396
|
+
layout :dummy, :char
|
6397
|
+
end
|
6398
|
+
|
6399
|
+
# (Not documented)
|
6400
|
+
module TargetWrappers
|
6401
|
+
def has_jit()
|
6402
|
+
RLTK::CG::Bindings.target_has_jit(self)
|
6403
|
+
end
|
6404
|
+
|
6405
|
+
def has_target_machine()
|
6406
|
+
RLTK::CG::Bindings.target_has_target_machine(self)
|
6407
|
+
end
|
6408
|
+
|
6409
|
+
def has_asm_backend()
|
6410
|
+
RLTK::CG::Bindings.target_has_asm_backend(self)
|
6411
|
+
end
|
6412
|
+
end
|
6413
|
+
|
6414
|
+
class Target < FFI::Struct
|
6415
|
+
include TargetWrappers
|
6416
|
+
layout :dummy, :char
|
6417
|
+
end
|
6418
|
+
|
6419
|
+
# (Not documented)
|
6420
|
+
#
|
6421
|
+
# <em>This entry is only for documentation and no real method. The FFI::Enum can be accessed via #enum_type(:code_gen_opt_level).</em>
|
6422
|
+
#
|
6423
|
+
# === Options:
|
6424
|
+
# :none ::
|
6425
|
+
#
|
6426
|
+
# :less ::
|
6427
|
+
#
|
6428
|
+
# :default ::
|
6429
|
+
#
|
6430
|
+
# :aggressive ::
|
6431
|
+
#
|
6432
|
+
#
|
6433
|
+
# @method _enum_code_gen_opt_level_
|
6434
|
+
# @return [Symbol]
|
6435
|
+
# @scope class
|
6436
|
+
enum :code_gen_opt_level, [
|
6437
|
+
:none, 0,
|
6438
|
+
:less, 1,
|
6439
|
+
:default, 2,
|
6440
|
+
:aggressive, 3
|
6441
|
+
]
|
6442
|
+
|
6443
|
+
# (Not documented)
|
6444
|
+
#
|
6445
|
+
# <em>This entry is only for documentation and no real method. The FFI::Enum can be accessed via #enum_type(:reloc_mode).</em>
|
6446
|
+
#
|
6447
|
+
# === Options:
|
6448
|
+
# :default ::
|
6449
|
+
#
|
6450
|
+
# :static ::
|
6451
|
+
#
|
6452
|
+
# :pic ::
|
6453
|
+
#
|
6454
|
+
# :dynamic_no_pic ::
|
6455
|
+
#
|
6456
|
+
#
|
6457
|
+
# @method _enum_reloc_mode_
|
6458
|
+
# @return [Symbol]
|
6459
|
+
# @scope class
|
6460
|
+
enum :reloc_mode, [
|
6461
|
+
:default, 0,
|
6462
|
+
:static, 1,
|
6463
|
+
:pic, 2,
|
6464
|
+
:dynamic_no_pic, 3
|
6465
|
+
]
|
6466
|
+
|
6467
|
+
# (Not documented)
|
6468
|
+
#
|
6469
|
+
# <em>This entry is only for documentation and no real method. The FFI::Enum can be accessed via #enum_type(:code_model).</em>
|
6470
|
+
#
|
6471
|
+
# === Options:
|
6472
|
+
# :default ::
|
6473
|
+
#
|
6474
|
+
# :jit_default ::
|
6475
|
+
#
|
6476
|
+
# :small ::
|
6477
|
+
#
|
6478
|
+
# :kernel ::
|
6479
|
+
#
|
6480
|
+
# :medium ::
|
6481
|
+
#
|
6482
|
+
# :large ::
|
6483
|
+
#
|
6484
|
+
#
|
6485
|
+
# @method _enum_code_model_
|
6486
|
+
# @return [Symbol]
|
6487
|
+
# @scope class
|
6488
|
+
enum :code_model, [
|
6489
|
+
:default, 0,
|
6490
|
+
:jit_default, 1,
|
6491
|
+
:small, 2,
|
6492
|
+
:kernel, 3,
|
6493
|
+
:medium, 4,
|
6494
|
+
:large, 5
|
6495
|
+
]
|
6496
|
+
|
6497
|
+
# (Not documented)
|
6498
|
+
#
|
6499
|
+
# <em>This entry is only for documentation and no real method. The FFI::Enum can be accessed via #enum_type(:code_gen_file_type).</em>
|
6500
|
+
#
|
6501
|
+
# === Options:
|
6502
|
+
# :assembly ::
|
6503
|
+
#
|
6504
|
+
# :object ::
|
6505
|
+
#
|
6506
|
+
#
|
6507
|
+
# @method _enum_code_gen_file_type_
|
6508
|
+
# @return [Symbol]
|
6509
|
+
# @scope class
|
6510
|
+
enum :code_gen_file_type, [
|
6511
|
+
:assembly, 0,
|
6512
|
+
:object, 1
|
6513
|
+
]
|
6514
|
+
|
6515
|
+
# Returns the first llvm::Target in the registered targets list.
|
6516
|
+
#
|
6517
|
+
# @method get_first_target()
|
6518
|
+
# @return [Target]
|
6519
|
+
# @scope class
|
6520
|
+
attach_function :get_first_target, :LLVMGetFirstTarget, [], Target
|
6521
|
+
|
6522
|
+
# Returns the next llvm::Target given a previous one (or null if there's none)
|
6523
|
+
#
|
6524
|
+
# @method get_next_target(t)
|
6525
|
+
# @param [Target] t
|
6526
|
+
# @return [Target]
|
6527
|
+
# @scope class
|
6528
|
+
attach_function :get_next_target, :LLVMGetNextTarget, [Target], Target
|
6529
|
+
|
6530
|
+
# Finds the target corresponding to the given name and stores it in \p T.
|
6531
|
+
# Returns 0 on success.
|
6532
|
+
#
|
6533
|
+
# @method get_target_from_name(name)
|
6534
|
+
# @param [String] name
|
6535
|
+
# @return [Target]
|
6536
|
+
# @scope class
|
6537
|
+
attach_function :get_target_from_name, :LLVMGetTargetFromName, [:string], Target
|
6538
|
+
|
6539
|
+
# Finds the target corresponding to the given triple and stores it in \p T.
|
6540
|
+
# Returns 0 on success. Optionally returns any error in ErrorMessage.
|
6541
|
+
# Use LLVMDisposeMessage to dispose the message.
|
6542
|
+
#
|
6543
|
+
# @method get_target_from_triple(triple, t, error_message)
|
6544
|
+
# @param [String] triple
|
6545
|
+
# @param [FFI::Pointer(*TargetRef)] t
|
6546
|
+
# @param [FFI::Pointer(**CharS)] error_message
|
6547
|
+
# @return [Integer]
|
6548
|
+
# @scope class
|
6549
|
+
attach_function :get_target_from_triple, :LLVMGetTargetFromTriple, [:string, :pointer, :pointer], :int
|
6550
|
+
|
6551
|
+
# Returns the name of a target. See llvm::Target::getName
|
6552
|
+
#
|
6553
|
+
# @method get_target_name(t)
|
6554
|
+
# @param [Target] t
|
6555
|
+
# @return [String]
|
6556
|
+
# @scope class
|
6557
|
+
attach_function :get_target_name, :LLVMGetTargetName, [Target], :string
|
6558
|
+
|
6559
|
+
# Returns the description of a target. See llvm::Target::getDescription
|
6560
|
+
#
|
6561
|
+
# @method get_target_description(t)
|
6562
|
+
# @param [Target] t
|
6563
|
+
# @return [String]
|
6564
|
+
# @scope class
|
6565
|
+
attach_function :get_target_description, :LLVMGetTargetDescription, [Target], :string
|
6566
|
+
|
6567
|
+
# Returns if the target has a JIT
|
6568
|
+
#
|
6569
|
+
# @method target_has_jit(t)
|
6570
|
+
# @param [Target] t
|
6571
|
+
# @return [Integer]
|
6572
|
+
# @scope class
|
6573
|
+
attach_function :target_has_jit, :LLVMTargetHasJIT, [Target], :int
|
6574
|
+
|
6575
|
+
# Returns if the target has a TargetMachine associated
|
6576
|
+
#
|
6577
|
+
# @method target_has_target_machine(t)
|
6578
|
+
# @param [Target] t
|
6579
|
+
# @return [Integer]
|
6580
|
+
# @scope class
|
6581
|
+
attach_function :target_has_target_machine, :LLVMTargetHasTargetMachine, [Target], :int
|
6582
|
+
|
6583
|
+
# Returns if the target as an ASM backend (required for emitting output)
|
6584
|
+
#
|
6585
|
+
# @method target_has_asm_backend(t)
|
6586
|
+
# @param [Target] t
|
6587
|
+
# @return [Integer]
|
6588
|
+
# @scope class
|
6589
|
+
attach_function :target_has_asm_backend, :LLVMTargetHasAsmBackend, [Target], :int
|
6590
|
+
|
6591
|
+
# Creates a new llvm::TargetMachine. See llvm::Target::createTargetMachine
|
6592
|
+
#
|
6593
|
+
# @method create_target_machine(t, triple, cpu, features, level, reloc, code_model)
|
6594
|
+
# @param [Target] t
|
6595
|
+
# @param [String] triple
|
6596
|
+
# @param [String] cpu
|
6597
|
+
# @param [String] features
|
6598
|
+
# @param [Symbol from _enum_code_gen_opt_level_] level
|
6599
|
+
# @param [Symbol from _enum_reloc_mode_] reloc
|
6600
|
+
# @param [Symbol from _enum_code_model_] code_model
|
6601
|
+
# @return [OpaqueTargetMachine]
|
6602
|
+
# @scope class
|
6603
|
+
attach_function :create_target_machine, :LLVMCreateTargetMachine, [Target, :string, :string, :string, :code_gen_opt_level, :reloc_mode, :code_model], OpaqueTargetMachine
|
6604
|
+
|
6605
|
+
# Dispose the LLVMTargetMachineRef instance generated by
|
6606
|
+
# LLVMCreateTargetMachine.
|
6607
|
+
#
|
6608
|
+
# @method dispose_target_machine(t)
|
6609
|
+
# @param [OpaqueTargetMachine] t
|
6610
|
+
# @return [nil]
|
6611
|
+
# @scope class
|
6612
|
+
attach_function :dispose_target_machine, :LLVMDisposeTargetMachine, [OpaqueTargetMachine], :void
|
6613
|
+
|
6614
|
+
# Returns the Target used in a TargetMachine
|
6615
|
+
#
|
6616
|
+
# @method get_target_machine_target(t)
|
6617
|
+
# @param [OpaqueTargetMachine] t
|
6618
|
+
# @return [Target]
|
6619
|
+
# @scope class
|
6620
|
+
attach_function :get_target_machine_target, :LLVMGetTargetMachineTarget, [OpaqueTargetMachine], Target
|
6621
|
+
|
6622
|
+
# Returns the triple used creating this target machine. See
|
6623
|
+
# llvm::TargetMachine::getTriple. The result needs to be disposed with
|
6624
|
+
# LLVMDisposeMessage.
|
6625
|
+
#
|
6626
|
+
# @method get_target_machine_triple(t)
|
6627
|
+
# @param [OpaqueTargetMachine] t
|
6628
|
+
# @return [String]
|
6629
|
+
# @scope class
|
6630
|
+
attach_function :get_target_machine_triple, :LLVMGetTargetMachineTriple, [OpaqueTargetMachine], :string
|
6631
|
+
|
6632
|
+
# Returns the cpu used creating this target machine. See
|
6633
|
+
# llvm::TargetMachine::getCPU. The result needs to be disposed with
|
6634
|
+
# LLVMDisposeMessage.
|
6635
|
+
#
|
6636
|
+
# @method get_target_machine_cpu(t)
|
6637
|
+
# @param [OpaqueTargetMachine] t
|
6638
|
+
# @return [String]
|
6639
|
+
# @scope class
|
6640
|
+
attach_function :get_target_machine_cpu, :LLVMGetTargetMachineCPU, [OpaqueTargetMachine], :string
|
6641
|
+
|
6642
|
+
# Returns the feature string used creating this target machine. See
|
6643
|
+
# llvm::TargetMachine::getFeatureString. The result needs to be disposed with
|
6644
|
+
# LLVMDisposeMessage.
|
6645
|
+
#
|
6646
|
+
# @method get_target_machine_feature_string(t)
|
6647
|
+
# @param [OpaqueTargetMachine] t
|
6648
|
+
# @return [String]
|
6649
|
+
# @scope class
|
6650
|
+
attach_function :get_target_machine_feature_string, :LLVMGetTargetMachineFeatureString, [OpaqueTargetMachine], :string
|
6651
|
+
|
6652
|
+
# Returns the llvm::DataLayout used for this llvm:TargetMachine.
|
6653
|
+
#
|
6654
|
+
# @method get_target_machine_data(t)
|
6655
|
+
# @param [OpaqueTargetMachine] t
|
6656
|
+
# @return [OpaqueTargetData]
|
6657
|
+
# @scope class
|
6658
|
+
attach_function :get_target_machine_data, :LLVMGetTargetMachineData, [OpaqueTargetMachine], OpaqueTargetData
|
6659
|
+
|
6660
|
+
# Set the target machine's ASM verbosity.
|
6661
|
+
#
|
6662
|
+
# @method set_target_machine_asm_verbosity(t, verbose_asm)
|
6663
|
+
# @param [OpaqueTargetMachine] t
|
6664
|
+
# @param [Integer] verbose_asm
|
6665
|
+
# @return [nil]
|
6666
|
+
# @scope class
|
6667
|
+
attach_function :set_target_machine_asm_verbosity, :LLVMSetTargetMachineAsmVerbosity, [OpaqueTargetMachine, :int], :void
|
6668
|
+
|
6669
|
+
# Emits an asm or object file for the given module to the filename. This
|
6670
|
+
# wraps several c++ only classes (among them a file stream). Returns any
|
6671
|
+
# error in ErrorMessage. Use LLVMDisposeMessage to dispose the message.
|
6672
|
+
#
|
6673
|
+
# @method target_machine_emit_to_file(t, m, filename, codegen, error_message)
|
6674
|
+
# @param [OpaqueTargetMachine] t
|
6675
|
+
# @param [OpaqueModule] m
|
6676
|
+
# @param [String] filename
|
6677
|
+
# @param [Symbol from _enum_code_gen_file_type_] codegen
|
6678
|
+
# @param [FFI::Pointer(**CharS)] error_message
|
6679
|
+
# @return [Integer]
|
6680
|
+
# @scope class
|
6681
|
+
attach_function :target_machine_emit_to_file, :LLVMTargetMachineEmitToFile, [OpaqueTargetMachine, OpaqueModule, :string, :code_gen_file_type, :pointer], :int
|
6682
|
+
|
6683
|
+
# Compile the LLVM IR stored in \p M and store the result in \p OutMemBuf.
|
6684
|
+
#
|
6685
|
+
# @method target_machine_emit_to_memory_buffer(t, m, codegen, error_message, out_mem_buf)
|
6686
|
+
# @param [OpaqueTargetMachine] t
|
6687
|
+
# @param [OpaqueModule] m
|
6688
|
+
# @param [Symbol from _enum_code_gen_file_type_] codegen
|
6689
|
+
# @param [FFI::Pointer(**CharS)] error_message
|
6690
|
+
# @param [FFI::Pointer(*MemoryBufferRef)] out_mem_buf
|
6691
|
+
# @return [Integer]
|
6692
|
+
# @scope class
|
6693
|
+
attach_function :target_machine_emit_to_memory_buffer, :LLVMTargetMachineEmitToMemoryBuffer, [OpaqueTargetMachine, OpaqueModule, :code_gen_file_type, :pointer, :pointer], :int
|
6694
|
+
|
6695
|
+
# Get a triple for the host machine as a string. The result needs to be
|
6696
|
+
# disposed with LLVMDisposeMessage.
|
6697
|
+
#
|
6698
|
+
# @method get_default_target_triple()
|
6699
|
+
# @return [String]
|
6700
|
+
# @scope class
|
6701
|
+
attach_function :get_default_target_triple, :LLVMGetDefaultTargetTriple, [], :string
|
6702
|
+
|
5338
6703
|
# (Not documented)
|
5339
6704
|
#
|
5340
6705
|
# @method link_in_jit()
|
@@ -5342,6 +6707,13 @@ module RLTK::CG::Bindings
|
|
5342
6707
|
# @scope class
|
5343
6708
|
attach_function :link_in_jit, :LLVMLinkInJIT, [], :void
|
5344
6709
|
|
6710
|
+
# (Not documented)
|
6711
|
+
#
|
6712
|
+
# @method link_in_mcjit()
|
6713
|
+
# @return [nil]
|
6714
|
+
# @scope class
|
6715
|
+
attach_function :link_in_mcjit, :LLVMLinkInMCJIT, [], :void
|
6716
|
+
|
5345
6717
|
# (Not documented)
|
5346
6718
|
#
|
5347
6719
|
# @method link_in_interpreter()
|
@@ -5359,6 +6731,32 @@ module RLTK::CG::Bindings
|
|
5359
6731
|
layout :dummy, :char
|
5360
6732
|
end
|
5361
6733
|
|
6734
|
+
# (Not documented)
|
6735
|
+
class OpaqueMCJITMemoryManager < FFI::Struct
|
6736
|
+
layout :dummy, :char
|
6737
|
+
end
|
6738
|
+
|
6739
|
+
# (Not documented)
|
6740
|
+
#
|
6741
|
+
# = Fields:
|
6742
|
+
# :opt_level ::
|
6743
|
+
# (Integer)
|
6744
|
+
# :code_model ::
|
6745
|
+
# (Symbol from _enum_code_model_)
|
6746
|
+
# :no_frame_pointer_elim ::
|
6747
|
+
# (Integer)
|
6748
|
+
# :enable_fast_i_sel ::
|
6749
|
+
# (Integer)
|
6750
|
+
# :mcjmm ::
|
6751
|
+
# (OpaqueMCJITMemoryManager)
|
6752
|
+
class MCJITCompilerOptions < FFI::Struct
|
6753
|
+
layout :opt_level, :uint,
|
6754
|
+
:code_model, :code_model,
|
6755
|
+
:no_frame_pointer_elim, :int,
|
6756
|
+
:enable_fast_i_sel, :int,
|
6757
|
+
:mcjmm, OpaqueMCJITMemoryManager
|
6758
|
+
end
|
6759
|
+
|
5362
6760
|
# ===-- Operations on generic values --------------------------------------===
|
5363
6761
|
#
|
5364
6762
|
# @method create_generic_value_of_int(ty, n, is_signed)
|
@@ -5459,6 +6857,41 @@ module RLTK::CG::Bindings
|
|
5459
6857
|
# @scope class
|
5460
6858
|
attach_function :create_jit_compiler_for_module, :LLVMCreateJITCompilerForModule, [:pointer, OpaqueModule, :uint, :pointer], :int
|
5461
6859
|
|
6860
|
+
# (Not documented)
|
6861
|
+
#
|
6862
|
+
# @method initialize_mcjit_compiler_options(options, size_of_options)
|
6863
|
+
# @param [MCJITCompilerOptions] options
|
6864
|
+
# @param [Integer] size_of_options
|
6865
|
+
# @return [nil]
|
6866
|
+
# @scope class
|
6867
|
+
attach_function :initialize_mcjit_compiler_options, :LLVMInitializeMCJITCompilerOptions, [MCJITCompilerOptions, :ulong], :void
|
6868
|
+
|
6869
|
+
# Create an MCJIT execution engine for a module, with the given options. It is
|
6870
|
+
# the responsibility of the caller to ensure that all fields in Options up to
|
6871
|
+
# the given SizeOfOptions are initialized. It is correct to pass a smaller
|
6872
|
+
# value of SizeOfOptions that omits some fields. The canonical way of using
|
6873
|
+
# this is:
|
6874
|
+
#
|
6875
|
+
# LLVMMCJITCompilerOptions options;
|
6876
|
+
# LLVMInitializeMCJITCompilerOptions(&options, sizeof(options));
|
6877
|
+
# ... fill in those options you care about
|
6878
|
+
# LLVMCreateMCJITCompilerForModule(&jit, mod, &options, sizeof(options),
|
6879
|
+
# &error);
|
6880
|
+
#
|
6881
|
+
# Note that this is also correct, though possibly suboptimal:
|
6882
|
+
#
|
6883
|
+
# LLVMCreateMCJITCompilerForModule(&jit, mod, 0, 0, &error);
|
6884
|
+
#
|
6885
|
+
# @method create_mcjit_compiler_for_module(out_jit, m, options, size_of_options, out_error)
|
6886
|
+
# @param [FFI::Pointer(*ExecutionEngineRef)] out_jit
|
6887
|
+
# @param [OpaqueModule] m
|
6888
|
+
# @param [MCJITCompilerOptions] options
|
6889
|
+
# @param [Integer] size_of_options
|
6890
|
+
# @param [FFI::Pointer(**CharS)] out_error
|
6891
|
+
# @return [Integer]
|
6892
|
+
# @scope class
|
6893
|
+
attach_function :create_mcjit_compiler_for_module, :LLVMCreateMCJITCompilerForModule, [:pointer, OpaqueModule, MCJITCompilerOptions, :ulong, :pointer], :int
|
6894
|
+
|
5462
6895
|
# Deprecated: Use LLVMCreateExecutionEngineForModule instead.
|
5463
6896
|
#
|
5464
6897
|
# @method create_execution_engine(out_ee, mp, out_error)
|
@@ -5632,29 +7065,113 @@ module RLTK::CG::Bindings
|
|
5632
7065
|
# @scope class
|
5633
7066
|
attach_function :get_pointer_to_global, :LLVMGetPointerToGlobal, [OpaqueExecutionEngine, OpaqueValue], :pointer
|
5634
7067
|
|
7068
|
+
# ===-- Operations on memory managers -------------------------------------===
|
7069
|
+
#
|
7070
|
+
# <em>This entry is only for documentation and no real method.</em>
|
7071
|
+
#
|
7072
|
+
# @method _callback_memory_manager_allocate_code_section_callback_(opaque, size, alignment, section_id, section_name)
|
7073
|
+
# @param [FFI::Pointer(*Void)] opaque
|
7074
|
+
# @param [Integer] size
|
7075
|
+
# @param [Integer] alignment
|
7076
|
+
# @param [Integer] section_id
|
7077
|
+
# @param [String] section_name
|
7078
|
+
# @return [Integer]
|
7079
|
+
# @scope class
|
7080
|
+
callback :memory_manager_allocate_code_section_callback, [:pointer, :ulong, :uint, :uint, :string], :uchar
|
7081
|
+
|
7082
|
+
# (Not documented)
|
7083
|
+
#
|
7084
|
+
# <em>This entry is only for documentation and no real method.</em>
|
7085
|
+
#
|
7086
|
+
# @method _callback_memory_manager_allocate_data_section_callback_(opaque, size, alignment, section_id, section_name, is_read_only)
|
7087
|
+
# @param [FFI::Pointer(*Void)] opaque
|
7088
|
+
# @param [Integer] size
|
7089
|
+
# @param [Integer] alignment
|
7090
|
+
# @param [Integer] section_id
|
7091
|
+
# @param [String] section_name
|
7092
|
+
# @param [Integer] is_read_only
|
7093
|
+
# @return [Integer]
|
7094
|
+
# @scope class
|
7095
|
+
callback :memory_manager_allocate_data_section_callback, [:pointer, :ulong, :uint, :uint, :string, :int], :uchar
|
7096
|
+
|
7097
|
+
# (Not documented)
|
7098
|
+
#
|
7099
|
+
# <em>This entry is only for documentation and no real method.</em>
|
7100
|
+
#
|
7101
|
+
# @method _callback_memory_manager_finalize_memory_callback_(opaque, err_msg)
|
7102
|
+
# @param [FFI::Pointer(*Void)] opaque
|
7103
|
+
# @param [FFI::Pointer(**CharS)] err_msg
|
7104
|
+
# @return [Integer]
|
7105
|
+
# @scope class
|
7106
|
+
callback :memory_manager_finalize_memory_callback, [:pointer, :pointer], :int
|
7107
|
+
|
7108
|
+
# Create a simple custom MCJIT memory manager. This memory manager can
|
7109
|
+
# intercept allocations in a module-oblivious way. This will return NULL
|
7110
|
+
# if any of the passed functions are NULL.
|
7111
|
+
#
|
7112
|
+
# @param Opaque An opaque client object to pass back to the callbacks.
|
7113
|
+
# @param AllocateCodeSection Allocate a block of memory for executable code.
|
7114
|
+
# @param AllocateDataSection Allocate a block of memory for data.
|
7115
|
+
# @param FinalizeMemory Set page permissions and flush cache. Return 0 on
|
7116
|
+
# success, 1 on error.
|
7117
|
+
#
|
7118
|
+
# @method create_simple_mcjit_memory_manager(opaque, allocate_code_section, allocate_data_section, finalize_memory, destroy)
|
7119
|
+
# @param [FFI::Pointer(*Void)] opaque
|
7120
|
+
# @param [Proc(_callback_memory_manager_allocate_code_section_callback_)] allocate_code_section
|
7121
|
+
# @param [Proc(_callback_memory_manager_allocate_data_section_callback_)] allocate_data_section
|
7122
|
+
# @param [Proc(_callback_memory_manager_finalize_memory_callback_)] finalize_memory
|
7123
|
+
# @param [FFI::Pointer(MemoryManagerDestroyCallback)] destroy
|
7124
|
+
# @return [OpaqueMCJITMemoryManager]
|
7125
|
+
# @scope class
|
7126
|
+
attach_function :create_simple_mcjit_memory_manager, :LLVMCreateSimpleMCJITMemoryManager, [:pointer, :memory_manager_allocate_code_section_callback, :memory_manager_allocate_data_section_callback, :memory_manager_finalize_memory_callback, :pointer], OpaqueMCJITMemoryManager
|
7127
|
+
|
7128
|
+
# (Not documented)
|
7129
|
+
#
|
7130
|
+
# @method dispose_mcjit_memory_manager(mm)
|
7131
|
+
# @param [OpaqueMCJITMemoryManager] mm
|
7132
|
+
# @return [nil]
|
7133
|
+
# @scope class
|
7134
|
+
attach_function :dispose_mcjit_memory_manager, :LLVMDisposeMCJITMemoryManager, [OpaqueMCJITMemoryManager], :void
|
7135
|
+
|
5635
7136
|
# (Not documented)
|
5636
7137
|
#
|
5637
7138
|
# @method initialize_core(r)
|
5638
7139
|
# @param [OpaquePassRegistry] r
|
5639
7140
|
# @return [nil]
|
5640
7141
|
# @scope class
|
5641
|
-
attach_function :initialize_core, :LLVMInitializeCore, [OpaquePassRegistry], :void
|
7142
|
+
attach_function :initialize_core, :LLVMInitializeCore, [OpaquePassRegistry], :void
|
7143
|
+
|
7144
|
+
# (Not documented)
|
7145
|
+
#
|
7146
|
+
# @method initialize_transform_utils(r)
|
7147
|
+
# @param [OpaquePassRegistry] r
|
7148
|
+
# @return [nil]
|
7149
|
+
# @scope class
|
7150
|
+
attach_function :initialize_transform_utils, :LLVMInitializeTransformUtils, [OpaquePassRegistry], :void
|
7151
|
+
|
7152
|
+
# (Not documented)
|
7153
|
+
#
|
7154
|
+
# @method initialize_scalar_opts(r)
|
7155
|
+
# @param [OpaquePassRegistry] r
|
7156
|
+
# @return [nil]
|
7157
|
+
# @scope class
|
7158
|
+
attach_function :initialize_scalar_opts, :LLVMInitializeScalarOpts, [OpaquePassRegistry], :void
|
5642
7159
|
|
5643
7160
|
# (Not documented)
|
5644
7161
|
#
|
5645
|
-
# @method
|
7162
|
+
# @method initialize_obj_carc_opts(r)
|
5646
7163
|
# @param [OpaquePassRegistry] r
|
5647
7164
|
# @return [nil]
|
5648
7165
|
# @scope class
|
5649
|
-
attach_function :
|
7166
|
+
attach_function :initialize_objc_arc_opts, :LLVMInitializeObjCARCOpts, [OpaquePassRegistry], :void
|
5650
7167
|
|
5651
7168
|
# (Not documented)
|
5652
7169
|
#
|
5653
|
-
# @method
|
7170
|
+
# @method initialize_vectorization(r)
|
5654
7171
|
# @param [OpaquePassRegistry] r
|
5655
7172
|
# @return [nil]
|
5656
7173
|
# @scope class
|
5657
|
-
attach_function :
|
7174
|
+
attach_function :initialize_vectorization, :LLVMInitializeVectorization, [OpaquePassRegistry], :void
|
5658
7175
|
|
5659
7176
|
# (Not documented)
|
5660
7177
|
#
|
@@ -5712,6 +7229,122 @@ module RLTK::CG::Bindings
|
|
5712
7229
|
# @scope class
|
5713
7230
|
attach_function :initialize_target, :LLVMInitializeTarget, [OpaquePassRegistry], :void
|
5714
7231
|
|
7232
|
+
# (Not documented)
|
7233
|
+
#
|
7234
|
+
# @method parse_ir_in_context(context_ref, mem_buf, out_m, out_message)
|
7235
|
+
# @param [OpaqueContext] context_ref
|
7236
|
+
# @param [OpaqueMemoryBuffer] mem_buf
|
7237
|
+
# @param [FFI::Pointer(*ModuleRef)] out_m
|
7238
|
+
# @param [FFI::Pointer(**CharS)] out_message
|
7239
|
+
# @return [Integer]
|
7240
|
+
# @scope class
|
7241
|
+
attach_function :parse_ir_in_context, :LLVMParseIRInContext, [OpaqueContext, OpaqueMemoryBuffer, :pointer, :pointer], :int
|
7242
|
+
|
7243
|
+
# (Not documented)
|
7244
|
+
#
|
7245
|
+
# <em>This entry is only for documentation and no real method. The FFI::Enum can be accessed via #enum_type(:linker_mode).</em>
|
7246
|
+
#
|
7247
|
+
# === Options:
|
7248
|
+
# :linker_destroy_source ::
|
7249
|
+
#
|
7250
|
+
#
|
7251
|
+
# @method _enum_linker_mode_
|
7252
|
+
# @return [Symbol]
|
7253
|
+
# @scope class
|
7254
|
+
enum :linker_mode, [
|
7255
|
+
:linker_destroy_source, 0
|
7256
|
+
]
|
7257
|
+
|
7258
|
+
# Links the source module into the destination module, taking ownership
|
7259
|
+
# of the source module away from the caller. Optionally returns a
|
7260
|
+
# human-readable description of any errors that occurred in linking.
|
7261
|
+
# OutMessage must be disposed with LLVMDisposeMessage. The return value
|
7262
|
+
# is true if an error occurred, false otherwise.
|
7263
|
+
#
|
7264
|
+
# @method link_modules(dest, src, mode, out_message)
|
7265
|
+
# @param [OpaqueModule] dest
|
7266
|
+
# @param [OpaqueModule] src
|
7267
|
+
# @param [Symbol from _enum_linker_mode_] mode
|
7268
|
+
# @param [FFI::Pointer(**CharS)] out_message
|
7269
|
+
# @return [Integer]
|
7270
|
+
# @scope class
|
7271
|
+
attach_function :link_modules, :LLVMLinkModules, [OpaqueModule, OpaqueModule, :linker_mode, :pointer], :int
|
7272
|
+
|
7273
|
+
# /// This should map exactly onto the C++ enumerator LTOStatus.
|
7274
|
+
#
|
7275
|
+
# <em>This entry is only for documentation and no real method. The FFI::Enum can be accessed via #enum_type(:llvm_lto_status).</em>
|
7276
|
+
#
|
7277
|
+
# === Options:
|
7278
|
+
# :unknown ::
|
7279
|
+
#
|
7280
|
+
# :opt_success ::
|
7281
|
+
#
|
7282
|
+
# :read_success ::
|
7283
|
+
#
|
7284
|
+
# :read_failure ::
|
7285
|
+
#
|
7286
|
+
# :write_failure ::
|
7287
|
+
#
|
7288
|
+
# :no_target ::
|
7289
|
+
#
|
7290
|
+
# :no_work ::
|
7291
|
+
#
|
7292
|
+
# :module_merge_failure ::
|
7293
|
+
#
|
7294
|
+
# :asm_failure ::
|
7295
|
+
#
|
7296
|
+
# :null_object ::
|
7297
|
+
# // Added C-specific error codes
|
7298
|
+
#
|
7299
|
+
# @method _enum_llvm_lto_status_
|
7300
|
+
# @return [Symbol]
|
7301
|
+
# @scope class
|
7302
|
+
enum :llvm_lto_status, [
|
7303
|
+
:unknown, 0,
|
7304
|
+
:opt_success, 1,
|
7305
|
+
:read_success, 2,
|
7306
|
+
:read_failure, 3,
|
7307
|
+
:write_failure, 4,
|
7308
|
+
:no_target, 5,
|
7309
|
+
:no_work, 6,
|
7310
|
+
:module_merge_failure, 7,
|
7311
|
+
:asm_failure, 8,
|
7312
|
+
:null_object, 9
|
7313
|
+
]
|
7314
|
+
|
7315
|
+
# /// extern "C" helps, because dlopen() interface uses name to find the symbol.
|
7316
|
+
#
|
7317
|
+
# @method llvm_create_optimizer()
|
7318
|
+
# @return [FFI::Pointer(LlvmLtoT)]
|
7319
|
+
# @scope class
|
7320
|
+
attach_function :llvm_create_optimizer, :llvm_create_optimizer, [], :pointer
|
7321
|
+
|
7322
|
+
# (Not documented)
|
7323
|
+
#
|
7324
|
+
# @method llvm_destroy_optimizer(lto)
|
7325
|
+
# @param [FFI::Pointer(LlvmLtoT)] lto
|
7326
|
+
# @return [nil]
|
7327
|
+
# @scope class
|
7328
|
+
attach_function :llvm_destroy_optimizer, :llvm_destroy_optimizer, [:pointer], :void
|
7329
|
+
|
7330
|
+
# (Not documented)
|
7331
|
+
#
|
7332
|
+
# @method llvm_read_object_file(lto, input_filename)
|
7333
|
+
# @param [FFI::Pointer(LlvmLtoT)] lto
|
7334
|
+
# @param [String] input_filename
|
7335
|
+
# @return [Symbol from _enum_llvm_lto_status_]
|
7336
|
+
# @scope class
|
7337
|
+
attach_function :llvm_read_object_file, :llvm_read_object_file, [:pointer, :string], :llvm_lto_status
|
7338
|
+
|
7339
|
+
# (Not documented)
|
7340
|
+
#
|
7341
|
+
# @method llvm_optimize_modules(lto, output_filename)
|
7342
|
+
# @param [FFI::Pointer(LlvmLtoT)] lto
|
7343
|
+
# @param [String] output_filename
|
7344
|
+
# @return [Symbol from _enum_llvm_lto_status_]
|
7345
|
+
# @scope class
|
7346
|
+
attach_function :llvm_optimize_modules, :llvm_optimize_modules, [:pointer, :string], :llvm_lto_status
|
7347
|
+
|
5715
7348
|
# (Not documented)
|
5716
7349
|
class OpaqueObjectFile < FFI::Struct
|
5717
7350
|
layout :dummy, :char
|
@@ -5723,6 +7356,16 @@ module RLTK::CG::Bindings
|
|
5723
7356
|
end
|
5724
7357
|
|
5725
7358
|
# (Not documented)
|
7359
|
+
class OpaqueSymbolIterator < FFI::Struct
|
7360
|
+
layout :dummy, :char
|
7361
|
+
end
|
7362
|
+
|
7363
|
+
# (Not documented)
|
7364
|
+
class OpaqueRelocationIterator < FFI::Struct
|
7365
|
+
layout :dummy, :char
|
7366
|
+
end
|
7367
|
+
|
7368
|
+
# // ObjectFile creation
|
5726
7369
|
#
|
5727
7370
|
# @method create_object_file(mem_buf)
|
5728
7371
|
# @param [OpaqueMemoryBuffer] mem_buf
|
@@ -5738,7 +7381,7 @@ module RLTK::CG::Bindings
|
|
5738
7381
|
# @scope class
|
5739
7382
|
attach_function :dispose_object_file, :LLVMDisposeObjectFile, [OpaqueObjectFile], :void
|
5740
7383
|
|
5741
|
-
#
|
7384
|
+
# // ObjectFile Section iterators
|
5742
7385
|
#
|
5743
7386
|
# @method get_sections(object_file)
|
5744
7387
|
# @param [OpaqueObjectFile] object_file
|
@@ -5773,6 +7416,48 @@ module RLTK::CG::Bindings
|
|
5773
7416
|
|
5774
7417
|
# (Not documented)
|
5775
7418
|
#
|
7419
|
+
# @method move_to_containing_section(sect, sym)
|
7420
|
+
# @param [OpaqueSectionIterator] sect
|
7421
|
+
# @param [OpaqueSymbolIterator] sym
|
7422
|
+
# @return [nil]
|
7423
|
+
# @scope class
|
7424
|
+
attach_function :move_to_containing_section, :LLVMMoveToContainingSection, [OpaqueSectionIterator, OpaqueSymbolIterator], :void
|
7425
|
+
|
7426
|
+
# // ObjectFile Symbol iterators
|
7427
|
+
#
|
7428
|
+
# @method get_symbols(object_file)
|
7429
|
+
# @param [OpaqueObjectFile] object_file
|
7430
|
+
# @return [OpaqueSymbolIterator]
|
7431
|
+
# @scope class
|
7432
|
+
attach_function :get_symbols, :LLVMGetSymbols, [OpaqueObjectFile], OpaqueSymbolIterator
|
7433
|
+
|
7434
|
+
# (Not documented)
|
7435
|
+
#
|
7436
|
+
# @method dispose_symbol_iterator(si)
|
7437
|
+
# @param [OpaqueSymbolIterator] si
|
7438
|
+
# @return [nil]
|
7439
|
+
# @scope class
|
7440
|
+
attach_function :dispose_symbol_iterator, :LLVMDisposeSymbolIterator, [OpaqueSymbolIterator], :void
|
7441
|
+
|
7442
|
+
# (Not documented)
|
7443
|
+
#
|
7444
|
+
# @method is_symbol_iterator_at_end(object_file, si)
|
7445
|
+
# @param [OpaqueObjectFile] object_file
|
7446
|
+
# @param [OpaqueSymbolIterator] si
|
7447
|
+
# @return [Integer]
|
7448
|
+
# @scope class
|
7449
|
+
attach_function :is_symbol_iterator_at_end, :LLVMIsSymbolIteratorAtEnd, [OpaqueObjectFile, OpaqueSymbolIterator], :int
|
7450
|
+
|
7451
|
+
# (Not documented)
|
7452
|
+
#
|
7453
|
+
# @method move_to_next_symbol(si)
|
7454
|
+
# @param [OpaqueSymbolIterator] si
|
7455
|
+
# @return [nil]
|
7456
|
+
# @scope class
|
7457
|
+
attach_function :move_to_next_symbol, :LLVMMoveToNextSymbol, [OpaqueSymbolIterator], :void
|
7458
|
+
|
7459
|
+
# // SectionRef accessors
|
7460
|
+
#
|
5776
7461
|
# @method get_section_name(si)
|
5777
7462
|
# @param [OpaqueSectionIterator] si
|
5778
7463
|
# @return [String]
|
@@ -5795,6 +7480,144 @@ module RLTK::CG::Bindings
|
|
5795
7480
|
# @scope class
|
5796
7481
|
attach_function :get_section_contents, :LLVMGetSectionContents, [OpaqueSectionIterator], :string
|
5797
7482
|
|
7483
|
+
# (Not documented)
|
7484
|
+
#
|
7485
|
+
# @method get_section_address(si)
|
7486
|
+
# @param [OpaqueSectionIterator] si
|
7487
|
+
# @return [Integer]
|
7488
|
+
# @scope class
|
7489
|
+
attach_function :get_section_address, :LLVMGetSectionAddress, [OpaqueSectionIterator], :ulong
|
7490
|
+
|
7491
|
+
# (Not documented)
|
7492
|
+
#
|
7493
|
+
# @method get_section_contains_symbol(si, sym)
|
7494
|
+
# @param [OpaqueSectionIterator] si
|
7495
|
+
# @param [OpaqueSymbolIterator] sym
|
7496
|
+
# @return [Integer]
|
7497
|
+
# @scope class
|
7498
|
+
attach_function :get_section_contains_symbol, :LLVMGetSectionContainsSymbol, [OpaqueSectionIterator, OpaqueSymbolIterator], :int
|
7499
|
+
|
7500
|
+
# // Section Relocation iterators
|
7501
|
+
#
|
7502
|
+
# @method get_relocations(section)
|
7503
|
+
# @param [OpaqueSectionIterator] section
|
7504
|
+
# @return [OpaqueRelocationIterator]
|
7505
|
+
# @scope class
|
7506
|
+
attach_function :get_relocations, :LLVMGetRelocations, [OpaqueSectionIterator], OpaqueRelocationIterator
|
7507
|
+
|
7508
|
+
# (Not documented)
|
7509
|
+
#
|
7510
|
+
# @method dispose_relocation_iterator(ri)
|
7511
|
+
# @param [OpaqueRelocationIterator] ri
|
7512
|
+
# @return [nil]
|
7513
|
+
# @scope class
|
7514
|
+
attach_function :dispose_relocation_iterator, :LLVMDisposeRelocationIterator, [OpaqueRelocationIterator], :void
|
7515
|
+
|
7516
|
+
# (Not documented)
|
7517
|
+
#
|
7518
|
+
# @method is_relocation_iterator_at_end(section, ri)
|
7519
|
+
# @param [OpaqueSectionIterator] section
|
7520
|
+
# @param [OpaqueRelocationIterator] ri
|
7521
|
+
# @return [Integer]
|
7522
|
+
# @scope class
|
7523
|
+
attach_function :is_relocation_iterator_at_end, :LLVMIsRelocationIteratorAtEnd, [OpaqueSectionIterator, OpaqueRelocationIterator], :int
|
7524
|
+
|
7525
|
+
# (Not documented)
|
7526
|
+
#
|
7527
|
+
# @method move_to_next_relocation(ri)
|
7528
|
+
# @param [OpaqueRelocationIterator] ri
|
7529
|
+
# @return [nil]
|
7530
|
+
# @scope class
|
7531
|
+
attach_function :move_to_next_relocation, :LLVMMoveToNextRelocation, [OpaqueRelocationIterator], :void
|
7532
|
+
|
7533
|
+
# // SymbolRef accessors
|
7534
|
+
#
|
7535
|
+
# @method get_symbol_name(si)
|
7536
|
+
# @param [OpaqueSymbolIterator] si
|
7537
|
+
# @return [String]
|
7538
|
+
# @scope class
|
7539
|
+
attach_function :get_symbol_name, :LLVMGetSymbolName, [OpaqueSymbolIterator], :string
|
7540
|
+
|
7541
|
+
# (Not documented)
|
7542
|
+
#
|
7543
|
+
# @method get_symbol_address(si)
|
7544
|
+
# @param [OpaqueSymbolIterator] si
|
7545
|
+
# @return [Integer]
|
7546
|
+
# @scope class
|
7547
|
+
attach_function :get_symbol_address, :LLVMGetSymbolAddress, [OpaqueSymbolIterator], :ulong
|
7548
|
+
|
7549
|
+
# (Not documented)
|
7550
|
+
#
|
7551
|
+
# @method get_symbol_file_offset(si)
|
7552
|
+
# @param [OpaqueSymbolIterator] si
|
7553
|
+
# @return [Integer]
|
7554
|
+
# @scope class
|
7555
|
+
attach_function :get_symbol_file_offset, :LLVMGetSymbolFileOffset, [OpaqueSymbolIterator], :ulong
|
7556
|
+
|
7557
|
+
# (Not documented)
|
7558
|
+
#
|
7559
|
+
# @method get_symbol_size(si)
|
7560
|
+
# @param [OpaqueSymbolIterator] si
|
7561
|
+
# @return [Integer]
|
7562
|
+
# @scope class
|
7563
|
+
attach_function :get_symbol_size, :LLVMGetSymbolSize, [OpaqueSymbolIterator], :ulong
|
7564
|
+
|
7565
|
+
# // RelocationRef accessors
|
7566
|
+
#
|
7567
|
+
# @method get_relocation_address(ri)
|
7568
|
+
# @param [OpaqueRelocationIterator] ri
|
7569
|
+
# @return [Integer]
|
7570
|
+
# @scope class
|
7571
|
+
attach_function :get_relocation_address, :LLVMGetRelocationAddress, [OpaqueRelocationIterator], :ulong
|
7572
|
+
|
7573
|
+
# (Not documented)
|
7574
|
+
#
|
7575
|
+
# @method get_relocation_offset(ri)
|
7576
|
+
# @param [OpaqueRelocationIterator] ri
|
7577
|
+
# @return [Integer]
|
7578
|
+
# @scope class
|
7579
|
+
attach_function :get_relocation_offset, :LLVMGetRelocationOffset, [OpaqueRelocationIterator], :ulong
|
7580
|
+
|
7581
|
+
# (Not documented)
|
7582
|
+
#
|
7583
|
+
# @method get_relocation_symbol(ri)
|
7584
|
+
# @param [OpaqueRelocationIterator] ri
|
7585
|
+
# @return [OpaqueSymbolIterator]
|
7586
|
+
# @scope class
|
7587
|
+
attach_function :get_relocation_symbol, :LLVMGetRelocationSymbol, [OpaqueRelocationIterator], OpaqueSymbolIterator
|
7588
|
+
|
7589
|
+
# (Not documented)
|
7590
|
+
#
|
7591
|
+
# @method get_relocation_type(ri)
|
7592
|
+
# @param [OpaqueRelocationIterator] ri
|
7593
|
+
# @return [Integer]
|
7594
|
+
# @scope class
|
7595
|
+
attach_function :get_relocation_type, :LLVMGetRelocationType, [OpaqueRelocationIterator], :ulong
|
7596
|
+
|
7597
|
+
# // following functions.
|
7598
|
+
#
|
7599
|
+
# @method get_relocation_type_name(ri)
|
7600
|
+
# @param [OpaqueRelocationIterator] ri
|
7601
|
+
# @return [String]
|
7602
|
+
# @scope class
|
7603
|
+
attach_function :get_relocation_type_name, :LLVMGetRelocationTypeName, [OpaqueRelocationIterator], :string
|
7604
|
+
|
7605
|
+
# (Not documented)
|
7606
|
+
#
|
7607
|
+
# @method get_relocation_value_string(ri)
|
7608
|
+
# @param [OpaqueRelocationIterator] ri
|
7609
|
+
# @return [String]
|
7610
|
+
# @scope class
|
7611
|
+
attach_function :get_relocation_value_string, :LLVMGetRelocationValueString, [OpaqueRelocationIterator], :string
|
7612
|
+
|
7613
|
+
# (Not documented)
|
7614
|
+
#
|
7615
|
+
# @method load_library_permanently(filename)
|
7616
|
+
# @param [String] filename
|
7617
|
+
# @return [Integer]
|
7618
|
+
# @scope class
|
7619
|
+
attach_function :load_library_permanently, :LLVMLoadLibraryPermanently, [:string], :int
|
7620
|
+
|
5798
7621
|
# (Not documented)
|
5799
7622
|
#
|
5800
7623
|
# @method add_argument_promotion_pass(pm)
|
@@ -5908,6 +7731,109 @@ module RLTK::CG::Bindings
|
|
5908
7731
|
# @scope class
|
5909
7732
|
attach_function :add_strip_symbols_pass, :LLVMAddStripSymbolsPass, [OpaquePassManager], :void
|
5910
7733
|
|
7734
|
+
# (Not documented)
|
7735
|
+
class OpaquePassManagerBuilder < FFI::Struct
|
7736
|
+
layout :dummy, :char
|
7737
|
+
end
|
7738
|
+
|
7739
|
+
# See llvm::PassManagerBuilder.
|
7740
|
+
#
|
7741
|
+
# @method pass_manager_builder_create()
|
7742
|
+
# @return [OpaquePassManagerBuilder]
|
7743
|
+
# @scope class
|
7744
|
+
attach_function :pass_manager_builder_create, :LLVMPassManagerBuilderCreate, [], OpaquePassManagerBuilder
|
7745
|
+
|
7746
|
+
# (Not documented)
|
7747
|
+
#
|
7748
|
+
# @method pass_manager_builder_dispose(pmb)
|
7749
|
+
# @param [OpaquePassManagerBuilder] pmb
|
7750
|
+
# @return [nil]
|
7751
|
+
# @scope class
|
7752
|
+
attach_function :pass_manager_builder_dispose, :LLVMPassManagerBuilderDispose, [OpaquePassManagerBuilder], :void
|
7753
|
+
|
7754
|
+
# See llvm::PassManagerBuilder::OptLevel.
|
7755
|
+
#
|
7756
|
+
# @method pass_manager_builder_set_opt_level(pmb, opt_level)
|
7757
|
+
# @param [OpaquePassManagerBuilder] pmb
|
7758
|
+
# @param [Integer] opt_level
|
7759
|
+
# @return [nil]
|
7760
|
+
# @scope class
|
7761
|
+
attach_function :pass_manager_builder_set_opt_level, :LLVMPassManagerBuilderSetOptLevel, [OpaquePassManagerBuilder, :uint], :void
|
7762
|
+
|
7763
|
+
# See llvm::PassManagerBuilder::SizeLevel.
|
7764
|
+
#
|
7765
|
+
# @method pass_manager_builder_set_size_level(pmb, size_level)
|
7766
|
+
# @param [OpaquePassManagerBuilder] pmb
|
7767
|
+
# @param [Integer] size_level
|
7768
|
+
# @return [nil]
|
7769
|
+
# @scope class
|
7770
|
+
attach_function :pass_manager_builder_set_size_level, :LLVMPassManagerBuilderSetSizeLevel, [OpaquePassManagerBuilder, :uint], :void
|
7771
|
+
|
7772
|
+
# See llvm::PassManagerBuilder::DisableUnitAtATime.
|
7773
|
+
#
|
7774
|
+
# @method pass_manager_builder_set_disable_unit_at_a_time(pmb, value)
|
7775
|
+
# @param [OpaquePassManagerBuilder] pmb
|
7776
|
+
# @param [Integer] value
|
7777
|
+
# @return [nil]
|
7778
|
+
# @scope class
|
7779
|
+
attach_function :pass_manager_builder_set_disable_unit_at_a_time, :LLVMPassManagerBuilderSetDisableUnitAtATime, [OpaquePassManagerBuilder, :int], :void
|
7780
|
+
|
7781
|
+
# See llvm::PassManagerBuilder::DisableUnrollLoops.
|
7782
|
+
#
|
7783
|
+
# @method pass_manager_builder_set_disable_unroll_loops(pmb, value)
|
7784
|
+
# @param [OpaquePassManagerBuilder] pmb
|
7785
|
+
# @param [Integer] value
|
7786
|
+
# @return [nil]
|
7787
|
+
# @scope class
|
7788
|
+
attach_function :pass_manager_builder_set_disable_unroll_loops, :LLVMPassManagerBuilderSetDisableUnrollLoops, [OpaquePassManagerBuilder, :int], :void
|
7789
|
+
|
7790
|
+
# See llvm::PassManagerBuilder::DisableSimplifyLibCalls
|
7791
|
+
#
|
7792
|
+
# @method pass_manager_builder_set_disable_simplify_lib_calls(pmb, value)
|
7793
|
+
# @param [OpaquePassManagerBuilder] pmb
|
7794
|
+
# @param [Integer] value
|
7795
|
+
# @return [nil]
|
7796
|
+
# @scope class
|
7797
|
+
attach_function :pass_manager_builder_set_disable_simplify_lib_calls, :LLVMPassManagerBuilderSetDisableSimplifyLibCalls, [OpaquePassManagerBuilder, :int], :void
|
7798
|
+
|
7799
|
+
# See llvm::PassManagerBuilder::Inliner.
|
7800
|
+
#
|
7801
|
+
# @method pass_manager_builder_use_inliner_with_threshold(pmb, threshold)
|
7802
|
+
# @param [OpaquePassManagerBuilder] pmb
|
7803
|
+
# @param [Integer] threshold
|
7804
|
+
# @return [nil]
|
7805
|
+
# @scope class
|
7806
|
+
attach_function :pass_manager_builder_use_inliner_with_threshold, :LLVMPassManagerBuilderUseInlinerWithThreshold, [OpaquePassManagerBuilder, :uint], :void
|
7807
|
+
|
7808
|
+
# See llvm::PassManagerBuilder::populateFunctionPassManager.
|
7809
|
+
#
|
7810
|
+
# @method pass_manager_builder_populate_function_pass_manager(pmb, pm)
|
7811
|
+
# @param [OpaquePassManagerBuilder] pmb
|
7812
|
+
# @param [OpaquePassManager] pm
|
7813
|
+
# @return [nil]
|
7814
|
+
# @scope class
|
7815
|
+
attach_function :pass_manager_builder_populate_function_pass_manager, :LLVMPassManagerBuilderPopulateFunctionPassManager, [OpaquePassManagerBuilder, OpaquePassManager], :void
|
7816
|
+
|
7817
|
+
# See llvm::PassManagerBuilder::populateModulePassManager.
|
7818
|
+
#
|
7819
|
+
# @method pass_manager_builder_populate_module_pass_manager(pmb, pm)
|
7820
|
+
# @param [OpaquePassManagerBuilder] pmb
|
7821
|
+
# @param [OpaquePassManager] pm
|
7822
|
+
# @return [nil]
|
7823
|
+
# @scope class
|
7824
|
+
attach_function :pass_manager_builder_populate_module_pass_manager, :LLVMPassManagerBuilderPopulateModulePassManager, [OpaquePassManagerBuilder, OpaquePassManager], :void
|
7825
|
+
|
7826
|
+
# See llvm::PassManagerBuilder::populateLTOPassManager.
|
7827
|
+
#
|
7828
|
+
# @method pass_manager_builder_populate_lto_pass_manager(pmb, pm, internalize, run_inliner)
|
7829
|
+
# @param [OpaquePassManagerBuilder] pmb
|
7830
|
+
# @param [OpaquePassManager] pm
|
7831
|
+
# @param [Integer] internalize
|
7832
|
+
# @param [Integer] run_inliner
|
7833
|
+
# @return [nil]
|
7834
|
+
# @scope class
|
7835
|
+
attach_function :pass_manager_builder_populate_lto_pass_manager, :LLVMPassManagerBuilderPopulateLTOPassManager, [OpaquePassManagerBuilder, OpaquePassManager, :int, :int], :void
|
7836
|
+
|
5911
7837
|
# (Not documented)
|
5912
7838
|
#
|
5913
7839
|
# @method add_aggressive_dce_pass(pm)
|
@@ -5996,6 +7922,14 @@ module RLTK::CG::Bindings
|
|
5996
7922
|
# @scope class
|
5997
7923
|
attach_function :add_loop_rotate_pass, :LLVMAddLoopRotatePass, [OpaquePassManager], :void
|
5998
7924
|
|
7925
|
+
# See llvm::createLoopRerollPass function.
|
7926
|
+
#
|
7927
|
+
# @method add_loop_reroll_pass(pm)
|
7928
|
+
# @param [OpaquePassManager] pm
|
7929
|
+
# @return [nil]
|
7930
|
+
# @scope class
|
7931
|
+
attach_function :add_loop_reroll_pass, :LLVMAddLoopRerollPass, [OpaquePassManager], :void
|
7932
|
+
|
5999
7933
|
# See llvm::createLoopUnrollPass function.
|
6000
7934
|
#
|
6001
7935
|
# @method add_loop_unroll_pass(pm)
|
@@ -6020,6 +7954,14 @@ module RLTK::CG::Bindings
|
|
6020
7954
|
# @scope class
|
6021
7955
|
attach_function :add_mem_cpy_opt_pass, :LLVMAddMemCpyOptPass, [OpaquePassManager], :void
|
6022
7956
|
|
7957
|
+
# See llvm::createPartiallyInlineLibCallsPass function.
|
7958
|
+
#
|
7959
|
+
# @method add_partially_inline_lib_calls_pass(pm)
|
7960
|
+
# @param [OpaquePassManager] pm
|
7961
|
+
# @return [nil]
|
7962
|
+
# @scope class
|
7963
|
+
attach_function :add_partially_inline_lib_calls_pass, :LLVMAddPartiallyInlineLibCallsPass, [OpaquePassManager], :void
|
7964
|
+
|
6023
7965
|
# See llvm::createPromoteMemoryToRegisterPass function.
|
6024
7966
|
#
|
6025
7967
|
# @method add_promote_memory_to_register_pass(pm)
|
@@ -6149,4 +8091,28 @@ module RLTK::CG::Bindings
|
|
6149
8091
|
# @scope class
|
6150
8092
|
attach_function :add_basic_alias_analysis_pass, :LLVMAddBasicAliasAnalysisPass, [OpaquePassManager], :void
|
6151
8093
|
|
8094
|
+
# (Not documented)
|
8095
|
+
#
|
8096
|
+
# @method add_bb_vectorize_pass(pm)
|
8097
|
+
# @param [OpaquePassManager] pm
|
8098
|
+
# @return [nil]
|
8099
|
+
# @scope class
|
8100
|
+
attach_function :add_bb_vectorize_pass, :LLVMAddBBVectorizePass, [OpaquePassManager], :void
|
8101
|
+
|
8102
|
+
# See llvm::createLoopVectorizePass function.
|
8103
|
+
#
|
8104
|
+
# @method add_loop_vectorize_pass(pm)
|
8105
|
+
# @param [OpaquePassManager] pm
|
8106
|
+
# @return [nil]
|
8107
|
+
# @scope class
|
8108
|
+
attach_function :add_loop_vectorize_pass, :LLVMAddLoopVectorizePass, [OpaquePassManager], :void
|
8109
|
+
|
8110
|
+
# See llvm::createSLPVectorizerPass function.
|
8111
|
+
#
|
8112
|
+
# @method add_slp_vectorize_pass(pm)
|
8113
|
+
# @param [OpaquePassManager] pm
|
8114
|
+
# @return [nil]
|
8115
|
+
# @scope class
|
8116
|
+
attach_function :add_slp_vectorize_pass, :LLVMAddSLPVectorizePass, [OpaquePassManager], :void
|
8117
|
+
|
6152
8118
|
end
|