shithub: scc

Download patch

ref: bac3b4bfa338ea25a630b7dd10b2cab2cc9633df
parent: c2d4cf249f3e60d34dc32d4664936883741d98ba
author: Quentin Rameau <[email protected]>
date: Wed Jan 25 07:09:40 EST 2017

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

--- a/cc1/main.c
+++ b/cc1/main.c
@@ -15,7 +15,7 @@
 int warnings;
 jmp_buf recover;
 
-static char *name, *output;
+static char *output;
 static struct items uflags;
 int onlycpp;
 
@@ -44,11 +44,8 @@
 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 @@
 	ilex();
 	icpp();
 
-	/* if run as cpp, only run the preprocessor */
-	name = (cp = strrchr(*argv, '/')) ? cp + 1 : *argv;
-
 	ARGBEGIN {
 	case 'D':
 		defmacro(EARGF(usage()));
@@ -95,9 +89,6 @@
 
 	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]);