Class: RLTK::CG::SwitchInst

Inherits:
Instruction show all
Defined in:
lib/rltk/cg/instruction.rb

Overview

An Instruction representing a conditional jump with multiple cases.

Constant Summary

Constants inherited from Instruction

Instruction::TESTABLE

Instance Attribute Summary

Attributes included from BindingClass

#ptr

Instance Method Summary collapse

Methods inherited from Instruction

from_ptr, #initialize, #next, #parent, #previous

Methods inherited from User

#operands

Methods inherited from Value

#==, #attributes, #bitcast, #constant?, #dump, #hash, #initialize, #name, #name=, #null?, #print, #trunc, #trunc_or_bitcast, #type, #undefined?, #zextend, #zextend_or_bitcast

Methods included from BindingClass

#==

Constructor Details

This class inherits a constructor from RLTK::CG::Instruction

Instance Method Details

#add_case(val, block) ⇒ void

This method returns an undefined value.

Add a case to this conditional jump.

Parameters:

  • val (Value)

    Value for this case.

  • block (BasicBlock)

    BasicBlock to jump to if this case is matched.



280
281
282
# File 'lib/rltk/cg/instruction.rb', line 280

def add_case(val, block)
	Bindings.add_case(@ptr, val, block)
end