[llvm-branch-commits] [llvm-gcc-branch] r101556 - in /llvm-gcc-4.2/branches/Apple/Morbo/gcc: config/darwin.c config/darwin.h objc/objc-act.c testsuite/objc.dg/weak_import_class.m

Stuart Hastings stuart at apple.com
Fri Apr 16 15:34:26 PDT 2010


Author: stuart
Date: Fri Apr 16 17:34:26 2010
New Revision: 101556

URL: http://llvm.org/viewvc/llvm-project?rev=101556&view=rev
Log:
Revert 101522; doesn't work in LLVM-GCC.  Radar 7874731.

Removed:
    llvm-gcc-4.2/branches/Apple/Morbo/gcc/testsuite/objc.dg/weak_import_class.m
Modified:
    llvm-gcc-4.2/branches/Apple/Morbo/gcc/config/darwin.c
    llvm-gcc-4.2/branches/Apple/Morbo/gcc/config/darwin.h
    llvm-gcc-4.2/branches/Apple/Morbo/gcc/objc/objc-act.c

Modified: llvm-gcc-4.2/branches/Apple/Morbo/gcc/config/darwin.c
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/branches/Apple/Morbo/gcc/config/darwin.c?rev=101556&r1=101555&r2=101556&view=diff
==============================================================================
--- llvm-gcc-4.2/branches/Apple/Morbo/gcc/config/darwin.c (original)
+++ llvm-gcc-4.2/branches/Apple/Morbo/gcc/config/darwin.c Fri Apr 16 17:34:26 2010
@@ -2839,20 +2839,5 @@
   
   return 1;
 }
-
 /* LLVM LOCAL end radar 6230142 */
-/* APPLE LOCAL begin radar 7865106 */
-int objc_weak_import_class(tree decl)
-{
-  if (flag_objc_abi == 2 &&
-      TREE_CODE(decl) == VAR_DECL && 
-      lookup_attribute ("weak_import", DECL_ATTRIBUTES (decl)))
-    {
-      const char* name = IDENTIFIER_POINTER (DECL_NAME(decl)); 
-      return (!strncmp (name, "OBJC_CLASS_$_", 13)
-              || !strncmp (name, "OBJC_METACLASS_$_", 17));
-    }
-  return 0;
-}
-/* APPLE LOCAL end radar 7865106 */
 #include "gt-darwin.h"

Modified: llvm-gcc-4.2/branches/Apple/Morbo/gcc/config/darwin.h
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/branches/Apple/Morbo/gcc/config/darwin.h?rev=101556&r1=101555&r2=101556&view=diff
==============================================================================
--- llvm-gcc-4.2/branches/Apple/Morbo/gcc/config/darwin.h (original)
+++ llvm-gcc-4.2/branches/Apple/Morbo/gcc/config/darwin.h Fri Apr 16 17:34:26 2010
@@ -43,8 +43,6 @@
 /* APPLE LOCAL begin dynamic-no-pic */
 extern int machopic_symbol_defined_p (rtx);
 /* APPLE LOCAL end dynamic-no-pic */
-/* APPLE LOCAL radar 7865106 */
-extern int objc_weak_import_class(tree);
 
 /* APPLE LOCAL begin axe stubs 5571540 */
 extern int darwin_stubs;
@@ -663,8 +661,7 @@
  									\
     if (! DECL_EXTERNAL (DECL) && TREE_PUBLIC (DECL))			\
       targetm.asm_out.globalize_label (FILE, NAME);			\
-    /* APPLE LOCAL radar 7865106 */					\
-    if (DECL_EXTERNAL (DECL) || objc_weak_import_class(DECL))		\
+    if (DECL_EXTERNAL (DECL))						\
       fputs ("\t.weak_reference ", FILE);				\
     else if (! lookup_attribute ("weak", DECL_ATTRIBUTES (DECL))	\
 	&& lookup_attribute ("weak_import", DECL_ATTRIBUTES (DECL)))	\

Modified: llvm-gcc-4.2/branches/Apple/Morbo/gcc/objc/objc-act.c
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/branches/Apple/Morbo/gcc/objc/objc-act.c?rev=101556&r1=101555&r2=101556&view=diff
==============================================================================
--- llvm-gcc-4.2/branches/Apple/Morbo/gcc/objc/objc-act.c (original)
+++ llvm-gcc-4.2/branches/Apple/Morbo/gcc/objc/objc-act.c Fri Apr 16 17:34:26 2010
@@ -11001,28 +11001,11 @@
   return NULL;
 }
 
-/* APPLE LOCAL begin radar 7865106 */
-static bool objc_class_weak_import(tree class)
-{
-  tree chain;
-  if (class && TREE_CODE (class) == CLASS_IMPLEMENTATION_TYPE)
-    return false;
-  gcc_assert (class && TREE_CODE (class) == CLASS_INTERFACE_TYPE);
-  for (chain = CLASS_ATTRIBUTES (class); chain; chain = TREE_CHAIN (chain))
-    if (is_attribute_p ("weak_import", TREE_PURPOSE (chain)))
-      return true;
-  return false;
-}
-/* APPLE LOCAL end radar 7865106 */
-
 /* Create a symbol whose visibility attribute matches that of 
    the given class. */
 
 static tree
-/* APPLE LOCAL begin radar 7865106 */
-objc_create_global_decl_for_class (tree type, const char *name, tree class,
-				   int classSymbol)
-/* APPLE LOCAL end radar 7865106 */
+objc_create_global_decl_for_class (tree type, const char *name, tree class)
 {
   tree decl = create_global_decl (type, name);
   const char *visibility = objc_class_visibility (class);
@@ -11038,12 +11021,6 @@
       DECL_VISIBILITY_SPECIFIED (decl) = 1;
     }
 
-  /* APPLE LOCAL begin radar 7865106 */
-  if (classSymbol && objc_class_weak_import(class)) {
-    tree attribute = build_tree_list (get_identifier ("weak_import"), NULL_TREE);
-    decl_attributes (&decl, attribute, 0);
-  }
-  /* APPLE LOCAL end radar 7865106 */
   return decl;
 }
 /* APPLE LOCAL end radar 4705298 , 4843145*/
@@ -11096,8 +11073,7 @@
   /* APPLE LOCAL begin radar 4705298, 4843145 */
   decl = global_var ? 
          objc_create_global_decl_for_class (
-           /* APPLE LOCAL radar 7865106 */
-	   TREE_TYPE (size_zero_node), buf, implementation_template, 0) : 
+	   TREE_TYPE (size_zero_node), buf, implementation_template) : 
 	 create_hidden_decl (TREE_TYPE (size_zero_node), buf);
   /* APPLE LOCAL end radar 4705298 , 4843145*/
   /* APPLE LOCAL end radar 4441049 */
@@ -12777,13 +12753,11 @@
   class_decl = objc_create_global_decl_for_class (
 		 objc_v2_class_template, 
 		 IDENTIFIER_POINTER (DECL_NAME (UOBJC_V2_CLASS_decl)), 
-                 /* APPLE LOCAL radar 7865106 */
-		 implementation_template, 1);
+		 implementation_template);
   metaclass_decl = objc_create_global_decl_for_class (
 		     objc_v2_class_template, 
 		     IDENTIFIER_POINTER (DECL_NAME (UOBJC_V2_METACLASS_decl)), 
-                     /* APPLE LOCAL radar 7865106 */
-		     implementation_template, 1);
+		     implementation_template);
 
   if (DECL_VISIBILITY (class_decl) == VISIBILITY_HIDDEN)
     flags |= OBJC2_CLS_HIDDEN; 
@@ -15201,10 +15175,6 @@
       else if (is_attribute_p ("objc_exception", TREE_PURPOSE (chain)))
         ;
       /* APPLE LOCAL end radar 5008110 */
-      /* APPLE LOCAL begin radar 7865106 */
-      else if (is_attribute_p ("weak_import", TREE_PURPOSE (chain)))
-        ;
-      /* APPLE LOCAL end radar 7865106 */
       else if (!use)
 	warning (0, "attribute %s is unknown - ignored",
 		  IDENTIFIER_POINTER (TREE_PURPOSE (chain)));

Removed: llvm-gcc-4.2/branches/Apple/Morbo/gcc/testsuite/objc.dg/weak_import_class.m
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/branches/Apple/Morbo/gcc/testsuite/objc.dg/weak_import_class.m?rev=101555&view=auto
==============================================================================
--- llvm-gcc-4.2/branches/Apple/Morbo/gcc/testsuite/objc.dg/weak_import_class.m (original)
+++ llvm-gcc-4.2/branches/Apple/Morbo/gcc/testsuite/objc.dg/weak_import_class.m (removed)
@@ -1,27 +0,0 @@
-/* APPLE LOCAL file radar 7865106 */
-/* { dg-do compile { target *-*-darwin* } } */
-/* { dg-options "-mmacosx-version-min=10.6 -fobjc-abi-version=2" { target i?86*-*-darwin* } } */
-
-__attribute__((weak_import)) @interface WeakRootClass @end
- at implementation WeakRootClass @end
-
-
-__attribute__((weak_import)) @interface WeakClass : WeakRootClass @end
- at implementation WeakClass @end
-
- at interface MySubclass : WeakClass @end
- at implementation MySubclass @end
-
-__attribute__((weak_import)) @interface CategoryNotWeak @end
- at implementation CategoryNotWeak(MyCategory) @end
- at implementation CategoryNotWeak(YourCategory) @end
-
- at interface Super : WeakRootClass @end
- at implementation Super @end
-
- at interface Sub : Super @end
- at implementation Sub @end
-/* { dg-final { scan-assembler ".weak_reference _OBJC_METACLASS_\\\$_WeakClass" } } */
-/* { dg-final { scan-assembler ".weak_reference _OBJC_CLASS_\\\$_WeakClass" } } */
-/* { dg-final { scan-assembler ".weak_reference _OBJC_METACLASS_\\\$_WeakRootClass" } } */
-/* { dg-final { scan-assembler ".weak_reference _OBJC_CLASS_\\\$_WeakRootClass" } } */





More information about the llvm-branch-commits mailing list