aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZiemowit Laski <zlaski@apple.com>2004-08-22 05:18:02 +0000
committerZiemowit Laski <zlaski@apple.com>2004-08-22 05:18:02 +0000
commitd2254d00ce97d6d91254d98c40fcd4444236e815 (patch)
tree34e1c3ebfd5467140032a2082349c31bacc0c93f
parent3c34e08cf992aca397d95986e9e879f82303b087 (diff)
[gcc/ChangeLog.objc-improvements]
2004-08-21 Ziemowit Laski <zlaski@apple.com> * c-decl.c (build_cdtor) Move calls to objc_static_init_needed_p() and objc_generate_static_init_call() ... (c_write_global_declarations): ... here. [gcc/testsuite/ChangeLog.objc-improvements] 2004-08-21 Ziemowit Laski <zlaski@apple.com> * objc/execute/IMP.m: Include <stdlib.h>. git-svn-id: https://gcc.gnu.org/svn/gcc/branches/objc-improvements-branch@86375 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog.objc-improvements8
-rw-r--r--gcc/c-decl.c11
-rw-r--r--gcc/testsuite/ChangeLog.objc-improvements4
-rw-r--r--gcc/testsuite/objc/execute/IMP.m1
4 files changed, 16 insertions, 8 deletions
diff --git a/gcc/ChangeLog.objc-improvements b/gcc/ChangeLog.objc-improvements
index 3a08ffac5df..1428a73b892 100644
--- a/gcc/ChangeLog.objc-improvements
+++ b/gcc/ChangeLog.objc-improvements
@@ -1,4 +1,9 @@
-<<<<<<< ChangeLog
+2004-08-21 Ziemowit Laski <zlaski@apple.com>
+
+ * c-decl.c (build_cdtor) Move calls to objc_static_init_needed_p()
+ and objc_generate_static_init_call() ...
+ (c_write_global_declarations): ... here.
+
2004-08-19 Ziemowit Laski <zlaski@apple.com>
* c-parse.in (methodtype): Specify %type; remove (explicit) semantic
@@ -125,7 +130,6 @@
(get_output_file_with_visibility): Add more special cases for headers
used by more than one front-end.
-=======
2004-08-06 Ziemowit Laski <zlaski@apple.com>
* doc/frontends.texi: Mention Objective-C++ in addition to
diff --git a/gcc/c-decl.c b/gcc/c-decl.c
index 4cb36b931fd..9d907af8bb5 100644
--- a/gcc/c-decl.c
+++ b/gcc/c-decl.c
@@ -6669,12 +6669,6 @@ build_cdtor (int method_type, tree cdtors)
{
tree body = 0;
- /* The Objective-C metadata initializer (if any) must be run
- _before_ all other static constructors. */
- if (c_dialect_objc () && (method_type == 'I')
- && objc_static_init_needed_p ())
- cdtors = objc_generate_static_init_call (cdtors);
-
if (!cdtors)
return;
@@ -6731,6 +6725,11 @@ c_write_global_declarations (void)
c_write_global_declarations_1 (BLOCK_VARS (DECL_INITIAL (t)));
c_write_global_declarations_1 (BLOCK_VARS (ext_block));
+ /* The Objective-C metadata initializer (if any) must be run
+ _before_ all other static constructors. */
+ if (objc_static_init_needed_p ())
+ static_ctors = objc_generate_static_init_call (static_ctors);
+
/* Generate functions to call static constructors and destructors
for targets that do not support .ctors/.dtors sections. These
functions have magic names which are detected by collect2. */
diff --git a/gcc/testsuite/ChangeLog.objc-improvements b/gcc/testsuite/ChangeLog.objc-improvements
index 37d75df829f..fddcd2beb33 100644
--- a/gcc/testsuite/ChangeLog.objc-improvements
+++ b/gcc/testsuite/ChangeLog.objc-improvements
@@ -1,3 +1,7 @@
+2004-08-21 Ziemowit Laski <zlaski@apple.com>
+
+ * objc/execute/IMP.m: Include <stdlib.h>.
+
2004-08-06 Ziemowit Laski <zlaski@apple.com>
* objc.dg/const-str-3.m: Include <memory.h> and <stdlib.h>.
diff --git a/gcc/testsuite/objc/execute/IMP.m b/gcc/testsuite/objc/execute/IMP.m
index 99f61933926..bf9383a98a4 100644
--- a/gcc/testsuite/objc/execute/IMP.m
+++ b/gcc/testsuite/objc/execute/IMP.m
@@ -1,6 +1,7 @@
/* Contributed by Nicola Pero - Fri Mar 9 19:39:15 CET 2001 */
#include <objc/objc.h>
#include <objc/objc-api.h>
+#include <stdlib.h>
#include "next_mapping.h"