Class: LLVM::Instruction

Inherits:
User show all
Defined in:
lib/llvm/core/value.rb

Direct Known Subclasses

CallInst, IndirectBr, Phi, SwitchInst

Instance Method Summary collapse

Methods inherited from User

#operands

Methods inherited from Value

#add_attribute, #allocated_type, #constant?, #dump, from_ptr, #name, #name=, #null?, #remove_attribute, to_ptr, #to_s, #type, type, #undefined?

Methods included from PointerIdentity

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

Instance Method Details

#nextObject

Returns the next instruction after this one.



976
977
978
979
# File 'lib/llvm/core/value.rb', line 976

def next
  ptr = C.get_next_instruction(self)
  LLVM::Instruction.from_ptr(ptr) unless ptr.null?
end

#opcodeObject



987
988
989
# File 'lib/llvm/core/value.rb', line 987

def opcode
  C.get_instruction_opcode(self)
end

#parentObject

Returns the parent of the instruction (a BasicBlock).



970
971
972
973
# File 'lib/llvm/core/value.rb', line 970

def parent
  ptr = C.get_instruction_parent(self)
  LLVM::BasicBlock.from_ptr(ptr) unless ptr.null?
end

#previousObject

Returns the previous instruction before this one.



982
983
984
985
# File 'lib/llvm/core/value.rb', line 982

def previous
  ptr = C.get_previous_instruction(self)
  LLVM::Instruction.from_ptr(ptr) unless ptr.null?
end