Class: LLVM::Function

Inherits:
GlobalValue show all
Defined in:
lib/llvm/analysis.rb,
lib/llvm/core/value.rb

Defined Under Namespace

Classes: BasicBlockCollection, ParameterCollection

Instance Method Summary collapse

Methods inherited from GlobalValue

#alignment, #alignment=, #declaration?, #global_constant=, #global_constant?, #initializer, #initializer=, #linkage, #linkage=, #section, #section=, #visibility, #visibility=

Methods inherited from Constant

#bitcast_to, #gep, null, null_ptr, undef

Methods inherited from User

#operands

Methods inherited from Value

#==, #constant?, #dump, #eql?, from_ptr, #initialize, #name, #name=, #null?, to_ptr, #to_ptr, type, #type, #undefined?

Constructor Details

This class inherits a constructor from LLVM::Value

Instance Method Details

#add_attribute(attr) ⇒ Object

Adds the given attribute to the function.



587
588
589
# File 'lib/llvm/core/value.rb', line 587

def add_attribute(attr)
  C.LLVMAddFunctionAttr(self, attr)
end

#basic_blocksObject

Returns an Enumerable of the BasicBlocks in this function.



597
598
599
# File 'lib/llvm/core/value.rb', line 597

def basic_blocks
  @basic_block_collection ||= BasicBlockCollection.new(self)
end

#call_conv=(conv) ⇒ Object

Sets the function’s calling convention and returns it.



581
582
583
584
# File 'lib/llvm/core/value.rb', line 581

def call_conv=(conv)
  C.LLVMSetFunctionCallConv(self, conv)
  conv
end

#paramsObject

Returns an Enumerable of the parameters in the function.



652
653
654
# File 'lib/llvm/core/value.rb', line 652

def params
  @parameter_collection ||= ParameterCollection.new(self)
end

#remove_attribute(attr) ⇒ Object

Removes the given attribute from the function.



592
593
594
# File 'lib/llvm/core/value.rb', line 592

def remove_attribute(attr)
  C.LLVMRemoveFunctionAttr(self, attr)
end

#verify(action = :abort_process) ⇒ Object



39
40
41
# File 'lib/llvm/analysis.rb', line 39

def verify(action = :abort_process)
  C.LLVMVerifyFunction(self, action) != 0
end