[llvm-branch-commits] [llvm-gcc-branch] r96793 - in /llvm-gcc-4.2/branches/Apple/Hermes/gcc: c-lang.c cp/cp-lang.c cp/parser.c

Stuart Hastings stuart at apple.com
Mon Feb 22 10:06:46 PST 2010


Author: stuart
Date: Mon Feb 22 12:06:46 2010
New Revision: 96793

URL: http://llvm.org/viewvc/llvm-project?rev=96793&view=rev
Log:
Relocate PCH-write call to catch deferred functions.  Radar 7657755.

Modified:
    llvm-gcc-4.2/branches/Apple/Hermes/gcc/c-lang.c
    llvm-gcc-4.2/branches/Apple/Hermes/gcc/cp/cp-lang.c
    llvm-gcc-4.2/branches/Apple/Hermes/gcc/cp/parser.c

Modified: llvm-gcc-4.2/branches/Apple/Hermes/gcc/c-lang.c
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/branches/Apple/Hermes/gcc/c-lang.c?rev=96793&r1=96792&r2=96793&view=diff
==============================================================================
--- llvm-gcc-4.2/branches/Apple/Hermes/gcc/c-lang.c (original)
+++ llvm-gcc-4.2/branches/Apple/Hermes/gcc/c-lang.c Mon Feb 22 12:06:46 2010
@@ -88,6 +88,11 @@
 void
 finish_file (void)
 {
+  /* APPLE LOCAL begin radar 4874613 */
+  /* Bad parse errors.  Just forget about it.  */
+  if (!errorcount && !sorrycount && pch_file)
+    c_common_write_pch ();
+  /* APPLE LOCAL end radar 4874613 */
 }
 
 #include "gtype-c.h"

Modified: llvm-gcc-4.2/branches/Apple/Hermes/gcc/cp/cp-lang.c
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/branches/Apple/Hermes/gcc/cp/cp-lang.c?rev=96793&r1=96792&r2=96793&view=diff
==============================================================================
--- llvm-gcc-4.2/branches/Apple/Hermes/gcc/cp/cp-lang.c (original)
+++ llvm-gcc-4.2/branches/Apple/Hermes/gcc/cp/cp-lang.c Mon Feb 22 12:06:46 2010
@@ -149,6 +149,12 @@
 finish_file (void)
 {
   cp_finish_file ();
+  /* APPLE LOCAL begin radar 4874613 */
+  /* Bad parse errors.  Just forget about it.  */
+  if (pch_file && lang_hooks.decls.global_bindings_p () &&
+      !current_class_type && !decl_namespace_list)
+    c_common_write_pch ();
+  /* APPLE LOCAL end radar 4874613 */
 }
 
 #include "gtype-cp.h"

Modified: llvm-gcc-4.2/branches/Apple/Hermes/gcc/cp/parser.c
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/branches/Apple/Hermes/gcc/cp/parser.c?rev=96793&r1=96792&r2=96793&view=diff
==============================================================================
--- llvm-gcc-4.2/branches/Apple/Hermes/gcc/cp/parser.c (original)
+++ llvm-gcc-4.2/branches/Apple/Hermes/gcc/cp/parser.c Mon Feb 22 12:06:46 2010
@@ -23492,13 +23492,6 @@
 				? dk_no_deferred : dk_no_check);
   error_occurred = cp_parser_translation_unit (the_parser);
   the_parser = NULL;
-  /* APPLE LOCAL begin radar 4874613 */
-  /* Bad parse errors.  Just forget about it.  */
-  if (! global_bindings_p () || current_class_type || decl_namespace_list)
-    return;
-  if (pch_file)
-    c_common_write_pch ();
-  /* APPLE LOCAL end radar 4874613 */
 }
 
 /* This variable must be provided by every front end.  */





More information about the llvm-branch-commits mailing list