From 892a40aa1a122589a6d6a5048846008f1c5c1d11 Mon Sep 17 00:00:00 2001 From: Jeremiah Orians Date: Mon, 22 Nov 2021 06:07:44 -0500 Subject: [PATCH] Update M2libc and clear out some unneeded globals --- M2libc | 2 +- cc.h | 20 ++------------------ cc_env.c | 9 +-------- cc_globals.c | 8 -------- cc_globals.h | 10 ---------- 5 files changed, 4 insertions(+), 45 deletions(-) diff --git a/M2libc b/M2libc index 818fcfb..daec5ae 160000 --- a/M2libc +++ b/M2libc @@ -1 +1 @@ -Subproject commit 818fcfb333d73fbe0293b97b769718f0945e22dc +Subproject commit daec5ae864c80535dac5d53f83c8718e677b9e2d diff --git a/cc.h b/cc.h index b448e07..e60c94f 100644 --- a/cc.h +++ b/cc.h @@ -20,25 +20,9 @@ #include #include -// CONSTANT FALSE 0 -#define FALSE 0 -// CONSTANT TRUE 1 -#define TRUE 1 -// CONSTANT KNIGHT_NATIVE 0 -#define KNIGHT_NATIVE 0 -// CONSTANT KNIGHT_POSIX 1 -#define KNIGHT_POSIX 1 -// CONSTANT X86 2 -#define X86 2 -// CONSTANT AMD64 3 -#define AMD64 3 -// CONSTANT ARMV7L 4 -#define ARMV7L 4 -// CONSTANT AARCH64 5 -#define AARCH64 5 -// CONSTANT RISCV64 6 -#define RISCV64 6 +#define FALSE 0 +#define TRUE 1 int in_set(int c, char* s); diff --git a/cc_env.c b/cc_env.c index e9b5b62..f17d29f 100644 --- a/cc_env.c +++ b/cc_env.c @@ -41,31 +41,24 @@ void setup_env() if(NULL != hold) ARCH = hold; /* Set desired architecture */ - if(match("knight-native", ARCH)) Architecture = KNIGHT_NATIVE; - else if(match("knight-posix", ARCH)) Architecture = KNIGHT_POSIX; - else if(match("x86", ARCH)) + if(match("x86", ARCH)) { - Architecture = X86; init_macro_env("__i386__", "1", "--architecture", 0); } else if(match("amd64", ARCH)) { - Architecture = AMD64; init_macro_env("__x86_64__", "1", "--architecture", 0); } else if(match("armv7l", ARCH)) { - Architecture = ARMV7L; init_macro_env("__arm__", "1", "--architecture", 0); } else if(match("aarch64", ARCH)) { - Architecture = AARCH64; init_macro_env("__aarch64__", "1", "--architecture", 0); } else if(match("riscv64", ARCH)) { - Architecture = RISCV64; init_macro_env("__riscv", "1", "--architecture", 0); init_macro_env("__riscv_xlen", "64", "--architecture", 1); } diff --git a/cc_globals.c b/cc_globals.c index d9f70c2..9ea68b3 100644 --- a/cc_globals.c +++ b/cc_globals.c @@ -32,15 +32,7 @@ struct token_list* globals_list; char* hold_string; int string_index; -/* Our Target Architecture */ -int Architecture; -int register_size; - int MAX_STRING; -struct type* integer; - -/* enable bootstrap-mode */ -int BOOTSTRAP_MODE; /* enable preprocessor-only mode */ int PREPROCESSOR_MODE; diff --git a/cc_globals.h b/cc_globals.h index 404c8f7..2498a01 100644 --- a/cc_globals.h +++ b/cc_globals.h @@ -32,19 +32,9 @@ extern struct token_list* globals_list; extern char* hold_string; extern int string_index; -/* Our Target Architecture */ -extern int Architecture; -extern int register_size; - /* Allow us to have a single settable max string */ extern int MAX_STRING; -/* make default type integer */ -extern struct type* integer; - -/* enable bootstrap-mode */ -extern int BOOTSTRAP_MODE; - /* enable preprocessor-only mode */ extern int PREPROCESSOR_MODE;