ScEpTIC.AST.elements.instructions package

Submodules

ScEpTIC.AST.elements.instructions.binary_operation module

class ScEpTIC.AST.elements.instructions.binary_operation.BinaryOperation(operation_type, first_operand, second_operand, target, is_bitwise, specific_attributes)

Bases: ScEpTIC.AST.elements.instruction.Instruction

AST nodes for the LLVM Binary Instructions group https://llvm.org/docs/LangRef.html#binaryops

NB: each result is stored as SIGNED int, even if the operation is unsigned. The sign bit is an interpretation of UNSIGNED operations, which will manage that by converting the int to its unsigned equivalent.

get_input_lookup()

Returns the input lookup data for the current operation

get_uses()

Returns a list containing the names of the registers used by this instruction. (used by register allocation)

get_val()

Returns the value obtained from the operation. It converts address operands (if present) to relative spaces, applies the operation and converts them back to the absolute space.

replace_reg_name(old_reg_name, new_reg_name)

Replaces the name of a register used by the instruction with a new one. (used by register allocation)

ScEpTIC.AST.elements.instructions.conversion module

class ScEpTIC.AST.elements.instructions.conversion.ConversionOperation(conversion_type, operand, target_type, target)

Bases: ScEpTIC.AST.elements.instruction.Instruction

AST nodes for the LLVM Bitwise Instructions group https://llvm.org/docs/LangRef.html#bitwiseops

get_input_lookup()

Returns the input lookup data for the current operation

get_uses()

Returns a list containing the names of the registers used by this instruction. (used by register allocation)

get_val()

Returns the value obtained from the operation. It converts address operands (if present) to relative spaces, applies the operation and converts them back to the absolute space.

replace_reg_name(old_reg_name, new_reg_name)

Replaces the name of a register used by the instruction with a new one. (used by register allocation)

ScEpTIC.AST.elements.instructions.memory_operations module

class ScEpTIC.AST.elements.instructions.memory_operations.AllocaOperation(target, element_type, elements_number, align)

Bases: ScEpTIC.AST.elements.instruction.Instruction

AST node of the LLVM Memory Instructions group - Alloca Instruction https://llvm.org/docs/LangRef.html#memoryops

get_defs()

Returns a list of registers defined by this instruction. (used by register allocation)

get_ignore()

Returns a list of register names to be ignored by register allocation. For alloca operation it is the target register.

get_input_lookup()

Returns the input lookup data for the current operation

get_uses()

Returns a list containing the names of the registers used by this instruction. (used by register allocation)

run()

Executes the operation and the target assignment.

class ScEpTIC.AST.elements.instructions.memory_operations.GetElementPointerOperation(target, element, base_type, indexes, inbounds)

Bases: ScEpTIC.AST.elements.instruction.Instruction

AST node of the LLVM Memory Instructions group - GetElementPointer Instruction https://llvm.org/docs/LangRef.html#memoryops

get_input_lookup()

Returns the input lookup data for the current operation

get_uses()

Returns a list containing the names of the registers used by this instruction. (used by register allocation)

get_val()

Returns the represented absolute address.

replace_reg_name(old_reg_name, new_reg_name)

Replaces the name of a register used by the instruction with a new one. (used by register allocation)

class ScEpTIC.AST.elements.instructions.memory_operations.LoadOperation(target, load_type, element, align, volatile)

Bases: ScEpTIC.AST.elements.instruction.Instruction

AST node of the LLVM Memory Instructions group - Load Instruction https://llvm.org/docs/LangRef.html#memoryops

get_ignore()

Returns a list of register names to be ignored by register allocation. For load operation it is the target register, if the load operation is marked to be used as argument of a function call, since it will be loaded as a stack offset.

get_input_lookup()

Returns the input lookup data for the current operation

get_load_address()

Returns the address to be loaded.

get_uses()

Returns a list containing the names of the registers used by this instruction. (used by register allocation)

get_val()

Executes the operation and the target assignment.

replace_reg_name(old_reg_name, new_reg_name)

Replaces the name of a register used by the instruction with a new one. (used by register allocation)

run()

Executes the load operation and the target assignment.

class ScEpTIC.AST.elements.instructions.memory_operations.StoreOperation(target, value, align, volatile)

Bases: ScEpTIC.AST.elements.instruction.Instruction

AST node of the LLVM Memory Instructions group - Store Instruction https://llvm.org/docs/LangRef.html#memoryops

get_defs()

Returns a list of registers defined by this instruction. (used by register allocation)

get_store_address()

Returns the address in which the value will be stored.

get_uses()

Returns a list containing the names of the registers used by this instruction. (used by register allocation)

replace_reg_name(old_reg_name, new_reg_name)

Replaces the name of a register used by the instruction with a new one. (used by register allocation)

run()

Executes the operation and the target assignment.

ScEpTIC.AST.elements.instructions.other_operations module

class ScEpTIC.AST.elements.instructions.other_operations.CallOperation(target, function_name, return_type, function_signature, function_args, attrs)

Bases: ScEpTIC.AST.elements.instruction.Instruction

AST node of the LLVM Other Instructions group - Call Instruction https://llvm.org/docs/LangRef.html#otherops

get_function_max_reg_usage()

Returns the number of physical registers used by this function.

get_type_from_virtual_reg(virtual_reg)

Returns the type of an argument given its virtual register name.

get_uses()

Returns a list containing the names of the registers used by this instruction. (used by register allocation)

ignore = []
replace_reg_name(old_reg_name, new_reg_name)

Replaces the name of a register used by the instruction with a new one. (used by register allocation)

run()

Runs the call operation.

tick_count = 4
class ScEpTIC.AST.elements.instructions.other_operations.CompareOperation(target, first_operand, second_operand, condition, comparation_type, operation_code)

Bases: ScEpTIC.AST.elements.instruction.Instruction

AST node of the LLVM Other Instructions group - Compare Instruction https://llvm.org/docs/LangRef.html#otherops

get_input_lookup()

Returns the input lookup data for the current operation

get_uses()

Returns a list containing the names of the registers used by this instruction. (used by register allocation)

get_val()

Returns the value obtained from the operation. It converts address operands (if present) to relative spaces, and applies the comparisons.

static is_one_qnan(value1, value2)

Returns if at least one of two values are QNAN

static is_qnan(value)

Returns if a value is a QNAN

replace_reg_name(old_reg_name, new_reg_name)

Replaces the name of a register used by the instruction with a new one. (used by register allocation)

class ScEpTIC.AST.elements.instructions.other_operations.PhiOperation(target, return_type, values)

Bases: ScEpTIC.AST.elements.instruction.Instruction

AST node of the LLVM Other Instructions group - Phi Instruction https://llvm.org/docs/LangRef.html#otherops

get_input_lookup()

Returns the input lookup data for the current operation

get_uses()

Returns a list containing the names of the registers used by this instruction. (used by register allocation)

get_val()

Returns the value obtained from the operation.

replace_reg_name(old_reg_name, new_reg_name)

Replaces the name of a register used by the instruction with a new one. (used by register allocation)

class ScEpTIC.AST.elements.instructions.other_operations.SelectOperation(target, condition, first_operand, second_operand)

Bases: ScEpTIC.AST.elements.instruction.Instruction

AST node of the LLVM Other Instructions group - Select Instruction https://llvm.org/docs/LangRef.html#otherops

get_input_lookup()

Returns the input lookup data for the current operation

get_uses()

Returns a list containing the names of the registers used by this instruction. (used by register allocation)

get_val()

Returns the result of the operation.

replace_reg_name(old_reg_name, new_reg_name)

Replaces the name of a register used by the instruction with a new one. (used by register allocation)

class ScEpTIC.AST.elements.instructions.other_operations.VaArgOperation(target, element, arg_type)

Bases: ScEpTIC.AST.elements.instruction.Instruction

AST node of the LLVM Other Instructions group - VaArg Instruction NOT SUPPORTED IN ScEpTIC https://llvm.org/docs/LangRef.html#otherops

run()

Executes the operation and the target assignment.

ScEpTIC.AST.elements.instructions.termination_instructions module

class ScEpTIC.AST.elements.instructions.termination_instructions.BranchOperation(condition, target_true, target_false)

Bases: ScEpTIC.AST.elements.instruction.Instruction

AST node of the LLVM Termination Instructions group - Branch Instruction https://llvm.org/docs/LangRef.html#terminators

get_uses()

Returns a list containing the names of the registers used by this instruction. (used by register allocation)

replace_reg_name(old_reg_name, new_reg_name)

Replaces the name of a register used by the instruction with a new one. (used by register allocation)

run()

Executes the branch operation.

class ScEpTIC.AST.elements.instructions.termination_instructions.ReturnOperation(value)

Bases: ScEpTIC.AST.elements.instruction.Instruction

AST node of the LLVM Termination Instructions group - Return Instruction https://llvm.org/docs/LangRef.html#terminators

get_uses()

Returns a list containing the names of the registers used by this instruction. (used by register allocation)

replace_reg_name(old_reg_name, new_reg_name)

Replaces the name of a register used by the instruction with a new one. (used by register allocation)

run()

Retrieves the value of the return operation and calls the return’s callback.

tick_count = 6
class ScEpTIC.AST.elements.instructions.termination_instructions.SwitchOperation(element, default_label, switch_pairs)

Bases: ScEpTIC.AST.elements.instruction.Instruction

AST node of the LLVM Termination Instructions group - Switch Instruction https://llvm.org/docs/LangRef.html#terminators

get_uses()

Returns a list containing the names of the registers used by this instruction. (used by register allocation)

replace_reg_name(old_reg_name, new_reg_name)

Replaces the name of a register used by the instruction with a new one. (used by register allocation)

run()

Executes the switch operation.

Module contents