From 1cff51e380fef6a08d3149143cd57f2152f83380 Mon Sep 17 00:00:00 2001 From: pinskia Date: Thu, 1 Sep 2005 01:32:10 +0000 Subject: [PATCH] 2005-08-31 Andrew Pinski PR objc/23306 * objc-act.c (generate_strings): Remove and move code to finish decl to ... (add_objc_string): here when creating a new string decl. (finish_objc): Don't call generate_strings. 2005-08-31 Andrew Pinski PR objc/23306 * objc.dg/image-info.m: Remove "objc_module_info" check part of the scan-assmbler. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@103713 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/objc/ChangeLog | 8 +++++ gcc/objc/objc-act.c | 70 ++++++-------------------------------- gcc/testsuite/ChangeLog | 6 ++++ gcc/testsuite/objc.dg/image-info.m | 2 +- 4 files changed, 26 insertions(+), 60 deletions(-) diff --git a/gcc/objc/ChangeLog b/gcc/objc/ChangeLog index fdb8c57..a66a772 100644 --- a/gcc/objc/ChangeLog +++ b/gcc/objc/ChangeLog @@ -1,5 +1,13 @@ 2005-08-31 Andrew Pinski + PR objc/23306 + * objc-act.c (generate_strings): Remove and move code to + finish decl to ... + (add_objc_string): here when creating a new string decl. + (finish_objc): Don't call generate_strings. + +2005-08-31 Andrew Pinski + PR objc/23381 * objc-act.c (next_sjlj_build_try_catch_finally): Set TREE_SIDE_EFFECTS on catch_seq after building it. diff --git a/gcc/objc/objc-act.c b/gcc/objc/objc-act.c index 7d3fb26..f5a8441 100644 --- a/gcc/objc/objc-act.c +++ b/gcc/objc/objc-act.c @@ -2448,60 +2448,6 @@ generate_static_references (void) finish_var_decl (static_instances_decl, expr); } -/* Output all strings. */ - -static void -generate_strings (void) -{ - tree chain, string_expr; - tree string, decl, type; - - for (chain = class_names_chain; chain; chain = TREE_CHAIN (chain)) - { - string = TREE_VALUE (chain); - decl = TREE_PURPOSE (chain); - type = build_array_type - (char_type_node, - build_index_type - (build_int_cst (NULL_TREE, - IDENTIFIER_LENGTH (string)))); - decl = start_var_decl (type, IDENTIFIER_POINTER (DECL_NAME (decl))); - string_expr = my_build_string (IDENTIFIER_LENGTH (string) + 1, - IDENTIFIER_POINTER (string)); - finish_var_decl (decl, string_expr); - } - - for (chain = meth_var_names_chain; chain; chain = TREE_CHAIN (chain)) - { - string = TREE_VALUE (chain); - decl = TREE_PURPOSE (chain); - type = build_array_type - (char_type_node, - build_index_type - (build_int_cst (NULL_TREE, - IDENTIFIER_LENGTH (string)))); - decl = start_var_decl (type, IDENTIFIER_POINTER (DECL_NAME (decl))); - string_expr = my_build_string (IDENTIFIER_LENGTH (string) + 1, - IDENTIFIER_POINTER (string)); - finish_var_decl (decl, string_expr); - } - - for (chain = meth_var_types_chain; chain; chain = TREE_CHAIN (chain)) - { - string = TREE_VALUE (chain); - decl = TREE_PURPOSE (chain); - type = build_array_type - (char_type_node, - build_index_type - (build_int_cst (NULL_TREE, - IDENTIFIER_LENGTH (string)))); - decl = start_var_decl (type, IDENTIFIER_POINTER (DECL_NAME (decl))); - string_expr = my_build_string (IDENTIFIER_LENGTH (string) + 1, - IDENTIFIER_POINTER (string)); - finish_var_decl (decl, string_expr); - } -} - static GTY(()) int selector_reference_idx; static tree @@ -2820,7 +2766,7 @@ objc_get_class_reference (tree ident) static tree add_objc_string (tree ident, enum string_section section) { - tree *chain, decl; + tree *chain, decl, type, string_expr; if (section == class_names) chain = &class_names_chain; @@ -2841,6 +2787,16 @@ add_objc_string (tree ident, enum string_section section) } decl = build_objc_string_decl (section); + + type = build_array_type + (char_type_node, + build_index_type + (build_int_cst (NULL_TREE, + IDENTIFIER_LENGTH (ident)))); + decl = start_var_decl (type, IDENTIFIER_POINTER (DECL_NAME (decl))); + string_expr = my_build_string (IDENTIFIER_LENGTH (ident) + 1, + IDENTIFIER_POINTER (ident)); + finish_var_decl (decl, string_expr); *chain = tree_cons (decl, ident, NULL_TREE); @@ -9226,10 +9182,6 @@ finish_objc (void) for (impent = imp_list; impent; impent = impent->next) handle_impent (impent); - /* Dump the string table last. */ - - generate_strings (); - if (warn_selector) { int slot; diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 35176b6..515ea5a 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2005-08-31 Andrew Pinski + + PR objc/23306 + * objc.dg/image-info.m: Remove "objc_module_info" check part of the + scan-assmbler. + 2005-08-31 J"orn Rennecke PR target/21255 diff --git a/gcc/testsuite/objc.dg/image-info.m b/gcc/testsuite/objc.dg/image-info.m index 87f1477..3ffe814 100644 --- a/gcc/testsuite/objc.dg/image-info.m +++ b/gcc/testsuite/objc.dg/image-info.m @@ -35,4 +35,4 @@ extern void abort(void); } @end -/* { dg-final { scan-assembler "\t.section __OBJC, __image_info.*\n\t.align.*\nL_OBJC_IMAGE_INFO.*:\n\t.long\t0\n\t.long\t1\n\t.objc_module_info\n" } } */ +/* { dg-final { scan-assembler "\t.section __OBJC, __image_info.*\n\t.align.*\nL_OBJC_IMAGE_INFO.*:\n\t.long\t0\n\t.long\t1" } } */ -- 2.7.4