scc

simple c99 compiler
git clone git://git.simple-cc.org/scc
Log | Files | Refs | Submodules | README | LICENSE

commit 6bcfd004fd5073b54fbf7447f5df2fe00eeeea85
parent ea94f2eb1475cf3f96b3d9d274e2e23f05924142
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date:   Fri,  4 Nov 2022 11:09:27 +0100

cc1: Remove one and zero arch fields

All the archs declared them in the same way, so there isn't
a reason to keep them in the arch.

Diffstat:
Msrc/cmd/cc/cc1/amd64-sysv.c | 6------
Msrc/cmd/cc/cc1/arch.c | 6++++--
Msrc/cmd/cc/cc1/arm64-sysv.c | 8--------
Msrc/cmd/cc/cc1/cc1.h | 3---
Msrc/cmd/cc/cc1/i386-sysv.c | 6------
Msrc/cmd/cc/cc1/z80-scc.c | 6------
6 files changed, 4 insertions(+), 31 deletions(-)

diff --git a/src/cmd/cc/cc1/amd64-sysv.c b/src/cmd/cc/cc1/amd64-sysv.c @@ -188,12 +188,6 @@ amd64_sysv(void) .size = 24, .align = 8, }, - .zero = { - .u.i = 0, - }, - .one = { - .u.i = 1, - }, }; sizettype = &arch.sizettype; diff --git a/src/cmd/cc/cc1/arch.c b/src/cmd/cc/cc1/arch.c @@ -19,6 +19,8 @@ Symbol *one, *zero; char *architecture = "amd64-sysv"; static Arch *arch; +static Symbol zerodata = {.u.i = 0}; +static Symbol onedata = {.u.i = 1}; static Arch * getarch(void) @@ -78,8 +80,8 @@ iarch(void) ellipsistype = &arch->ellipsistype; va_list_type = &arch->va_list_type; va_type = &arch->va_type; - zero = &arch->zero; - one = &arch->one; + zero = &zerodata; + one = &onedata; zero->type = inttype; one->type = inttype; diff --git a/src/cmd/cc/cc1/arm64-sysv.c b/src/cmd/cc/cc1/arm64-sysv.c @@ -188,20 +188,12 @@ arm64_sysv(void) .size = 24, .align = 8, }, - .zero = { - .u.i = 0, - }, - .one = { - .u.i = 1, - }, }; sizettype = &arch.sizettype; arch.va_list_type = *mktype(&arch.va_type, ARY, 1, NULL); arch.pvoidtype.type = &arch.voidtype; arch.valid_va_list = local_valid_va_list; - arch.zero.type = inttype; - arch.one.type = inttype; return &arch; } diff --git a/src/cmd/cc/cc1/cc1.h b/src/cmd/cc/cc1/cc1.h @@ -366,9 +366,6 @@ struct swtch { }; struct arch { - Symbol zero; - Symbol one; - Type voidtype; Type pvoidtype; Type booltype; diff --git a/src/cmd/cc/cc1/i386-sysv.c b/src/cmd/cc/cc1/i386-sysv.c @@ -181,12 +181,6 @@ i386_sysv(void) .letter = L_ELLIPSIS, .prop = TDEFINED, }, - .zero = { - .u.i = 0, - }, - .one = { - .u.i = 1, - }, .va_type = { .op = PTR, .letter = L_POINTER, diff --git a/src/cmd/cc/cc1/z80-scc.c b/src/cmd/cc/cc1/z80-scc.c @@ -181,12 +181,6 @@ z80_scc(void) .letter = L_ELLIPSIS, .prop = TDEFINED, }, - .zero = { - .u.i = 0, - }, - .one = { - .u.i = 1, - }, .va_type = { .op = PTR, .letter = L_POINTER,