Class: LLVM::Phi
- Inherits:
-
Instruction
- Object
- Value
- User
- Instruction
- LLVM::Phi
- Defined in:
- lib/llvm/core/value.rb
Instance Method Summary collapse
-
#add_incoming(incoming) ⇒ Object
Add incoming branches to a phi node by passing an alternating list of resulting values and BasicBlocks.
Methods inherited from Instruction
#clear_exact!, #clear_nsw!, #clear_nuw!, #exact!, from_ptr, #inspect, #next, #nsw!, #nuw!, #opcode, #parent, #previous
Methods inherited from User
Methods inherited from Value
#add_attribute, #allocated_type, #allocated_type?, #constant?, #dump, from_ptr, from_ptr_kind, #gep_source_element_type, #gep_source_element_type?, #global_parent, #kind, #name, #name=, #null?, #poison?, #remove_attribute, to_ptr, #to_s, type, #type, #undef?
Methods included from PointerIdentity
Instance Method Details
#add_incoming(incoming) ⇒ Object
Add incoming branches to a phi node by passing an alternating list of resulting values and BasicBlocks. e.g.
phi.add_incoming(val1, block1, val2, block2, ...)
1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 |
# File 'lib/llvm/core/value.rb', line 1258 def add_incoming(incoming) blks = incoming.keys vals = incoming.values_at(*blks) size = incoming.size FFI::MemoryPointer.new(FFI.type_size(:pointer) * size) do |vals_ptr| vals_ptr.write_array_of_pointer(vals) FFI::MemoryPointer.new(FFI.type_size(:pointer) * size) do |blks_ptr| blks_ptr.write_array_of_pointer(blks) C.add_incoming(self, vals_ptr, blks_ptr, vals.size) end end nil end |