#include "mcg.h" void pass_add_prologue_epilogue(void) { int i, j, k; current_proc->usedregs.count = 0; for (i=0; ihops.count; j++) { struct hop* hop = bb->hops.item[j]; for (k=0; kregsin.count; k++) array_appendu(¤t_proc->usedregs, hop->regsin.item[k].left); for (k=0; kregsout.count; k++) array_appendu(¤t_proc->usedregs, hop->regsout.item[k].left); } } platform_calculate_offsets(); array_insert(¤t_proc->entry->hops, platform_prologue(), 0); if (current_proc->exit) { current_proc->exit->hops.count = 0; array_append(¤t_proc->exit->hops, platform_epilogue()); } } /* vim: set sw=4 ts=4 expandtab : */