ps5: function epilogue
This commit is contained in:
@@ -148,6 +148,10 @@ static void generate_function(symbol_t* function)
|
||||
// TODO (Task 4): the function body can be sent to generate_statement()
|
||||
|
||||
// TODO (Task 3.2): Emit the epilogue, including a label and a default return value (0)
|
||||
LABEL(".%s.epilogue", function->name);
|
||||
MOVQ(RBP, RSP);
|
||||
POPQ(RBP);
|
||||
RET;
|
||||
}
|
||||
|
||||
// Generates code for a function call, which can either be a statement or an expression
|
||||
|
||||
Reference in New Issue
Block a user