aboutsummaryrefslogtreecommitdiff
path: root/gcc/objc
diff options
context:
space:
mode:
authorNicola Pero <nicola.pero@meta-innovation.com>2011-02-20 17:52:44 +0000
committerNicola Pero <nicola@gcc.gnu.org>2011-02-20 17:52:44 +0000
commit6d549148695719942e87205dc0a765317757a905 (patch)
tree4fa88789da4ac6afcba1f80d69d01dcbd5728d40 /gcc/objc
parent3890ce93e267fe56883b7b831475180641d9038f (diff)
downloadgcc-6d549148695719942e87205dc0a765317757a905.zip
gcc-6d549148695719942e87205dc0a765317757a905.tar.gz
gcc-6d549148695719942e87205dc0a765317757a905.tar.bz2
Reverted usage of TARGET_64BIT for code generation for GNU Objective-C runtime
From-SVN: r170343
Diffstat (limited to 'gcc/objc')
-rw-r--r--gcc/objc/ChangeLog7
-rw-r--r--gcc/objc/objc-act.c18
-rw-r--r--gcc/objc/objc-gnu-runtime-abi-01.c20
3 files changed, 26 insertions, 19 deletions
diff --git a/gcc/objc/ChangeLog b/gcc/objc/ChangeLog
index 9b92980..c2f16ec 100644
--- a/gcc/objc/ChangeLog
+++ b/gcc/objc/ChangeLog
@@ -1,3 +1,10 @@
+2011-02-19 Nicola Pero <nicola.pero@meta-innovation.com>
+
+ * objc-gnu-runtime-abi-01.c (TARGET_64BIT): Removed. Removed
+ usage of padding fields. Do not include tm.h.
+ * objc-act.c (objc_write_global_declaration): Set input_location
+ to BUILTINS_LOCATION while generating runtime metadata.
+
2011-01-19 Nicola Pero <nicola.pero@meta-innovation.com>
PR objc/47784
diff --git a/gcc/objc/objc-act.c b/gcc/objc/objc-act.c
index 0cabc52..a91c708 100644
--- a/gcc/objc/objc-act.c
+++ b/gcc/objc/objc-act.c
@@ -466,6 +466,8 @@ objc_write_global_declarations (void)
and code if only checking syntax, or if generating a PCH file. */
if (!flag_syntax_only && !pch_file)
{
+ location_t saved_location;
+
/* If gen_declaration desired, open the output file. */
if (flag_gen_declaration)
{
@@ -475,8 +477,24 @@ objc_write_global_declarations (void)
fatal_error ("can%'t open %s: %m", dumpname);
free (dumpname);
}
+
+ /* Set the input location to BUILTINS_LOCATION. This is good
+ for error messages, in case any is generated while producing
+ the metadata, but it also silences warnings that would be
+ produced when compiling with -Wpadded in case when padding is
+ automatically added to the built-in runtime data structure
+ declarations. We know about this padding, and it is fine; we
+ don't want users to see any warnings about it if they use
+ -Wpadded. */
+ saved_location = input_location;
+ input_location = BUILTINS_LOCATION;
+
/* Compute and emit the meta-data tables for this runtime. */
(*runtime.generate_metadata) ();
+
+ /* Restore the original location, just in case it mattered. */
+ input_location = saved_location;
+
/* ... and then close any declaration file we opened. */
if (gen_declaration_file)
fclose (gen_declaration_file);
diff --git a/gcc/objc/objc-gnu-runtime-abi-01.c b/gcc/objc/objc-gnu-runtime-abi-01.c
index e2a3ce7..7fb8761 100644
--- a/gcc/objc/objc-gnu-runtime-abi-01.c
+++ b/gcc/objc/objc-gnu-runtime-abi-01.c
@@ -21,7 +21,6 @@ along with GCC; see the file COPYING3. If not see
#include "config.h"
#include "system.h"
#include "coretypes.h"
-#include "tm.h"
#include "tree.h"
#ifdef OBJCPLUS
@@ -83,11 +82,6 @@ along with GCC; see the file COPYING3. If not see
if (VERS) \
DECL_ATTRIBUTES (DECL) = build_tree_list ((VERS), (KIND));
-/* FIXME: Remove this macro, not needed. */
-#ifndef TARGET_64BIT
-#define TARGET_64BIT 0
-#endif
-
static void gnu_runtime_01_initialize (void);
static void build_selector_template (void);
@@ -1995,9 +1989,7 @@ build_objc_symtab_template (void)
/* short cat_def_cnt; */
add_field_decl (short_integer_type_node, "cat_def_cnt", &chain);
- /* FIXME: Remove. */
- if (TARGET_64BIT)
- add_field_decl (integer_type_node, "_explicit_padder", &chain);
+ /* Note that padding will be added here on LP64. */
/* void *defs[imp_count + cat_count (+ 1)]; */
/* NB: The index is one less than the size of the array. */
@@ -2043,19 +2035,9 @@ init_objc_symtab (tree type)
CONSTRUCTOR_APPEND_ELT (v, NULL_TREE,
build_int_cst (short_integer_type_node, cat_count));
- /* FIXME: Remove. */
- if (TARGET_64BIT)
- CONSTRUCTOR_APPEND_ELT (v, NULL_TREE,
- build_int_cst (integer_type_node, 0));
-
/* cls_def = { ..., { &Foo, &Bar, ...}, ... } */
field = TYPE_FIELDS (type);
-
- /* FIXME: Remove. */
- if (TARGET_64BIT)
- field = DECL_CHAIN (field);
-
field = DECL_CHAIN (DECL_CHAIN (DECL_CHAIN (DECL_CHAIN (field))));
CONSTRUCTOR_APPEND_ELT (v, NULL_TREE, init_def_list (TREE_TYPE (field)));