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, #constant?, #dump, from_ptr, #name, #name=, #null?, #remove_attribute, to_ptr, #type, type, #undefined?

Methods included from PointerIdentity

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

Instance Method Details

#nextObject

Returns the next instruction after this one.



939
940
941
942
# File 'lib/llvm/core/value.rb', line 939

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

#parentObject

Returns the parent of the instruction (a BasicBlock).



933
934
935
936
# File 'lib/llvm/core/value.rb', line 933

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.



945
946
947
948
# File 'lib/llvm/core/value.rb', line 945

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