Class: LLVM::FunctionPassManager

Inherits:
PassManager show all
Defined in:
lib/llvm/core/pass_manager.rb

Instance Method Summary collapse

Methods inherited from PassManager

#<<, #adce!, #always_inline!, #arg_promote!, #basicaa!, #bb_vectorize!, #const_merge!, #constprop!, #cvprop!, #dae!, #dispose, #dse!, #early_cse!, #fun_attrs!, #gdce!, #global_opt!, #gvn!, #indvars!, #inline!, #instcombine!, #internalize!, #ipcp!, #ipsccp!, #jump_threading!, #licm!, #loop_deletion!, #loop_idiom!, #loop_rotate!, #loop_unroll!, #loop_unswitch!, #loop_vectorize!, #lower_expect!, #mem2reg!, #memcpyopt!, #mergefunc!, #prune_eh!, #reassociate!, #reg2mem!, #scalarrepl!, #scalarrepl_ssa!, #scalarrepl_threshold!, #sccp!, #sdp!, #simplify_libcalls!, #simplifycfg!, #slp_vectorize!, #strip!, #tailcallelim!, #tbaa!, #to_ptr

Constructor Details

#initialize(machine, mod) ⇒ FunctionPassManager

Creates a new function pass manager.



61
62
63
64
65
66
# File 'lib/llvm/core/pass_manager.rb', line 61

def initialize(machine, mod)
  @ptr = C.create_function_pass_manager_for_module(mod)
  C.add_target_data(machine.data_layout, @ptr)

  C.initialize_function_pass_manager(self) != 0
end

Instance Method Details

#run(fn) ⇒ true, false

Run the pass queue on the given function.

Parameters:

Returns:

  • (true, false)

    indicates whether the function was modified.



72
73
74
# File 'lib/llvm/core/pass_manager.rb', line 72

def run(fn)
  C.run_function_pass_manager(self, fn) != 0
end