Class: RLTK::CG::ConstantArray
- Inherits:
-
ConstantAggregate
- Object
- Value
- User
- Constant
- ConstantAggregate
- RLTK::CG::ConstantArray
- Defined in:
- lib/rltk/cg/value.rb
Overview
A constant array value.
Direct Known Subclasses
Instance Attribute Summary
Attributes included from BindingClass
Instance Method Summary collapse
-
#initialize(element_type, size_or_values, &block) {|index| ... } ⇒ ConstantArray
constructor
Create a new constant array value.
- #size ⇒ Object (also: #length)
Methods inherited from ConstantAggregate
Methods inherited from Constant
#addr_space_cast, #bitcast_to, #get_element_ptr, #get_element_ptr_in_bounds
Methods inherited from User
Methods inherited from Value
#==, #attributes, #bitcast, #constant?, #dump, #hash, #name, #name=, #null?, #print, #trunc, #trunc_or_bitcast, #type, #undefined?, #zextend, #zextend_or_bitcast
Methods included from BindingClass
Constructor Details
#initialize(element_type, size_or_values, &block) {|index| ... } ⇒ ConstantArray
Create a new constant array value.
416 417 418 419 420 |
# File 'lib/rltk/cg/value.rb', line 416 def initialize(element_type, size_or_values, &block) vals_ptr = make_ptr_to_elements(size_or_values, &block) element_type = check_cg_type(element_type, Type, 'element_type') @ptr = Bindings.const_array(element_type, vals_ptr, vals_ptr.size / vals_ptr.type_size) end |
Instance Method Details
#size ⇒ Object Also known as: length
422 423 424 |
# File 'lib/rltk/cg/value.rb', line 422 def size self.type.size end |