Class: LLVM::FunctionType

Inherits:
Type
  • Object
show all
Defined in:
lib/llvm/core/type.rb

Instance Method Summary collapse

Methods inherited from Type

#align, array, #dump, #element_type, from_ptr, function, #kind, #null, #null_pointer, #pointer, pointer, rec, #size, struct, vector, void

Methods included from PointerIdentity

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

Instance Method Details

#argument_typesObject



124
125
126
127
128
129
130
131
132
# File 'lib/llvm/core/type.rb', line 124

def argument_types
  size = C.count_param_types(self)
  result = nil
  FFI::MemoryPointer.new(FFI.type_size(:pointer) * size) do |types_ptr|
    C.get_param_types(self, types_ptr)
    result = types_ptr.read_array_of_pointer(size)
  end
  result.map{ |p| Type.from_ptr(p, nil) }
end

#return_typeObject



120
121
122
# File 'lib/llvm/core/type.rb', line 120

def return_type
  Type.from_ptr(C.get_return_type(self), nil)
end

#vararg?Boolean

Returns:

  • (Boolean)


134
135
136
# File 'lib/llvm/core/type.rb', line 134

def vararg?
  C.is_function_var_arg(self) != 0
end