Class: LLVM::FunctionType

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

Instance Method Summary collapse

Methods inherited from Type

#aggregate?, #align, array, #dump, from_ptr, function, #kind, label, #literal_struct?, named, #null, #null_pointer, opaque_struct, #opaque_struct?, #packed_struct?, #pointer, pointer, ptr, rec, #size, struct, #to_s, vector, void, x86_amx, x86_mmx

Methods included from PointerIdentity

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

Instance Method Details

#argument_typesObject



200
201
202
203
204
205
206
207
208
# File 'lib/llvm/core/type.rb', line 200

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

#element_typeObject



196
197
198
# File 'lib/llvm/core/type.rb', line 196

def element_type
  self
end

#return_typeObject



192
193
194
# File 'lib/llvm/core/type.rb', line 192

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

#vararg?Boolean

Returns:

  • (Boolean)


210
211
212
# File 'lib/llvm/core/type.rb', line 210

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