Class: LLVM::PassManagerBuilder
- Inherits:
-
Object
- Object
- LLVM::PassManagerBuilder
- Includes:
- PointerIdentity
- Defined in:
- lib/llvm/transforms/builder.rb
Instance Attribute Summary collapse
-
#inliner_threshold ⇒ Object
Returns the value of attribute inliner_threshold.
-
#opt_level ⇒ Object
Returns the value of attribute opt_level.
-
#simplify_lib_calls ⇒ Object
Returns the value of attribute simplify_lib_calls.
-
#size_level ⇒ Object
Returns the value of attribute size_level.
-
#unit_at_a_time ⇒ Object
Returns the value of attribute unit_at_a_time.
-
#unroll_loops ⇒ Object
Returns the value of attribute unroll_loops.
Instance Method Summary collapse
-
#build(pass_manager) ⇒ Object
Populate a pass manager.
-
#build_with_lto(pass_manager, internalize = false, run_inliner = false) ⇒ Object
Populate an LTO pass manager.
- #dispose ⇒ Object
-
#initialize ⇒ PassManagerBuilder
constructor
A new instance of PassManagerBuilder.
Methods included from PointerIdentity
Constructor Details
#initialize ⇒ PassManagerBuilder
Returns a new instance of PassManagerBuilder.
16 17 18 19 20 21 22 23 24 25 |
# File 'lib/llvm/transforms/builder.rb', line 16 def initialize @ptr = C.pass_manager_builder_create @size_level = 0 @opt_level = 0 @unit_at_a_time = false @unroll_loops = false @simplify_lib_calls = false @inliner_threshold = 0 end |
Instance Attribute Details
#inliner_threshold ⇒ Object
Returns the value of attribute inliner_threshold.
14 15 16 |
# File 'lib/llvm/transforms/builder.rb', line 14 def inliner_threshold @inliner_threshold end |
#opt_level ⇒ Object
Returns the value of attribute opt_level.
10 11 12 |
# File 'lib/llvm/transforms/builder.rb', line 10 def opt_level @opt_level end |
#simplify_lib_calls ⇒ Object
Returns the value of attribute simplify_lib_calls.
13 14 15 |
# File 'lib/llvm/transforms/builder.rb', line 13 def simplify_lib_calls @simplify_lib_calls end |
#size_level ⇒ Object
Returns the value of attribute size_level.
9 10 11 |
# File 'lib/llvm/transforms/builder.rb', line 9 def size_level @size_level end |
#unit_at_a_time ⇒ Object
Returns the value of attribute unit_at_a_time.
11 12 13 |
# File 'lib/llvm/transforms/builder.rb', line 11 def unit_at_a_time @unit_at_a_time end |
#unroll_loops ⇒ Object
Returns the value of attribute unroll_loops.
12 13 14 |
# File 'lib/llvm/transforms/builder.rb', line 12 def unroll_loops @unroll_loops end |
Instance Method Details
#build(pass_manager) ⇒ Object
Populate a pass manager.
74 75 76 77 78 79 80 81 82 |
# File 'lib/llvm/transforms/builder.rb', line 74 def build(pass_manager) case pass_manager when FunctionPassManager C.pass_manager_builder_populate_function_pass_manager(self, pass_manager) when PassManager C.pass_manager_builder_populate_module_pass_manager(self, pass_manager) end end |
#build_with_lto(pass_manager, internalize = false, run_inliner = false) ⇒ Object
Populate an LTO pass manager.
86 87 88 89 90 91 92 93 94 95 96 97 98 99 |
# File 'lib/llvm/transforms/builder.rb', line 86 def build_with_lto(pass_manager, internalize = false, run_inliner = false) if pass_manager.is_a?(FunctionPassManager) raise ArgumentError, "FunctionPassManager does not support LTO" end if internalize.kind_of?(Integer) || run_inliner.kind_of?(Integer) warn 'Warning: Passing Integer value to LLVM::PassManagerBuilder#build_with_lto is deprecated.' internalize = !internalize.zero? if internalize.kind_of?(Integer) run_inliner = !run_inliner.zero? if run_inliner.kind_of?(Integer) end C.pass_manager_builder_populate_lto_pass_manager(self, pass_manager, flag(internalize), flag(run_inliner)) end |
#dispose ⇒ Object
27 28 29 30 31 32 |
# File 'lib/llvm/transforms/builder.rb', line 27 def dispose return if @ptr.nil? C.pass_manager_builder_dispose(@ptr) @ptr = nil end |