hyc

Hydrogen Compiler written in C
git clone git://git.kocotian.pl/hyc.git
Log | Files | Refs | README | LICENSE

commit 1c25298cf746efb9abe04b889c05c3d1aceb0806
parent e6020581d94c01ee5fff61df8428237cda8764e7
Author: kocotian <kocotian@kocotian.pl>
Date:   Fri, 30 Jul 2021 11:46:01 +0000

Stack frame management on beginning and end of function body

Diffstat:
Mtarget/x86_64-linux.c | 3+++
1 file changed, 3 insertions(+), 0 deletions(-)

diff --git a/target/x86_64-linux.c b/target/x86_64-linux.c @@ -293,7 +293,10 @@ compileGlobalFunction(Compiler *compiler, ASTGlobalFunction func) pushVector(lastArray(globalLiteralIdentifierTree).identifiers, newLiteralIdentifier_p(LIFunction, &(func.name))); asmTextAppend(compiler, "%s:", func.name.value); + asmTextAppend(compiler, "\tpush rbp"); + asmTextAppend(compiler, "\tmov rbp, rsp"); compileStatement(compiler, func.body); + asmTextAppend(compiler, "\tleave"); asmTextAppend(compiler, "\tret"); }