cc1obj: Make Objective C the default language.

Neil Booth neilb@earthling.net
Wed Nov 29 10:17:00 GMT 2000


Ovidiu,

This bootstraps without regressions.  It seems that objc-act.c wants
to behave as both a C compiler and Objective C compiler - is this
right?  There are a lot of conditionals based on "doing_objc_thang".
With this patch, cc1obj only does Objective C.

So, two questions:

1) OK to commit?

2) Would you accept a follow-up patch to remove the (redundant)
Objective C "thang" tests for code in /objc?

Neil.

	* c-decl.c (c_decode_option): Don't handle -lang-objc.
	* objc/lang-options.h: Remove -lang-objc.
	* objc/lang-specs.h: Don't pass -lang-objc to cc1obj.
	* objc/objc-act.c (lang_init_options): Set c_language.

Index: c-decl.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/c-decl.c,v
retrieving revision 1.186
diff -u -p -r1.186 c-decl.c
--- c-decl.c	2000/11/28 23:07:28	1.186
+++ c-decl.c	2000/11/29 18:08:16
@@ -507,9 +507,7 @@ c_decode_option (argc, argv)
 
   strings_processed = cpp_handle_option (parse_in, argc, argv);
 
-  if (!strcmp (p, "-lang-objc"))
-    c_language = clk_objective_c;
-  else if (!strcmp (p, "-ftraditional") || !strcmp (p, "-traditional"))
+  if (!strcmp (p, "-ftraditional") || !strcmp (p, "-traditional"))
     {
       flag_traditional = 1;
       flag_writable_strings = 1;
Index: objc/lang-options.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/objc/lang-options.h,v
retrieving revision 1.1
diff -u -p -r1.1 lang-options.h
--- lang-options.h	2000/08/06 07:51:15	1.1
+++ lang-options.h	2000/11/29 18:08:28
@@ -27,7 +27,6 @@ The Free Software Foundation is independ
 
 DEFINE_LANG_NAME ("Objective C")
   
-  { "-lang-objc", "" },
   { "-gen-decls", "Dump decls to a .decl file" },
   { "-fgnu-runtime", "Generate code for GNU runtime environment" },
   { "-fno-gnu-runtime", "" },
Index: objc/lang-specs.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/objc/lang-specs.h,v
retrieving revision 1.18
diff -u -p -r1.18 lang-specs.h
--- lang-specs.h	2000/11/25 19:28:44	1.18
+++ lang-specs.h	2000/11/29 18:08:28
@@ -29,15 +29,15 @@ Boston, MA 02111-1307, USA.  */
       %{!E:%{!M:%{!MM:\
 	%{save-temps:%(trad_capable_cpp) -lang-objc %{ansi:-std=c89}\
 	  %(cpp_options) %b.mi \n\
-	    cc1obj -fpreprocessed %b.mi -lang-objc %(cc1_options) %{gen-decls}}\
+	    cc1obj -fpreprocessed %b.mi %(cc1_options) %{gen-decls}}\
 	%{!save-temps:\
 	  %{traditional|ftraditional|traditional-cpp:\
 	    tradcpp0 -lang-objc %{ansi:-std=c89} %(cpp_options) %{!pipe:%g.mi} |\n\
-	    cc1obj -fpreprocessed %{!pipe:%g.mi} -lang-objc %(cc1_options) %{gen-decls}}\
+	    cc1obj -fpreprocessed %{!pipe:%g.mi} %(cc1_options) %{gen-decls}}\
 	  %{!traditional:%{!ftraditional:%{!traditional-cpp:\
-	    cc1obj -lang-objc %{ansi:-std=c89} %(cpp_options) %(cc1_options) %{gen-decls}}}}}\
+	    cc1obj %{ansi:-std=c89} %(cpp_options) %(cc1_options) %{gen-decls}}}}}\
         %{!fsyntax-only:%(invoke_as)}}}}"},
   {".mi", "@objc-cpp-output"},
   {"@objc-cpp-output",
-     "%{!M:%{!MM:%{!E:cc1obj -lang-objc %i %(cc1_options) %{gen-decls}\
+     "%{!M:%{!MM:%{!E:cc1obj -fpreprocessed %i %(cc1_options) %{gen-decls}\
 			     %{!fsyntax-only:%(invoke_as)}}}}"},
Index: objc/objc-act.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/objc/objc-act.c,v
retrieving revision 1.55
diff -u -p -r1.55 objc-act.c
--- objc-act.c	2000/11/28 21:13:35	1.55
+++ objc-act.c	2000/11/29 18:08:54
@@ -694,7 +694,8 @@ generate_struct_by_value_array ()
 void
 lang_init_options ()
 {
-  parse_in = cpp_create_reader (CLK_GNUC89);
+  parse_in = cpp_create_reader (CLK_OBJC);
+  c_language = clk_objective_c;
 }
 
 void


More information about the Gcc-patches mailing list