aboutsummaryrefslogtreecommitdiff
path: root/gcc/objc
diff options
context:
space:
mode:
authorJoseph Myers <joseph@codesourcery.com>2005-06-15 16:55:47 +0100
committerJoseph Myers <jsm28@gcc.gnu.org>2005-06-15 16:55:47 +0100
commit46bdb9cffb6b1cd45bc8032f9b1d7e9e101ba7b0 (patch)
tree1872e122192fae90234ef8f17d82cd485d62d6cf /gcc/objc
parent38e19e4c73b8614fb094c5c36abdd7da47a26a50 (diff)
downloadgcc-46bdb9cffb6b1cd45bc8032f9b1d7e9e101ba7b0.zip
gcc-46bdb9cffb6b1cd45bc8032f9b1d7e9e101ba7b0.tar.gz
gcc-46bdb9cffb6b1cd45bc8032f9b1d7e9e101ba7b0.tar.bz2
c-tree.h (default_function_array_conversion): Declare.
* c-tree.h (default_function_array_conversion): Declare. * c-typeck.c (default_function_array_conversion): Export. Correct comment. (default_conversion): Do not call default_function_array_conversion. Do not allow FUNCTION_TYPE. (build_function_call): Call default_function_array_conversion on the function. (convert_arguments): Do not call it on the function arguments. (build_unary_op): Do not allow ARRAY_TYPE or FUNCTION_TYPE for TRUTH_NOT_EXPR. Call default_function_array_conversion for taking address of ARRAY_REF. (build_compound_expr): Do not call default_function_array_conversion. (build_c_cast): Do not call default_function_array_conversion. (convert_for_assignment): Do not call default_conversion. (digest_init): Call default_function_array_conversion to convert string constants and compound literals to pointers, but not otherwise. (output_init_element): Likewise. (build_asm_expr): Do not call default_function_array_conversion. (c_process_expr_stmt): Likewise. (c_objc_common_truthvalue_conversion): Likewise. Do not allow FUNCTION_TYPE. * c-parser.c (c_parser_expression_conv): New. (c_parser_asm_operands, c_parser_expr_list): Add convert_p argument. All callers changed. Call default_function_array_conversion if convert_p. (c_parser_initializer, c_parser_initval): Call default_function_array_conversion except for string constants and compound literals. (c_parser_initelt): Call default_function_array_conversion for ObjC expression received. (c_parser_statement_after_labels): Call c_parser_expression_conv for return and expression statements. (c_parser_paren_condition, c_parser_for_statement, c_parser_conditional_expression): Call c_parser_expression_conv. (c_parser_expr_no_commas, c_parser_conditional_expression, c_parser_binary_expression, c_parser_cast_expression, c_parser_unary_expression): Call default_function_array_conversion. objc: * objc-act.c (my_build_string_pointer): New. (objc_get_class_reference, get_super_receiver): Call my_build_string_pointer instead of my_build_string when building function arguments. testsuite: * gcc.dg/noncompile/20040203-3.c: Update expected message. From-SVN: r100984
Diffstat (limited to 'gcc/objc')
-rw-r--r--gcc/objc/ChangeLog7
-rw-r--r--gcc/objc/objc-act.c20
2 files changed, 23 insertions, 4 deletions
diff --git a/gcc/objc/ChangeLog b/gcc/objc/ChangeLog
index a36cce8..d9eb3d1 100644
--- a/gcc/objc/ChangeLog
+++ b/gcc/objc/ChangeLog
@@ -1,3 +1,10 @@
+2005-06-15 Joseph S. Myers <joseph@codesourcery.com>
+
+ * objc-act.c (my_build_string_pointer): New.
+ (objc_get_class_reference, get_super_receiver): Call
+ my_build_string_pointer instead of my_build_string when building
+ function arguments.
+
2005-05-25 Mike Stump <mrs@mrs.kithrup.com>
* objc-act.c (volatilized_hash): Avoid warnings on 64-bit
diff --git a/gcc/objc/objc-act.c b/gcc/objc/objc-act.c
index 95a8489..3329318 100644
--- a/gcc/objc/objc-act.c
+++ b/gcc/objc/objc-act.c
@@ -1722,6 +1722,16 @@ my_build_string (int len, const char *str)
return fix_string_type (build_string (len, str));
}
+/* Build a string with contents STR and length LEN and convert it to a
+ pointer. */
+
+static tree
+my_build_string_pointer (int len, const char *str)
+{
+ tree string = my_build_string (len, str);
+ tree ptrtype = build_pointer_type (TREE_TYPE (TREE_TYPE (string)));
+ return build1 (ADDR_EXPR, ptrtype, string);
+}
static hashval_t
string_hash (const void *ptr)
@@ -2699,8 +2709,9 @@ objc_get_class_reference (tree ident)
add_class_reference (ident);
params = build_tree_list (NULL_TREE,
- my_build_string (IDENTIFIER_LENGTH (ident) + 1,
- IDENTIFIER_POINTER (ident)));
+ my_build_string_pointer
+ (IDENTIFIER_LENGTH (ident) + 1,
+ IDENTIFIER_POINTER (ident)));
assemble_external (objc_get_class_decl);
return build_function_call (objc_get_class_decl, params);
@@ -8641,8 +8652,9 @@ get_super_receiver (void)
(super_class,
build_tree_list
(NULL_TREE,
- my_build_string (IDENTIFIER_LENGTH (super_name) + 1,
- IDENTIFIER_POINTER (super_name))));
+ my_build_string_pointer
+ (IDENTIFIER_LENGTH (super_name) + 1,
+ IDENTIFIER_POINTER (super_name))));
}
super_expr