shithub: scc

Download patch

ref: 522661a7fb8fd6564b280de135ca77bc1ac8d53d
parent: 58748e88436a2aaf8915ed30184cb5f9378367a7
author: Roberto E. Vargas Caballero <[email protected]>
date: Tue Nov 29 07:38:35 EST 2016

[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.

--- a/cc1/Makefile
+++ b/cc1/Makefile
@@ -13,7 +13,7 @@
 
 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
--- 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"
 
--- a/cc1/arch/amd64-sysv/arch.h
+++ /dev/null
@@ -1,3 +1,0 @@
-/* See LICENSE file for copyright and license details. */
-
-#define L_ENUM      L_INT32
--- 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"
 
--- a/cc1/arch/i386-sysv/arch.h
+++ /dev/null
@@ -1,3 +1,0 @@
-/* See LICENSE file for copyright and license details. */
-
-#define L_ENUM      L_INT32
--- 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"
 
--- a/cc1/arch/qbe/arch.h
+++ /dev/null
@@ -1,3 +1,0 @@
-/* See LICENSE file for copyright and license details. */
-
-#define L_ENUM      L_INT32
--- 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"
 
--- a/cc1/arch/z80/arch.h
+++ /dev/null
@@ -1,3 +1,0 @@
-/* See LICENSE file for copyright and license details. */
-
-#define L_ENUM      L_INT16
--- 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 *),
--- 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;
--- 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
--- 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
--- 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)
--- 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"
 
 
--- 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"
 
 
--- 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;
--- 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;
--- 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;
--- 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
--- 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 @@
 		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;