Class: LLVM::Function
- Inherits:
-
GlobalValue
- Object
- Value
- User
- Constant
- GlobalValue
- LLVM::Function
- Defined in:
- lib/llvm/analysis.rb,
lib/llvm/core/value.rb
Defined Under Namespace
Classes: AttributeCollection, BasicBlockCollection, ParameterCollection
Instance Method Summary collapse
-
#add_attribute(attr, index = -1)) ⇒ Object
Adds attr to this value’s attributes.
- #attribute_count ⇒ Object
- #attributes ⇒ Object
-
#basic_blocks ⇒ Object
Returns an Enumerable of the BasicBlocks in this function.
-
#call_conv=(conv) ⇒ Object
Sets the function’s calling convention and returns it.
- #function_attributes ⇒ Object
- #function_type ⇒ Object
- #gc ⇒ Object
- #gc=(name) ⇒ Object
- #param_attributes(index) ⇒ Object
-
#params ⇒ Object
Returns an Enumerable of the parameters in the function.
-
#remove_attribute(attr, index = -1)) ⇒ Object
Removes the given attribute from the function.
- #return_attributes ⇒ Object
- #type ⇒ Object
-
#verify ⇒ true, false
Verify that a function is valid.
-
#verify! ⇒ true, false
Verify that a function is valid, and abort the process if not.
Methods inherited from GlobalValue
#alignment, #alignment=, #declaration?, #dll_storage_class, #dll_storage_class=, #global_constant=, #global_constant?, #initializer, #initializer=, #linkage, #linkage=, #section, #section=, #unnamed_addr=, #unnamed_addr?, #visibility, #visibility=
Methods inherited from Constant
#bitcast_to, #gep, null, null_ptr, #ptr_to_int, undef
Methods inherited from User
Methods inherited from Value
#constant?, #dump, from_ptr, #name, #name=, #null?, to_ptr, type, #undefined?
Methods included from PointerIdentity
Instance Method Details
#add_attribute(attr, index = -1)) ⇒ Object
Adds attr to this value’s attributes.
731 732 733 |
# File 'lib/llvm/core/value.rb', line 731 def add_attribute(attr, index = -1) AttributeCollection.new(self, index).add(attr) end |
#attribute_count ⇒ Object
740 741 742 |
# File 'lib/llvm/core/value.rb', line 740 def attribute_count function_attributes.count end |
#attributes ⇒ Object
744 745 746 |
# File 'lib/llvm/core/value.rb', line 744 def attributes function_attributes.to_a end |
#basic_blocks ⇒ Object
Returns an Enumerable of the BasicBlocks in this function.
718 719 720 |
# File 'lib/llvm/core/value.rb', line 718 def basic_blocks @basic_block_collection ||= BasicBlockCollection.new(self) end |
#call_conv=(conv) ⇒ Object
Sets the function’s calling convention and returns it.
712 713 714 715 |
# File 'lib/llvm/core/value.rb', line 712 def call_conv=(conv) C.set_function_call_conv(self, conv) conv end |
#function_attributes ⇒ Object
748 749 750 |
# File 'lib/llvm/core/value.rb', line 748 def function_attributes AttributeCollection.new(self, -1) end |
#function_type ⇒ Object
726 727 728 |
# File 'lib/llvm/core/value.rb', line 726 def function_type type.element_type end |
#gc=(name) ⇒ Object
898 899 900 |
# File 'lib/llvm/core/value.rb', line 898 def gc=(name) C.set_gc(self, name) end |
#param_attributes(index) ⇒ Object
756 757 758 |
# File 'lib/llvm/core/value.rb', line 756 def param_attributes(index) AttributeCollection.new(self, index) end |
#params ⇒ Object
Returns an Enumerable of the parameters in the function.
865 866 867 |
# File 'lib/llvm/core/value.rb', line 865 def params @parameter_collection ||= ParameterCollection.new(self) end |
#remove_attribute(attr, index = -1)) ⇒ Object
Removes the given attribute from the function.
736 737 738 |
# File 'lib/llvm/core/value.rb', line 736 def remove_attribute(attr, index = -1) AttributeCollection.new(self, index).remove(attr) end |
#return_attributes ⇒ Object
752 753 754 |
# File 'lib/llvm/core/value.rb', line 752 def return_attributes AttributeCollection.new(self, 0) end |
#type ⇒ Object
722 723 724 |
# File 'lib/llvm/core/value.rb', line 722 def type Type.from_ptr(C.type_of(self), :pointer) end |
#verify ⇒ true, false
Verify that a function is valid.
33 34 35 |
# File 'lib/llvm/analysis.rb', line 33 def verify do_verification(:return_status) end |
#verify! ⇒ true, false
Verify that a function is valid, and abort the process if not.
39 40 41 |
# File 'lib/llvm/analysis.rb', line 39 def verify! do_verification(:abort_process) end |