summary refs log tree commit diff
path: root/amd64/emit.c
diff options
context:
space:
mode:
authorQuentin Carbonneaux <quentin@c9x.me>2022-10-03 11:08:05 +0200
committerQuentin Carbonneaux <quentin@c9x.me>2022-10-08 21:48:47 +0200
commitb03a8970d7b73959397f0ca5c8f2a532c1905e5d (patch)
tree028eb6726e95352c54b1911abbe609ef3a26bc6f /amd64/emit.c
parenta7e1602252be24f51afa3dc66e3adc2b88d1e0c1 (diff)
downloadroux-b03a8970d7b73959397f0ca5c8f2a532c1905e5d.tar.gz
mark apple targets with a boolean
It is more natural to branch on a
flag than have different function
pointers for high-level passes.
Diffstat (limited to 'amd64/emit.c')
-rw-r--r--amd64/emit.c19
1 files changed, 4 insertions, 15 deletions
diff --git a/amd64/emit.c b/amd64/emit.c
index 064ee60..84714e8 100644
--- a/amd64/emit.c
+++ b/amd64/emit.c
@@ -538,8 +538,8 @@ framesz(Fn *fn)
 	return 4*f + 8*o + 176*fn->vararg;
 }
 
-static void
-emitfn(Fn *fn, FILE *f)
+void
+amd64_emitfn(Fn *fn, FILE *f)
 {
 	static char *ctoa[] = {
 	#define X(c, s) [c] = s,
@@ -620,17 +620,6 @@ emitfn(Fn *fn, FILE *f)
 		}
 	}
 	id0 += fn->nblk;
-}
-
-void
-amd64_sysv_emitfn(Fn *fn, FILE *f)
-{
-	emitfn(fn, f);
-	elf_emitfnfin(fn->name, f);
-}
-
-void
-amd64_apple_emitfn(Fn *fn, FILE *f)
-{
-	emitfn(fn, f);
+	if (!T.apple)
+		elf_emitfnfin(fn->name, f);
 }