ack/mach/proto/mcg/pass_prologueepilogue.c
David Given 9504aec2bd Function termination gets routed through an exit block; we now have prologues
and epilogues. mcgg now exports some useful data as headers. Start factoring
out some of the architecture-specific bits into an architecture-specific file.
2016-10-15 18:38:46 +02:00

19 lines
365 B
C

#include "mcg.h"
void pass_add_prologue_epilogue(struct procedure* proc)
{
struct hop* prologue = platform_prologue(proc);
array_insert(&proc->entry->hops, prologue, 0);
if (proc->exit)
{
struct hop* epilogue = platform_epilogue(proc);
proc->exit->hops.count = 0;
array_append(&proc->exit->hops, epilogue);
}
}
/* vim: set sw=4 ts=4 expandtab : */