ruby-llvm 3.2.0.beta.1 → 3.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/README.md +6 -3
- data/ext/ruby-llvm-support/Rakefile +80 -24
- data/ext/ruby-llvm-support/support.cpp +4 -3
- data/lib/llvm.rb +2 -2
- data/lib/llvm/analysis_ffi.rb +1 -1
- data/lib/llvm/config.rb +10 -0
- data/lib/llvm/core.rb +7 -5
- data/lib/llvm/core/bitcode_ffi.rb +1 -1
- data/lib/llvm/core/builder.rb +88 -6
- data/lib/llvm/core/module.rb +1 -0
- data/lib/llvm/core/type.rb +4 -4
- data/lib/llvm/core/value.rb +111 -25
- data/lib/llvm/core_ffi.rb +248 -1
- data/lib/llvm/execution_engine_ffi.rb +61 -1
- data/lib/llvm/linker.rb +0 -2
- data/lib/llvm/linker_ffi.rb +1 -1
- data/lib/llvm/support.rb +1 -1
- data/lib/llvm/target.rb +1 -1
- data/lib/llvm/target_ffi.rb +30 -25
- data/lib/llvm/transforms/builder.rb +102 -0
- data/lib/llvm/transforms/builder_ffi.rb +118 -0
- data/lib/llvm/transforms/ipo.rb +64 -4
- data/lib/llvm/transforms/ipo_ffi.rb +1 -1
- data/lib/llvm/transforms/scalar.rb +60 -20
- data/lib/llvm/transforms/scalar_ffi.rb +1 -1
- data/lib/llvm/transforms/vectorize.rb +5 -0
- data/lib/llvm/transforms/vectorize_ffi.rb +9 -1
- data/lib/llvm/version.rb +2 -21
- data/test/array_test.rb +1 -1
- data/test/basic_block_test.rb +1 -1
- data/test/binary_operations_test.rb +1 -1
- data/test/bitcode_test.rb +1 -1
- data/test/branch_test.rb +1 -1
- data/test/call_test.rb +1 -1
- data/test/comparisons_test.rb +1 -1
- data/test/conversions_test.rb +1 -1
- data/test/double_test.rb +1 -1
- data/test/equality_test.rb +4 -4
- data/test/function_test.rb +73 -0
- data/test/generic_value_test.rb +1 -1
- data/test/instruction_test.rb +1 -1
- data/test/ipo_test.rb +1 -1
- data/test/linker_test.rb +2 -2
- data/test/memory_access_test.rb +1 -1
- data/test/module_test.rb +6 -6
- data/test/parameter_collection_test.rb +1 -1
- data/test/pass_manager_builder_test.rb +33 -0
- data/test/phi_test.rb +1 -1
- data/test/select_test.rb +1 -1
- data/test/struct_test.rb +9 -1
- data/test/target_test.rb +19 -13
- data/test/test_helper.rb +2 -2
- data/test/type_test.rb +1 -1
- data/test/vector_test.rb +2 -2
- metadata +117 -85
- data/test/basic_test.rb +0 -11
@@ -4,7 +4,7 @@ require 'ffi'
|
|
4
4
|
|
5
5
|
module LLVM::C
|
6
6
|
extend FFI::Library
|
7
|
-
ffi_lib 'LLVM-3.
|
7
|
+
ffi_lib 'LLVM-3.3'
|
8
8
|
|
9
9
|
def self.attach_function(name, *_)
|
10
10
|
begin; super; rescue FFI::NotFoundError => e
|
@@ -19,6 +19,13 @@ module LLVM::C
|
|
19
19
|
# @scope class
|
20
20
|
attach_function :link_in_jit, :LLVMLinkInJIT, [], :void
|
21
21
|
|
22
|
+
# (Not documented)
|
23
|
+
#
|
24
|
+
# @method link_in_mcjit()
|
25
|
+
# @return [nil]
|
26
|
+
# @scope class
|
27
|
+
attach_function :link_in_mcjit, :LLVMLinkInMCJIT, [], :void
|
28
|
+
|
22
29
|
# (Not documented)
|
23
30
|
#
|
24
31
|
# @method link_in_interpreter()
|
@@ -36,6 +43,24 @@ module LLVM::C
|
|
36
43
|
layout :dummy, :char
|
37
44
|
end
|
38
45
|
|
46
|
+
# (Not documented)
|
47
|
+
#
|
48
|
+
# = Fields:
|
49
|
+
# :opt_level ::
|
50
|
+
# (Integer)
|
51
|
+
# :code_model ::
|
52
|
+
# (unknown)
|
53
|
+
# :no_frame_pointer_elim ::
|
54
|
+
# (Integer)
|
55
|
+
# :enable_fast_i_sel ::
|
56
|
+
# (Integer)
|
57
|
+
class MCJITCompilerOptions < FFI::Struct
|
58
|
+
layout :opt_level, :uint,
|
59
|
+
:code_model, :char,
|
60
|
+
:no_frame_pointer_elim, :int,
|
61
|
+
:enable_fast_i_sel, :int
|
62
|
+
end
|
63
|
+
|
39
64
|
# ===-- Operations on generic values --------------------------------------===
|
40
65
|
#
|
41
66
|
# @method create_generic_value_of_int(ty, n, is_signed)
|
@@ -136,6 +161,41 @@ module LLVM::C
|
|
136
161
|
# @scope class
|
137
162
|
attach_function :create_jit_compiler_for_module, :LLVMCreateJITCompilerForModule, [:pointer, :pointer, :uint, :pointer], :int
|
138
163
|
|
164
|
+
# (Not documented)
|
165
|
+
#
|
166
|
+
# @method initialize_mcjit_compiler_options(options, size_of_options)
|
167
|
+
# @param [MCJITCompilerOptions] options
|
168
|
+
# @param [Integer] size_of_options
|
169
|
+
# @return [nil]
|
170
|
+
# @scope class
|
171
|
+
attach_function :initialize_mcjit_compiler_options, :LLVMInitializeMCJITCompilerOptions, [MCJITCompilerOptions, :ulong], :void
|
172
|
+
|
173
|
+
# Create an MCJIT execution engine for a module, with the given options. It is
|
174
|
+
# the responsibility of the caller to ensure that all fields in Options up to
|
175
|
+
# the given SizeOfOptions are initialized. It is correct to pass a smaller
|
176
|
+
# value of SizeOfOptions that omits some fields. The canonical way of using
|
177
|
+
# this is:
|
178
|
+
#
|
179
|
+
# LLVMMCJITCompilerOptions options;
|
180
|
+
# LLVMInitializeMCJITCompilerOptions(&options, sizeof(options));
|
181
|
+
# ... fill in those options you care about
|
182
|
+
# LLVMCreateMCJITCompilerForModule(&jit, mod, &options, sizeof(options),
|
183
|
+
# &error);
|
184
|
+
#
|
185
|
+
# Note that this is also correct, though possibly suboptimal:
|
186
|
+
#
|
187
|
+
# LLVMCreateMCJITCompilerForModule(&jit, mod, 0, 0, &error);
|
188
|
+
#
|
189
|
+
# @method create_mcjit_compiler_for_module(out_jit, m, options, size_of_options, out_error)
|
190
|
+
# @param [FFI::Pointer(*ExecutionEngineRef)] out_jit
|
191
|
+
# @param [FFI::Pointer(ModuleRef)] m
|
192
|
+
# @param [MCJITCompilerOptions] options
|
193
|
+
# @param [Integer] size_of_options
|
194
|
+
# @param [FFI::Pointer(**CharS)] out_error
|
195
|
+
# @return [Integer]
|
196
|
+
# @scope class
|
197
|
+
attach_function :create_mcjit_compiler_for_module, :LLVMCreateMCJITCompilerForModule, [:pointer, :pointer, MCJITCompilerOptions, :ulong, :pointer], :int
|
198
|
+
|
139
199
|
# Deprecated: Use LLVMCreateExecutionEngineForModule instead.
|
140
200
|
#
|
141
201
|
# @method create_execution_engine(out_ee, mp, out_error)
|
data/lib/llvm/linker.rb
CHANGED
@@ -22,8 +22,6 @@ module LLVM
|
|
22
22
|
# @return [nil, String] human-readable error if linking has failed
|
23
23
|
def link_into_and_destroy(other)
|
24
24
|
result = LLVM.with_message_output do |msg|
|
25
|
-
# HACK ALERT: ffi-gen missed LLVMLinkerPreserveSource enumeration for
|
26
|
-
# some reason. It is inlined as a constant here.
|
27
25
|
C.link_modules(other, self, :linker_destroy_source, msg)
|
28
26
|
end
|
29
27
|
|
data/lib/llvm/linker_ffi.rb
CHANGED
data/lib/llvm/support.rb
CHANGED
@@ -12,7 +12,7 @@ module LLVM
|
|
12
12
|
OpaqueType = LLVM::C::OpaqueType
|
13
13
|
OpaqueModule = LLVM::C::OpaqueModule
|
14
14
|
|
15
|
-
lib_name = FFI.map_library_name(
|
15
|
+
lib_name = FFI.map_library_name("RubyLLVMSupport-#{LLVM_VERSION}")
|
16
16
|
lib_path = File.expand_path("../../ext/ruby-llvm-support/#{lib_name}", File.dirname(__FILE__))
|
17
17
|
ffi_lib [lib_path]
|
18
18
|
|
data/lib/llvm/target.rb
CHANGED
@@ -44,7 +44,7 @@ module LLVM
|
|
44
44
|
C.send init
|
45
45
|
end
|
46
46
|
rescue FFI::NotFoundError
|
47
|
-
raise ArgumentError, "LLVM target #{target} is not linked in. Try `llvm-config
|
47
|
+
raise ArgumentError, "LLVM target #{target} is not linked in. Try `llvm-config-#{LLVM_VERSION} --targets-built'."
|
48
48
|
end
|
49
49
|
|
50
50
|
begin
|
data/lib/llvm/target_ffi.rb
CHANGED
@@ -4,7 +4,7 @@ require 'ffi'
|
|
4
4
|
|
5
5
|
module LLVM::C
|
6
6
|
extend FFI::Library
|
7
|
-
ffi_lib 'LLVM-3.
|
7
|
+
ffi_lib 'LLVM-3.3'
|
8
8
|
|
9
9
|
def self.attach_function(name, *_)
|
10
10
|
begin; super; rescue FFI::NotFoundError => e
|
@@ -299,14 +299,7 @@ module LLVM::C
|
|
299
299
|
attach_function :dispose_target_data, :LLVMDisposeTargetData, [OpaqueTargetData], :void
|
300
300
|
|
301
301
|
# (Not documented)
|
302
|
-
|
303
|
-
def emit_to_file(m, filename, codegen, error_message)
|
304
|
-
LLVM::C.target_machine_emit_to_file(self, m, filename, codegen, error_message)
|
305
|
-
end
|
306
|
-
end
|
307
|
-
|
308
|
-
class TargetMachine < FFI::Struct
|
309
|
-
include TargetMachineWrappers
|
302
|
+
class OpaqueTargetMachine < FFI::Struct
|
310
303
|
layout :dummy, :char
|
311
304
|
end
|
312
305
|
|
@@ -491,77 +484,89 @@ module LLVM::C
|
|
491
484
|
# @param [Symbol from _enum_code_gen_opt_level_] level
|
492
485
|
# @param [Symbol from _enum_reloc_mode_] reloc
|
493
486
|
# @param [Symbol from _enum_code_model_] code_model
|
494
|
-
# @return [
|
487
|
+
# @return [OpaqueTargetMachine]
|
495
488
|
# @scope class
|
496
|
-
attach_function :create_target_machine, :LLVMCreateTargetMachine, [Target, :string, :string, :string, :code_gen_opt_level, :reloc_mode, :code_model],
|
489
|
+
attach_function :create_target_machine, :LLVMCreateTargetMachine, [Target, :string, :string, :string, :code_gen_opt_level, :reloc_mode, :code_model], OpaqueTargetMachine
|
497
490
|
|
498
491
|
# Dispose the LLVMTargetMachineRef instance generated by
|
499
492
|
# LLVMCreateTargetMachine.
|
500
493
|
#
|
501
494
|
# @method dispose_target_machine(t)
|
502
|
-
# @param [
|
495
|
+
# @param [OpaqueTargetMachine] t
|
503
496
|
# @return [nil]
|
504
497
|
# @scope class
|
505
|
-
attach_function :dispose_target_machine, :LLVMDisposeTargetMachine, [
|
498
|
+
attach_function :dispose_target_machine, :LLVMDisposeTargetMachine, [OpaqueTargetMachine], :void
|
506
499
|
|
507
500
|
# Returns the Target used in a TargetMachine
|
508
501
|
#
|
509
502
|
# @method get_target_machine_target(t)
|
510
|
-
# @param [
|
503
|
+
# @param [OpaqueTargetMachine] t
|
511
504
|
# @return [Target]
|
512
505
|
# @scope class
|
513
|
-
attach_function :get_target_machine_target, :LLVMGetTargetMachineTarget, [
|
506
|
+
attach_function :get_target_machine_target, :LLVMGetTargetMachineTarget, [OpaqueTargetMachine], Target
|
514
507
|
|
515
508
|
# Returns the triple used creating this target machine. See
|
516
509
|
# llvm::TargetMachine::getTriple. The result needs to be disposed with
|
517
510
|
# LLVMDisposeMessage.
|
518
511
|
#
|
519
512
|
# @method get_target_machine_triple(t)
|
520
|
-
# @param [
|
513
|
+
# @param [OpaqueTargetMachine] t
|
521
514
|
# @return [String]
|
522
515
|
# @scope class
|
523
|
-
attach_function :get_target_machine_triple, :LLVMGetTargetMachineTriple, [
|
516
|
+
attach_function :get_target_machine_triple, :LLVMGetTargetMachineTriple, [OpaqueTargetMachine], :string
|
524
517
|
|
525
518
|
# Returns the cpu used creating this target machine. See
|
526
519
|
# llvm::TargetMachine::getCPU. The result needs to be disposed with
|
527
520
|
# LLVMDisposeMessage.
|
528
521
|
#
|
529
522
|
# @method get_target_machine_cpu(t)
|
530
|
-
# @param [
|
523
|
+
# @param [OpaqueTargetMachine] t
|
531
524
|
# @return [String]
|
532
525
|
# @scope class
|
533
|
-
attach_function :get_target_machine_cpu, :LLVMGetTargetMachineCPU, [
|
526
|
+
attach_function :get_target_machine_cpu, :LLVMGetTargetMachineCPU, [OpaqueTargetMachine], :string
|
534
527
|
|
535
528
|
# Returns the feature string used creating this target machine. See
|
536
529
|
# llvm::TargetMachine::getFeatureString. The result needs to be disposed with
|
537
530
|
# LLVMDisposeMessage.
|
538
531
|
#
|
539
532
|
# @method get_target_machine_feature_string(t)
|
540
|
-
# @param [
|
533
|
+
# @param [OpaqueTargetMachine] t
|
541
534
|
# @return [String]
|
542
535
|
# @scope class
|
543
|
-
attach_function :get_target_machine_feature_string, :LLVMGetTargetMachineFeatureString, [
|
536
|
+
attach_function :get_target_machine_feature_string, :LLVMGetTargetMachineFeatureString, [OpaqueTargetMachine], :string
|
544
537
|
|
545
538
|
# Returns the llvm::DataLayout used for this llvm:TargetMachine.
|
546
539
|
#
|
547
540
|
# @method get_target_machine_data(t)
|
548
|
-
# @param [
|
541
|
+
# @param [OpaqueTargetMachine] t
|
549
542
|
# @return [OpaqueTargetData]
|
550
543
|
# @scope class
|
551
|
-
attach_function :get_target_machine_data, :LLVMGetTargetMachineData, [
|
544
|
+
attach_function :get_target_machine_data, :LLVMGetTargetMachineData, [OpaqueTargetMachine], OpaqueTargetData
|
552
545
|
|
553
546
|
# Emits an asm or object file for the given module to the filename. This
|
554
547
|
# wraps several c++ only classes (among them a file stream). Returns any
|
555
548
|
# error in ErrorMessage. Use LLVMDisposeMessage to dispose the message.
|
556
549
|
#
|
557
550
|
# @method target_machine_emit_to_file(t, m, filename, codegen, error_message)
|
558
|
-
# @param [
|
551
|
+
# @param [OpaqueTargetMachine] t
|
559
552
|
# @param [FFI::Pointer(ModuleRef)] m
|
560
553
|
# @param [String] filename
|
561
554
|
# @param [Symbol from _enum_code_gen_file_type_] codegen
|
562
555
|
# @param [FFI::Pointer(**CharS)] error_message
|
563
556
|
# @return [Integer]
|
564
557
|
# @scope class
|
565
|
-
attach_function :target_machine_emit_to_file, :LLVMTargetMachineEmitToFile, [
|
558
|
+
attach_function :target_machine_emit_to_file, :LLVMTargetMachineEmitToFile, [OpaqueTargetMachine, :pointer, :string, :code_gen_file_type, :pointer], :int
|
559
|
+
|
560
|
+
# Compile the LLVM IR stored in \p M and store the result in \p OutMemBuf.
|
561
|
+
#
|
562
|
+
# @method target_machine_emit_to_memory_buffer(t, m, codegen, error_message, out_mem_buf)
|
563
|
+
# @param [OpaqueTargetMachine] t
|
564
|
+
# @param [FFI::Pointer(ModuleRef)] m
|
565
|
+
# @param [Symbol from _enum_code_gen_file_type_] codegen
|
566
|
+
# @param [FFI::Pointer(**CharS)] error_message
|
567
|
+
# @param [FFI::Pointer(*MemoryBufferRef)] out_mem_buf
|
568
|
+
# @return [Integer]
|
569
|
+
# @scope class
|
570
|
+
attach_function :target_machine_emit_to_memory_buffer, :LLVMTargetMachineEmitToMemoryBuffer, [OpaqueTargetMachine, :pointer, :code_gen_file_type, :pointer, :pointer], :int
|
566
571
|
|
567
572
|
end
|
@@ -0,0 +1,102 @@
|
|
1
|
+
require 'llvm'
|
2
|
+
require 'llvm/core'
|
3
|
+
require 'llvm/transforms/builder_ffi'
|
4
|
+
|
5
|
+
module LLVM
|
6
|
+
class PassManagerBuilder
|
7
|
+
include PointerIdentity
|
8
|
+
|
9
|
+
attr_reader :size_level
|
10
|
+
attr_reader :opt_level
|
11
|
+
attr_reader :unit_at_a_time
|
12
|
+
attr_reader :unroll_loops
|
13
|
+
attr_reader :simplify_lib_calls
|
14
|
+
attr_reader :inliner_threshold
|
15
|
+
|
16
|
+
def initialize
|
17
|
+
@ptr = C.pass_manager_builder_create
|
18
|
+
|
19
|
+
@size_level = 0
|
20
|
+
@opt_level = 0
|
21
|
+
@unit_at_a_time = false
|
22
|
+
@unroll_loops = false
|
23
|
+
@simplify_lib_calls = false
|
24
|
+
@inliner_threshold = 0
|
25
|
+
end
|
26
|
+
|
27
|
+
def dispose
|
28
|
+
return if @ptr.nil?
|
29
|
+
|
30
|
+
C.pass_manager_builder_dispose(@ptr)
|
31
|
+
@ptr = nil
|
32
|
+
end
|
33
|
+
|
34
|
+
# Specify the basic optimization level.
|
35
|
+
# @param [Integer] level 0 = -O0, 1 = -O1, 2 = -O2, 3 = -O3
|
36
|
+
def opt_level=(level)
|
37
|
+
@opt_level = level.to_i
|
38
|
+
C.pass_manager_builder_set_opt_level(self, @opt_level)
|
39
|
+
end
|
40
|
+
|
41
|
+
# How much we're optimizing for size.
|
42
|
+
# @param [Integer] level 0 = none, 1 = -Os, 2 = -Oz
|
43
|
+
def size_level=(level)
|
44
|
+
@size_level = level.to_i
|
45
|
+
C.pass_manager_builder_set_size_level(self, @size_level)
|
46
|
+
end
|
47
|
+
|
48
|
+
# @param [Boolean] do_unit_at_a_time
|
49
|
+
def unit_at_a_time=(do_unit_at_a_time)
|
50
|
+
@unit_at_a_time = do_unit_at_a_time
|
51
|
+
C.pass_manager_builder_set_disable_unit_at_a_time(self, flag(!@unit_at_a_time))
|
52
|
+
end
|
53
|
+
|
54
|
+
# @param [Boolean] do_unroll
|
55
|
+
def unroll_loops=(do_unroll)
|
56
|
+
@unroll_loops = do_unroll
|
57
|
+
C.pass_manager_builder_set_disable_unroll_loops(self, flag(!@unroll_loops))
|
58
|
+
end
|
59
|
+
|
60
|
+
# @param [Boolean] do_simplify_lib_calls
|
61
|
+
def simplify_lib_calls=(do_simplify_lib_calls)
|
62
|
+
@simplify_lib_calls = do_simplify_lib_calls
|
63
|
+
C.pass_manager_builder_set_disable_simplify_lib_calls(self, flag(!@simplify_lib_calls))
|
64
|
+
end
|
65
|
+
|
66
|
+
# @param [Integer] threshold 0 = -O1, 225 = -O2, 275 = -O3
|
67
|
+
def inliner_threshold=(threshold)
|
68
|
+
@inliner_threshold = threshold
|
69
|
+
C.pass_manager_builder_use_inliner_with_threshold(self, @inliner_threshold)
|
70
|
+
end
|
71
|
+
|
72
|
+
# Populate a pass manager.
|
73
|
+
# @param [PassManager, FunctionPassManager] pass_manager
|
74
|
+
def build(pass_manager)
|
75
|
+
case pass_manager
|
76
|
+
when FunctionPassManager
|
77
|
+
C.pass_manager_builder_populate_function_pass_manager(self, pass_manager)
|
78
|
+
|
79
|
+
when PassManager
|
80
|
+
C.pass_manager_builder_populate_module_pass_manager(self, pass_manager)
|
81
|
+
end
|
82
|
+
end
|
83
|
+
|
84
|
+
# Populate an LTO pass manager.
|
85
|
+
# @param [PassManager] pass_manager
|
86
|
+
def build_with_lto(pass_manager, internalize=false, run_inliner=false)
|
87
|
+
if pass_manager.is_a?(FunctionPassManager)
|
88
|
+
raise ArgumentError, "FunctionPassManager does not support LTO"
|
89
|
+
end
|
90
|
+
|
91
|
+
# Add flag() when the header gets fixed and has LLVMBool
|
92
|
+
C.pass_manager_builder_populate_lto_pass_manager(self,
|
93
|
+
pass_manager, internalize, run_inliner)
|
94
|
+
end
|
95
|
+
|
96
|
+
private
|
97
|
+
|
98
|
+
def flag(boolean)
|
99
|
+
boolean ? 1 : 0
|
100
|
+
end
|
101
|
+
end
|
102
|
+
end
|
@@ -0,0 +1,118 @@
|
|
1
|
+
# Generated by ffi_gen. Please do not change this file by hand.
|
2
|
+
|
3
|
+
require 'ffi'
|
4
|
+
|
5
|
+
module LLVM::C
|
6
|
+
extend FFI::Library
|
7
|
+
ffi_lib 'LLVM-3.3'
|
8
|
+
|
9
|
+
def self.attach_function(name, *_)
|
10
|
+
begin; super; rescue FFI::NotFoundError => e
|
11
|
+
(class << self; self; end).class_eval { define_method(name) { |*_| raise e } }
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
# (Not documented)
|
16
|
+
class OpaquePassManagerBuilder < FFI::Struct
|
17
|
+
layout :dummy, :char
|
18
|
+
end
|
19
|
+
|
20
|
+
# See llvm::PassManagerBuilder.
|
21
|
+
#
|
22
|
+
# @method pass_manager_builder_create()
|
23
|
+
# @return [OpaquePassManagerBuilder]
|
24
|
+
# @scope class
|
25
|
+
attach_function :pass_manager_builder_create, :LLVMPassManagerBuilderCreate, [], OpaquePassManagerBuilder
|
26
|
+
|
27
|
+
# (Not documented)
|
28
|
+
#
|
29
|
+
# @method pass_manager_builder_dispose(pmb)
|
30
|
+
# @param [OpaquePassManagerBuilder] pmb
|
31
|
+
# @return [nil]
|
32
|
+
# @scope class
|
33
|
+
attach_function :pass_manager_builder_dispose, :LLVMPassManagerBuilderDispose, [OpaquePassManagerBuilder], :void
|
34
|
+
|
35
|
+
# See llvm::PassManagerBuilder::OptLevel.
|
36
|
+
#
|
37
|
+
# @method pass_manager_builder_set_opt_level(pmb, opt_level)
|
38
|
+
# @param [OpaquePassManagerBuilder] pmb
|
39
|
+
# @param [Integer] opt_level
|
40
|
+
# @return [nil]
|
41
|
+
# @scope class
|
42
|
+
attach_function :pass_manager_builder_set_opt_level, :LLVMPassManagerBuilderSetOptLevel, [OpaquePassManagerBuilder, :uint], :void
|
43
|
+
|
44
|
+
# See llvm::PassManagerBuilder::SizeLevel.
|
45
|
+
#
|
46
|
+
# @method pass_manager_builder_set_size_level(pmb, size_level)
|
47
|
+
# @param [OpaquePassManagerBuilder] pmb
|
48
|
+
# @param [Integer] size_level
|
49
|
+
# @return [nil]
|
50
|
+
# @scope class
|
51
|
+
attach_function :pass_manager_builder_set_size_level, :LLVMPassManagerBuilderSetSizeLevel, [OpaquePassManagerBuilder, :uint], :void
|
52
|
+
|
53
|
+
# See llvm::PassManagerBuilder::DisableUnitAtATime.
|
54
|
+
#
|
55
|
+
# @method pass_manager_builder_set_disable_unit_at_a_time(pmb, value)
|
56
|
+
# @param [OpaquePassManagerBuilder] pmb
|
57
|
+
# @param [Integer] value
|
58
|
+
# @return [nil]
|
59
|
+
# @scope class
|
60
|
+
attach_function :pass_manager_builder_set_disable_unit_at_a_time, :LLVMPassManagerBuilderSetDisableUnitAtATime, [OpaquePassManagerBuilder, :int], :void
|
61
|
+
|
62
|
+
# See llvm::PassManagerBuilder::DisableUnrollLoops.
|
63
|
+
#
|
64
|
+
# @method pass_manager_builder_set_disable_unroll_loops(pmb, value)
|
65
|
+
# @param [OpaquePassManagerBuilder] pmb
|
66
|
+
# @param [Integer] value
|
67
|
+
# @return [nil]
|
68
|
+
# @scope class
|
69
|
+
attach_function :pass_manager_builder_set_disable_unroll_loops, :LLVMPassManagerBuilderSetDisableUnrollLoops, [OpaquePassManagerBuilder, :int], :void
|
70
|
+
|
71
|
+
# See llvm::PassManagerBuilder::DisableSimplifyLibCalls
|
72
|
+
#
|
73
|
+
# @method pass_manager_builder_set_disable_simplify_lib_calls(pmb, value)
|
74
|
+
# @param [OpaquePassManagerBuilder] pmb
|
75
|
+
# @param [Integer] value
|
76
|
+
# @return [nil]
|
77
|
+
# @scope class
|
78
|
+
attach_function :pass_manager_builder_set_disable_simplify_lib_calls, :LLVMPassManagerBuilderSetDisableSimplifyLibCalls, [OpaquePassManagerBuilder, :int], :void
|
79
|
+
|
80
|
+
# See llvm::PassManagerBuilder::Inliner.
|
81
|
+
#
|
82
|
+
# @method pass_manager_builder_use_inliner_with_threshold(pmb, threshold)
|
83
|
+
# @param [OpaquePassManagerBuilder] pmb
|
84
|
+
# @param [Integer] threshold
|
85
|
+
# @return [nil]
|
86
|
+
# @scope class
|
87
|
+
attach_function :pass_manager_builder_use_inliner_with_threshold, :LLVMPassManagerBuilderUseInlinerWithThreshold, [OpaquePassManagerBuilder, :uint], :void
|
88
|
+
|
89
|
+
# See llvm::PassManagerBuilder::populateFunctionPassManager.
|
90
|
+
#
|
91
|
+
# @method pass_manager_builder_populate_function_pass_manager(pmb, pm)
|
92
|
+
# @param [OpaquePassManagerBuilder] pmb
|
93
|
+
# @param [FFI::Pointer(PassManagerRef)] pm
|
94
|
+
# @return [nil]
|
95
|
+
# @scope class
|
96
|
+
attach_function :pass_manager_builder_populate_function_pass_manager, :LLVMPassManagerBuilderPopulateFunctionPassManager, [OpaquePassManagerBuilder, :pointer], :void
|
97
|
+
|
98
|
+
# See llvm::PassManagerBuilder::populateModulePassManager.
|
99
|
+
#
|
100
|
+
# @method pass_manager_builder_populate_module_pass_manager(pmb, pm)
|
101
|
+
# @param [OpaquePassManagerBuilder] pmb
|
102
|
+
# @param [FFI::Pointer(PassManagerRef)] pm
|
103
|
+
# @return [nil]
|
104
|
+
# @scope class
|
105
|
+
attach_function :pass_manager_builder_populate_module_pass_manager, :LLVMPassManagerBuilderPopulateModulePassManager, [OpaquePassManagerBuilder, :pointer], :void
|
106
|
+
|
107
|
+
# See llvm::PassManagerBuilder::populateLTOPassManager.
|
108
|
+
#
|
109
|
+
# @method pass_manager_builder_populate_lto_pass_manager(pmb, pm, internalize, run_inliner)
|
110
|
+
# @param [OpaquePassManagerBuilder] pmb
|
111
|
+
# @param [FFI::Pointer(PassManagerRef)] pm
|
112
|
+
# @param [Integer] internalize
|
113
|
+
# @param [Integer] run_inliner
|
114
|
+
# @return [nil]
|
115
|
+
# @scope class
|
116
|
+
attach_function :pass_manager_builder_populate_lto_pass_manager, :LLVMPassManagerBuilderPopulateLTOPassManager, [OpaquePassManagerBuilder, :pointer, :int, :int], :void
|
117
|
+
|
118
|
+
end
|