Class: LLVM::PassManagerBuilder

Inherits:
Object
  • Object
show all
Includes:
PointerIdentity
Defined in:
lib/llvm/transforms/builder.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from PointerIdentity

#==, #eql?, #hash, #to_ptr

Constructor Details

#initializePassManagerBuilder

Returns a new instance of PassManagerBuilder.



18
19
20
21
22
23
24
25
26
27
# File 'lib/llvm/transforms/builder.rb', line 18

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_thresholdObject

Returns the value of attribute inliner_threshold.



16
17
18
# File 'lib/llvm/transforms/builder.rb', line 16

def inliner_threshold
  @inliner_threshold
end

#opt_levelObject

Returns the value of attribute opt_level.



12
13
14
# File 'lib/llvm/transforms/builder.rb', line 12

def opt_level
  @opt_level
end

#simplify_lib_callsObject

Returns the value of attribute simplify_lib_calls.



15
16
17
# File 'lib/llvm/transforms/builder.rb', line 15

def simplify_lib_calls
  @simplify_lib_calls
end

#size_levelObject

Returns the value of attribute size_level.



11
12
13
# File 'lib/llvm/transforms/builder.rb', line 11

def size_level
  @size_level
end

#unit_at_a_timeObject

Returns the value of attribute unit_at_a_time.



13
14
15
# File 'lib/llvm/transforms/builder.rb', line 13

def unit_at_a_time
  @unit_at_a_time
end

#unroll_loopsObject

Returns the value of attribute unroll_loops.



14
15
16
# File 'lib/llvm/transforms/builder.rb', line 14

def unroll_loops
  @unroll_loops
end

Instance Method Details

#build(pass_manager) ⇒ Object

Populate a pass manager.

Parameters:



76
77
78
79
80
81
82
83
84
# File 'lib/llvm/transforms/builder.rb', line 76

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.

Parameters:



88
89
90
# File 'lib/llvm/transforms/builder.rb', line 88

def build_with_lto(pass_manager, internalize = false, run_inliner = false)
  raise "build_with_lto is not currently supported"
end

#disposeObject



29
30
31
32
33
34
# File 'lib/llvm/transforms/builder.rb', line 29

def dispose
  return if @ptr.nil?

  C.pass_manager_builder_dispose(@ptr)
  @ptr = nil
end