aboutsummaryrefslogtreecommitdiff
path: root/src/generator.h
diff options
context:
space:
mode:
authorMustafa Quraish <[email protected]>2022-02-03 04:38:35 -0500
committerMustafa Quraish <[email protected]>2022-02-03 04:44:46 -0500
commit1a165b3fcdabf7462a8f86eab5a6274f92ce9653 (patch)
treeaaaebcbd82411f0e7379c6a719e035adcd29919d /src/generator.h
parentCheck for integer-like types in type-checking instead of exact ones (diff)
downloadcup-1a165b3fcdabf7462a8f86eab5a6274f92ce9653.tar.xz
cup-1a165b3fcdabf7462a8f86eab5a6274f92ce9653.zip
Add helper to create builtins for syscalls + implement `read()`
This was possible, but very tedious to do by hand before. Now we automate it based on the number of arguments. Note that currently we can't just add `syscall3()` etc as builtins because the actual numbers for the system calls vary from one system to another, and we want to maintain support for macOS and Linux (at least for now).
Diffstat (limited to 'src/generator.h')
-rw-r--r--src/generator.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/generator.h b/src/generator.h
index 602cf3a..a03b9d4 100644
--- a/src/generator.h
+++ b/src/generator.h
@@ -3,4 +3,5 @@
#include "ast.h"
#include <stdio.h>
+void generate_syscall(i64 syscall_no, FILE *out);
void generate_asm(Node *root, FILE *out); \ No newline at end of file