scc

simple C compiler
git clone git://git.2f30.org/scc
Log | Files | Refs | README | LICENSE

commit 7970e948796bc1670bba5c5cad6130d1ddd2d059
parent 9536419154ea4a8f648c59298e99ad29dbae2a6b
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date:   Tue, 29 Nov 2016 12:38:35 +0100

[cc1] Remove arch.h

After removing this file the common objects of cc1 will compile
to the same content indepently of the architecture, so we can
avoid the clean that the global Makefile is doing.

Diffstat:
Mcc1/Makefile | 2+-
Mcc1/arch/amd64-sysv/arch.c | 1-
Dcc1/arch/amd64-sysv/arch.h | 3---
Mcc1/arch/i386-sysv/arch.c | 2--
Dcc1/arch/i386-sysv/arch.h | 3---
Mcc1/arch/qbe/arch.c | 1-
Dcc1/arch/qbe/arch.h | 3---
Mcc1/arch/z80/arch.c | 1-
Dcc1/arch/z80/arch.h | 3---
Mcc1/code.c | 1-
Mcc1/cpp.c | 1-
Mcc1/decl.c | 1-
Mcc1/error.c | 1-
Mcc1/expr.c | 1-
Mcc1/fold.c | 1-
Mcc1/init.c | 1-
Mcc1/lex.c | 1-
Mcc1/main.c | 1-
Mcc1/stmt.c | 1-
Mcc1/symbol.c | 1-
Mcc1/types.c | 14++++++--------
21 files changed, 7 insertions(+), 37 deletions(-)

diff --git a/cc1/Makefile b/cc1/Makefile @@ -13,7 +13,7 @@ all: cc1 cpp.o: stallman.msg -$(OBJS): cc1.h ../inc/cc.h ../inc/sizes.h arch/$(ARCH)/arch.h +$(OBJS): cc1.h ../inc/cc.h ../inc/sizes.h ../lib/libcc.a: cd ../lib && $(MAKE) -e diff --git a/cc1/arch/amd64-sysv/arch.c b/cc1/arch/amd64-sysv/arch.c @@ -1,7 +1,6 @@ /* See LICENSE file for copyright and license details. */ #include <stdio.h> -#include "arch.h" #include "../../../inc/cc.h" #include "../../cc1.h" diff --git a/cc1/arch/amd64-sysv/arch.h b/cc1/arch/amd64-sysv/arch.h @@ -1,3 +0,0 @@ -/* See LICENSE file for copyright and license details. */ - -#define L_ENUM L_INT32 diff --git a/cc1/arch/i386-sysv/arch.c b/cc1/arch/i386-sysv/arch.c @@ -1,7 +1,5 @@ /* See LICENSE file for copyright and license details. */ #include <stdio.h> - -#include "arch.h" #include "../../../inc/cc.h" #include "../../cc1.h" diff --git a/cc1/arch/i386-sysv/arch.h b/cc1/arch/i386-sysv/arch.h @@ -1,3 +0,0 @@ -/* See LICENSE file for copyright and license details. */ - -#define L_ENUM L_INT32 diff --git a/cc1/arch/qbe/arch.c b/cc1/arch/qbe/arch.c @@ -1,7 +1,6 @@ /* See LICENSE file for copyright and license details. */ #include <stdio.h> -#include "arch.h" #include "../../../inc/cc.h" #include "../../cc1.h" diff --git a/cc1/arch/qbe/arch.h b/cc1/arch/qbe/arch.h @@ -1,3 +0,0 @@ -/* See LICENSE file for copyright and license details. */ - -#define L_ENUM L_INT32 diff --git a/cc1/arch/z80/arch.c b/cc1/arch/z80/arch.c @@ -1,7 +1,6 @@ /* See LICENSE file for copyright and license details. */ #include <stdio.h> -#include "arch.h" #include "../../../inc/cc.h" #include "../../cc1.h" diff --git a/cc1/arch/z80/arch.h b/cc1/arch/z80/arch.h @@ -1,3 +0,0 @@ -/* See LICENSE file for copyright and license details. */ - -#define L_ENUM L_INT16 diff --git a/cc1/code.c b/cc1/code.c @@ -5,7 +5,6 @@ #include <stdarg.h> #include "../inc/cc.h" -#include "arch.h" #include "cc1.h" static void emitbin(unsigned, void *), diff --git a/cc1/cpp.c b/cc1/cpp.c @@ -8,7 +8,6 @@ #include "../inc/sizes.h" #include "../inc/cc.h" -#include "arch.h" #include "cc1.h" static char *argp, *macroname; diff --git a/cc1/decl.c b/cc1/decl.c @@ -7,7 +7,6 @@ #include "../inc/sizes.h" #include "../inc/cc.h" -#include "arch.h" #include "cc1.h" #define NOSCLASS 0 diff --git a/cc1/error.c b/cc1/error.c @@ -4,7 +4,6 @@ #include <stdlib.h> #include "../inc/cc.h" -#include "arch.h" #include "cc1.h" #define MAXERRNUM 10 diff --git a/cc1/expr.c b/cc1/expr.c @@ -6,7 +6,6 @@ #include "../inc/cc.h" #include "../inc/sizes.h" -#include "arch.h" #include "cc1.h" #define XCHG(lp, rp, np) (np = lp, lp = rp, rp = np) diff --git a/cc1/fold.c b/cc1/fold.c @@ -3,7 +3,6 @@ #include <stdlib.h> #include "../inc/cc.h" -#include "arch.h" #include "cc1.h" diff --git a/cc1/init.c b/cc1/init.c @@ -6,7 +6,6 @@ #include "../inc/cc.h" #include "../inc/sizes.h" -#include "arch.h" #include "cc1.h" diff --git a/cc1/lex.c b/cc1/lex.c @@ -8,7 +8,6 @@ #include "../inc/sizes.h" #include "../inc/cc.h" -#include "arch.h" #include "cc1.h" unsigned yytoken; diff --git a/cc1/main.c b/cc1/main.c @@ -7,7 +7,6 @@ #include "../inc/arg.h" #include "../inc/cc.h" -#include "arch.h" #include "cc1.h" char *argv0; diff --git a/cc1/stmt.c b/cc1/stmt.c @@ -5,7 +5,6 @@ #include "../inc/cc.h" #include "../inc/sizes.h" -#include "arch.h" #include "cc1.h" Symbol *curfun; diff --git a/cc1/symbol.c b/cc1/symbol.c @@ -6,7 +6,6 @@ #include "../inc/cc.h" #include "../inc/sizes.h" -#include "arch.h" #include "cc1.h" #define NR_SYM_HASH 64 diff --git a/cc1/types.c b/cc1/types.c @@ -6,9 +6,7 @@ #include "../inc/sizes.h" #include "../inc/cc.h" -#include "arch.h" #include "cc1.h" -#include "arch.h" #define NR_TYPE_HASH 16 @@ -257,12 +255,12 @@ mktype(Type *tp, int op, TINT nelem, Type *pars[]) op = FTN; } switch (op) { - case PTR: c = L_POINTER; break; - case ARY: c = L_ARRAY; break; - case FTN: c = L_FUNCTION; break; - case ENUM: c = L_ENUM; break; - case STRUCT: c = L_STRUCT; break; - case UNION: c = L_UNION; break; + case PTR: c = L_POINTER; break; + case ARY: c = L_ARRAY; break; + case FTN: c = L_FUNCTION; break; + case ENUM: c = inttype->letter; break; + case STRUCT: c = L_STRUCT; break; + case UNION: c = L_UNION; break; } type.type = tp;