ACSE 2.0.3
Advanced Compiler System for Education
Loading...
Searching...
No Matches
Register Allocator

Register Allocation functions. More...

Functions

t_regAllocatornewRegAllocator (t_program *program)
void deleteRegAllocator (t_regAllocator *regAlloc)
void regallocRun (t_regAllocator *regAlloc)
void regallocDump (t_regAllocator *regAlloc, FILE *fout)

Detailed Description

Register Allocation functions.

Once the program has been translated to an initial assembly-like intermediate language, the compiler needs to allocate each temporary register to a physical register. The register allocation object performs this process by using the linear scan algorithm on the program's control flow graph.

Function Documentation

◆ deleteRegAllocator()

void deleteRegAllocator ( t_regAllocator * regAlloc)

Deallocate a register allocator.

Parameters
regAllocThe register allocator object.

Definition at line 434 of file reg_alloc.c.

◆ newRegAllocator()

t_regAllocator * newRegAllocator ( t_program * program)

Create a new register allocator object for the given program.

Parameters
programThe program whose registers need to be allocated.
Returns
A new register allocator object.

Definition at line 384 of file reg_alloc.c.

◆ regallocDump()

void regallocDump ( t_regAllocator * regAlloc,
FILE * fout )

Dump the results of register allocation to the specified file.

Parameters
regAllocThe register allocation object.
foutThe file where to print the dump.

Definition at line 935 of file reg_alloc.c.

◆ regallocRun()

void regallocRun ( t_regAllocator * regAlloc)

Convert temporary register identifiers to real register identifiers, analyzing the live interval of each temporary register.

Parameters
regAllocThe register allocator object.

Definition at line 839 of file reg_alloc.c.