TPDE
|
#include <CompilerBase.hpp>
Classes | |
struct | ValRefSpecial |
A default implementation for ValRefSpecial. More... | |
Public Member Functions | |
CompilerBase (Adaptor *adaptor) | |
Initialize a CompilerBase, should be called by the derived classes. | |
Derived * | derived () |
bool | compile () |
void | reset () |
CCAssigner * | cur_cc_assigner () noexcept |
Get CCAssigner for current function. | |
void | release_assignment (ValLocalIdx local_idx, ValueAssignment *) noexcept |
void | init_variable_ref (ValLocalIdx local_idx, u32 var_ref_data) noexcept |
Init a variable-ref assignment. | |
void | init_variable_ref (IRValueRef value, u32 var_ref_data) noexcept |
Init a variable-ref assignment. | |
ValueRef | result_ref (IRValueRef value) noexcept |
Get a defining reference to a value. | |
AsmReg | gval_as_reg (GenericValuePart &gv) noexcept |
AsmReg | gval_as_reg_reuse (GenericValuePart &gv, ScratchReg &dst) noexcept |
Reg | select_reg (RegBank bank, u64 exclusion_mask) noexcept |
Select an available register, evicting loaded values if needed. | |
void | reload_to_reg (AsmReg dst, AssignmentPartRef ap) noexcept |
Reload a value part from memory or recompute variable address. | |
void | spill (AssignmentPartRef ap) noexcept |
Ensure the value is spilled in its stack slot (except variable refs). | |
void | evict (AssignmentPartRef ap) noexcept |
Evict the value from its register, spilling if needed, and free register. | |
void | evict_reg (Reg reg) noexcept |
Evict the value from the register, spilling if needed, and free register. | |
void | free_reg (Reg reg) noexcept |
Free the register. Requires that the contained value is already spilled. | |
void | release_regs_after_return () noexcept |
void | begin_branch_region () noexcept |
Indicate beginning of region where value-state must not change. | |
void | end_branch_region () noexcept |
Indicate end of region where value-state must not change. | |
Public Attributes | |
bool | generating_branch = false |
The base class for the compiler. It implements the main platform independent compilation logic and houses the analyzer
Definition at line 100 of file CompilerBase.hpp.
bool tpde::CompilerBase< Adaptor, Derived, Config >::compile | ( | ) |
Compile the functions returned by Adaptor::funcs
Definition at line 700 of file CompilerBase.hpp.
|
inline |
shortcut for casting to the Derived class so that overloading works
Definition at line 284 of file CompilerBase.hpp.
|
noexcept |
Get generic value part into a single register, evaluating expressions and materializing immediates as required.
Definition at line 1131 of file CompilerBase.hpp.
|
noexcept |
Like gval_as_reg; if the GenericValuePart owns a reusable register (either a ScratchReg, possibly due to materialization, or a reusable ValuePartRef), store it in dst.
Definition at line 1154 of file CompilerBase.hpp.
|
noexcept |
Release an assignment when reference count drops to zero, either frees the assignment immediately or delays free to the end of the live range.
Definition at line 904 of file CompilerBase.hpp.
|
noexcept |
When reaching a point in the function where no other blocks will be reached anymore, use this function to release register assignments after the end of that block so the compiler does not accidentally use registers which don't contain any values
Definition at line 1453 of file CompilerBase.hpp.
void tpde::CompilerBase< Adaptor, Derived, Config >::reset | ( | ) |
Reset any leftover data from the previous compilation such that it will not affect the next compilation
Definition at line 759 of file CompilerBase.hpp.
bool tpde::CompilerBase< Adaptor, Derived, Config >::generating_branch = false |
Whether we are currently in the middle of generating branch-related code and therefore must not change any value-related state.
Definition at line 164 of file CompilerBase.hpp.