Class: LLVM::FunctionType
Instance Attribute Summary
Attributes inherited from Type
Attributes included from PointerIdentity
Instance Method Summary collapse
-
#argument_types ⇒ Object
: -> Array.
-
#element_type ⇒ Object
: -> self.
-
#return_type ⇒ Object
: -> Type.
-
#vararg? ⇒ Boolean
: -> bool.
Methods inherited from Type
#===, #aggregate?, #align, array, double, #dump, float, from_ptr, function, integer, label, #literal_struct?, named, #null, #null_pointer, opaque_struct, #opaque_struct?, #packed_struct?, #pointer, pointer, #poison, ptr, #size, struct, #to_s, #undef, vector, void, x86_amx, x86_mmx
Methods included from PointerIdentity
Instance Method Details
#argument_types ⇒ Object
: -> Array
355 356 357 358 359 360 361 362 363 |
# File 'lib/llvm/core/type.rb', line 355 def argument_types size = C.count_param_types(self) result = [] #: Array[Type] 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) } end |
#element_type ⇒ Object
: -> self
350 351 352 |
# File 'lib/llvm/core/type.rb', line 350 def element_type self end |
#return_type ⇒ Object
: -> Type
345 346 347 |
# File 'lib/llvm/core/type.rb', line 345 def return_type Type.from_ptr(C.get_return_type(self)) end |
#vararg? ⇒ Boolean
: -> bool
366 367 368 |
# File 'lib/llvm/core/type.rb', line 366 def vararg? C.is_function_var_arg(self) != 0 end |