Class: LLVM::Instruction
Direct Known Subclasses
Class Method Summary collapse
Instance Method Summary collapse
- #inspect ⇒ Object
-
#next ⇒ Object
Returns the next instruction after this one.
- #opcode ⇒ Object
-
#parent ⇒ Object
Returns the parent of the instruction (a BasicBlock).
-
#previous ⇒ Object
Returns the previous instruction before this one.
Methods inherited from User
Methods inherited from Value
#add_attribute, #allocated_type, #constant?, #dump, from_ptr_kind, #global_parent, #kind, #name, #name=, #null?, #remove_attribute, to_ptr, #to_s, #type, type, #undefined?
Methods included from PointerIdentity
Class Method Details
.from_ptr(ptr) ⇒ Object
1052 1053 1054 1055 |
# File 'lib/llvm/core/value.rb', line 1052 def self.from_ptr(ptr) kind = C.get_value_kind(ptr) kind == :instruction ? super : LLVM::Value.from_ptr_kind(ptr) end |
Instance Method Details
#inspect ⇒ Object
1079 1080 1081 |
# File 'lib/llvm/core/value.rb', line 1079 def inspect { self.class.name => { opcode: opcode, ptr: @ptr } }.to_s end |
#next ⇒ Object
Returns the next instruction after this one.
1064 1065 1066 1067 |
# File 'lib/llvm/core/value.rb', line 1064 def next ptr = C.get_next_instruction(self) LLVM::Instruction.from_ptr(ptr) unless ptr.null? end |
#opcode ⇒ Object
1075 1076 1077 |
# File 'lib/llvm/core/value.rb', line 1075 def opcode C.get_instruction_opcode(self) end |
#parent ⇒ Object
Returns the parent of the instruction (a BasicBlock).
1058 1059 1060 1061 |
# File 'lib/llvm/core/value.rb', line 1058 def parent ptr = C.get_instruction_parent(self) LLVM::BasicBlock.from_ptr(ptr) unless ptr.null? end |
#previous ⇒ Object
Returns the previous instruction before this one.
1070 1071 1072 1073 |
# File 'lib/llvm/core/value.rb', line 1070 def previous ptr = C.get_previous_instruction(self) LLVM::Instruction.from_ptr(ptr) unless ptr.null? end |