scc

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

commit 5d1e33b49e2a382979ecfca1266052e94cdf7ef0
parent 8bd13ada5c51bfa776c719ccc23b5a5b8f64f2e2
Author: Quentin Rameau <quinq@fifth.space>
Date:   Wed, 25 Jan 2017 12:09:40 +0100

[cc1] remove per-calling name different behaviour

We don't produce a cpp binary anymore, only cc1-ARCH, so we don't need
this anymore.

Diffstat:
Mcc1/main.c | 15+++------------
1 file changed, 3 insertions(+), 12 deletions(-)

diff --git a/cc1/main.c b/cc1/main.c @@ -15,7 +15,7 @@ char *argv0; int warnings; jmp_buf recover; -static char *name, *output; +static char *output; static struct items uflags; int onlycpp; @@ -44,11 +44,8 @@ defmacro(char *macro) static void usage(void) { - die(!strcmp(name, "cpp") ? - "usage: cpp [-wd] [-D def[=val]]... [-U def]... [-I dir]... " - "[input]" : - "usage: cc1 [-Ewd] [-D def[=val]]... [-U def]... [-I dir]... " - "[-o output] [input]"); + die("usage: cc1-" ARCH " [-Ewd] [-D def[=val]]... [-U def]... " + "[-I dir]... [-o output] [input]"); } int @@ -61,9 +58,6 @@ main(int argc, char *argv[]) ilex(); icpp(); - /* if run as cpp, only run the preprocessor */ - name = (cp = strrchr(*argv, '/')) ? cp + 1 : *argv; - ARGBEGIN { case 'D': defmacro(EARGF(usage())); @@ -96,9 +90,6 @@ main(int argc, char *argv[]) if (output && !freopen(output, "w", stdout)) die("error opening output: %s", strerror(errno)); - if (!strcmp(name, "cpp")) - onlycpp = 1; - for (i = 0; i < uflags.n; ++i) undefmacro(uflags.s[i]);