Skip to content
This repository
tree: 2a7b342b12
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 79 lines (64 sloc) 1.436 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78
# Interprocedural optimization (IPO)
require 'llvm'
require 'llvm/core'
require 'llvm/transforms/ipo_ffi'

module LLVM
  class PassManager
    # @LLVMpass arg_promotion
    def arg_promote!
      C.add_argument_promotion_pass(self)
    end

    # @LLVMpass const_merge
    def const_merge!
      C.add_constant_merge_pass(self)
    end

    # @LLVMpass dae
    def dae!
      C.add_dead_arg_elimination(self)
    end

    # @LLVMpass function_attrs
    def fun_attrs!
      C.add_function_attrs_pass(self)
    end

    # @LLVMpass inline
    def inline!
      C.add_function_inlining_pass(self)
    end

    # @LLVMpass always_inline
    def always_inline!
      C.add_always_inliner_pass(self)
    end

    # @LLVMpass gdce
    def gdce!
      C.add_global_dce_pass(self)
    end

    # @LLVMpass global_opt
    def global_opt!
      C.add_global_optimizer_pass(self)
    end

    # @LLVMpass ipcp
    def ipcp!
      C.add_ip_constant_propagation_pass(self)
    end

    # @LLVMpass prune_eh
    def prune_eh!
      C.add_prune_eh_pass(self)
    end

    # @LLVMpass ipsccp
    def ipsccp!
      C.add_ipsccp_pass(self)
    end

    # @LLVMpass internalize
    def internalize!(all_but_main=true)
      C.add_internalize_pass(self, all_but_main)
    end

    # @LLVMpass sdp
    def sdp!
      C.add_strip_dead_prototypes_pass(self)
    end

    # @LLVMpass strip
    def strip!
      C.add_strip_symbols_pass(self)
    end
  end
end
Something went wrong with that request. Please try again.