Minor PCH objc, etc., fixes

Geoffrey Keating gkeating@apple.com
Fri Mar 7 23:09:00 GMT 2003


This implements Devang and Neil's suggestions.

Bootstrapped & tested on powerpc-darwin.

-- 
- Geoffrey Keating <geoffk@apple.com>

===File ~/patches/gcc-pchobjcmisc.patch=====================
Index: ChangeLog
===================================================================
RCS file: /cvs/gcc/gcc/gcc/ChangeLog,v
retrieving revision 1.16973
diff -u -p -u -p -r1.16973 ChangeLog
--- ChangeLog	7 Mar 2003 10:07:07 -0000	1.16973
+++ ChangeLog	7 Mar 2003 23:07:21 -0000
@@ -1,3 +1,11 @@
+2003-03-07  Geoffrey Keating  <geoffk@apple.com>
+
+	* objc/lang-specs.h (objective-c-header): Use .gch not .pch;
+	support -no-integrated-cpp.
+
+	* c-pch.c (get_ident): Use c_language_kind and flag_objc rather
+	than langhooks.name.
+
 2003-03-07  Richard Earnshaw  <rearnsha@arm.com>
 
 	* arm.md (addsf3, adddf3, subsf3, subdf3, mulsf3, muldf3, negsf2)
Index: c-pch.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/c-pch.c,v
retrieving revision 1.4
diff -u -p -u -p -r1.4 c-pch.c
--- c-pch.c	7 Mar 2003 01:20:51 -0000	1.4
+++ c-pch.c	7 Mar 2003 23:07:21 -0000
@@ -52,14 +52,10 @@ get_ident()
   static const char template[IDENT_LENGTH] = "gpch.010";
   
   memcpy (result, template, IDENT_LENGTH);
-  if (strcmp (lang_hooks.name, "GNU C") == 0)
-    result[4] = 'C';
-  else if (strcmp (lang_hooks.name, "GNU C++") == 0)
-    result[4] = '+';
-  else if (strcmp (lang_hooks.name, "GNU Objective-C") == 0)
-    result[4] = 'o';
-  else if (strcmp (lang_hooks.name, "GNU Objective-C++") == 0)
-    result[4] = 'O';
+  if (c_language == clk_c)
+    result[4] = flag_objc ? 'o' : 'C';
+  else if (c_language == clk_cplusplus)
+    result[4] = flag_objc ? 'O' : '+';
   else
     abort ();
   return result;
Index: objc/lang-specs.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/objc/lang-specs.h,v
retrieving revision 1.30
diff -u -p -u -p -r1.30 lang-specs.h
--- objc/lang-specs.h	7 Mar 2003 01:20:52 -0000	1.30
+++ objc/lang-specs.h	7 Mar 2003 23:07:21 -0000
@@ -44,11 +44,11 @@ Boston, MA 02111-1307, USA.  */
       %{!E:%{!M:%{!MM:\
 	%{traditional|ftraditional|traditional-cpp:\
 %eGNU Objective C no longer supports traditional compilation}\
-	%{save-temps:cc1obj -E %(cpp_options) %b.mi \n\
+	%{save-temps|no-integrated-cpp:cc1obj -E %(cpp_options) %b.mi \n\
 	    cc1obj -fpreprocessed %b.mi %(cc1_options) %{gen-decls}\
-                        -o %g.s %{!o*:--output-pch=%i.pch}\
+                        -o %g.s %{!o*:--output-pch=%i.gch}\
                         %W{o*:--output-pch=%*}%V}\
-	%{!save-temps:\
+	%{!save-temps:%{!no-integrated-cpp:\
 	    cc1obj %(cpp_unique_options) %(cc1_options) %{gen-decls}\
-                        -o %g.s %{!o*:--output-pch=%i.pch}\
-                        %W{o*:--output-pch=%*}%V}}}}", 0},
+                        -o %g.s %{!o*:--output-pch=%i.gch}\
+                        %W{o*:--output-pch=%*}%V}}}}}", 0},
============================================================



More information about the Gcc-patches mailing list