OSDN Git Service

* objc-act.c (finish_var_decl): Set the generated symbols as "used".
authormrs <mrs@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 18 Feb 2010 22:00:21 +0000 (22:00 +0000)
committermrs <mrs@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 18 Feb 2010 22:00:21 +0000 (22:00 +0000)
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@156877 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/objc/ChangeLog
gcc/objc/objc-act.c

index 7f43dc0..a1673cd 100644 (file)
@@ -1,3 +1,8 @@
+2010-02-18  Iain Sandoe <iain.sandoe@sandoe-acoustics.co.uk>
+           Mike Stump  <mikestump@comcast.net>
+
+       * objc-act.c (finish_var_decl): Set the generated symbols as "used".
+
 2009-12-17  Shujing Zhao  <pearly.zhao@oracle.com>
 
        * objc-act.c (objc_substitute_decl, build_ivar_reference,
index 2680fd8..fae535c 100644 (file)
@@ -1524,6 +1524,14 @@ finish_var_decl (tree var, tree initializer)
   mark_decl_referenced (var);
   /* Mark the decl to avoid "defined but not used" warning.  */
   TREE_USED (var) = 1;
+  /* We reserve the right for the runtime to use/modify these variables
+     in ways that are opaque to us.  */
+  DECL_PRESERVE_P (var) = 1;
+  /* ipa*.c/cgraphunit.c use lookup attribute rather than testing
+     DECL_PRESERVE_P.  Once they switch to testing DECL_PRESERVE_P,
+     this can be removed. */
+  DECL_ATTRIBUTES (var) = tree_cons (get_identifier ("used"), NULL, 
+                                    DECL_ATTRIBUTES (var)) ;
 }
 
 /* Find the decl for the constant string class reference.  This is only