aboutsummaryrefslogtreecommitdiff
path: root/compiler/codegen.cup
diff options
context:
space:
mode:
authorMustafa Quraish <[email protected]>2022-02-05 22:34:44 -0500
committerMustafa Quraish <[email protected]>2022-02-05 22:34:44 -0500
commit7b0bfa91b400e89f32f19ef2987200562bbe3f8f (patch)
treed44f6cb1525ebbe6cc0c958191dd4ab1d76eb4f6 /compiler/codegen.cup
parent[cup] Fix error in codegen for `if` (diff)
downloadcup-7b0bfa91b400e89f32f19ef2987200562bbe3f8f.tar.xz
cup-7b0bfa91b400e89f32f19ef2987200562bbe3f8f.zip
[cup] Add support for builtin functions, add `print()`
Diffstat (limited to 'compiler/codegen.cup')
-rw-r--r--compiler/codegen.cup3
1 files changed, 3 insertions, 0 deletions
diff --git a/compiler/codegen.cup b/compiler/codegen.cup
index d35f901..8c8ec95 100644
--- a/compiler/codegen.cup
+++ b/compiler/codegen.cup
@@ -1,3 +1,4 @@
+import "compiler/builtins.cup"
import "compiler/ast.cup"
import "std/file.cup"
@@ -381,4 +382,6 @@ fn generate_program(ast: Node*, file: File*) {
emit_asm(" call func_main\n");
emit_asm(" mov rdi, rax\n");
generate_syscall(SYS_exit);
+
+ generate_builtins();
} \ No newline at end of file