diff options
Diffstat (limited to 'gcc/objc/objc-act.c')
-rw-r--r-- | gcc/objc/objc-act.c | 253 |
1 files changed, 156 insertions, 97 deletions
diff --git a/gcc/objc/objc-act.c b/gcc/objc/objc-act.c index 41ed41e..0c91faa 100644 --- a/gcc/objc/objc-act.c +++ b/gcc/objc/objc-act.c @@ -151,7 +151,7 @@ static void finish_objc (void); /* Code generation. */ static tree objc_build_constructor (tree, tree); -static tree build_objc_method_call (int, tree, tree, tree, tree); +static tree build_objc_method_call (location_t, int, tree, tree, tree, tree); static tree get_proto_encoding (tree); static tree lookup_interface (tree); static tree objc_add_static_instance (tree, tree); @@ -430,8 +430,8 @@ objc_start_struct (tree name) { gcc_assert (!objc_building_struct); objc_building_struct = true; - return start_struct (RECORD_TYPE, name, &objc_in_struct, &objc_struct_types, - UNKNOWN_LOCATION); + return start_struct (input_location, RECORD_TYPE, + name, &objc_in_struct, &objc_struct_types); } /* Finish building a struct for objc. */ @@ -441,8 +441,8 @@ objc_finish_struct (tree type, tree fieldlist) { gcc_assert (objc_building_struct); objc_building_struct = false; - return finish_struct (type, fieldlist, NULL_TREE, objc_in_struct, - objc_struct_types); + return finish_struct (input_location, type, fieldlist, NULL_TREE, + objc_in_struct, objc_struct_types); } /* Some platforms pass small structures through registers versus @@ -826,7 +826,8 @@ objc_build_struct (tree klass, tree fields, tree super_name) { /* Prepend a packed variant of the base class into the layout. This is necessary to preserve ObjC ABI compatibility. */ - tree base = build_decl (FIELD_DECL, NULL_TREE, super); + tree base = build_decl (input_location, + FIELD_DECL, NULL_TREE, super); tree field = TYPE_FIELDS (super); while (field && TREE_CHAIN (field) @@ -1287,7 +1288,7 @@ objc_build_component_ref (tree datum, tree component) return finish_class_member_access_expr (datum, component, false, tf_warning_or_error); #else - return build_component_ref (datum, component); + return build_component_ref (input_location, datum, component); #endif } @@ -1482,7 +1483,8 @@ lookup_and_install_protocols (tree protocols) static tree create_field_decl (tree type, const char *name) { - return build_decl (FIELD_DECL, get_identifier (name), type); + return build_decl (input_location, + FIELD_DECL, get_identifier (name), type); } /* Create a global, static declaration for variable NAME of a given TYPE. The @@ -1491,7 +1493,8 @@ create_field_decl (tree type, const char *name) static tree start_var_decl (tree type, const char *name) { - tree var = build_decl (VAR_DECL, get_identifier (name), type); + tree var = build_decl (input_location, + VAR_DECL, get_identifier (name), type); TREE_STATIC (var) = 1; DECL_INITIAL (var) = error_mark_node; /* A real initializer is coming... */ @@ -1510,7 +1513,7 @@ start_var_decl (tree type, const char *name) static void finish_var_decl (tree var, tree initializer) { - finish_decl (var, initializer, NULL_TREE, NULL_TREE); + finish_decl (var, input_location, initializer, NULL_TREE, NULL_TREE); /* Ensure that the variable actually gets output. */ mark_decl_referenced (var); /* Mark the decl to avoid "defined but not used" warning. */ @@ -1581,11 +1584,13 @@ synth_module_prologue (void) /* Declare the 'id' and 'Class' typedefs. */ - type = lang_hooks.decls.pushdecl (build_decl (TYPE_DECL, + type = lang_hooks.decls.pushdecl (build_decl (input_location, + TYPE_DECL, objc_object_name, objc_object_type)); TREE_NO_WARNING (type) = 1; - type = lang_hooks.decls.pushdecl (build_decl (TYPE_DECL, + type = lang_hooks.decls.pushdecl (build_decl (input_location, + TYPE_DECL, objc_class_name, objc_class_type)); TREE_NO_WARNING (type) = 1; @@ -1843,11 +1848,14 @@ static tree objc_build_internal_const_str_type (void) { tree type = (*lang_hooks.types.make_type) (RECORD_TYPE); - tree fields = build_decl (FIELD_DECL, NULL_TREE, ptr_type_node); - tree field = build_decl (FIELD_DECL, NULL_TREE, ptr_type_node); + tree fields = build_decl (input_location, + FIELD_DECL, NULL_TREE, ptr_type_node); + tree field = build_decl (input_location, + FIELD_DECL, NULL_TREE, ptr_type_node); TREE_CHAIN (field) = fields; fields = field; - field = build_decl (FIELD_DECL, NULL_TREE, unsigned_type_node); + field = build_decl (input_location, + FIELD_DECL, NULL_TREE, unsigned_type_node); TREE_CHAIN (field) = fields; fields = field; /* NB: The finish_builtin_struct() routine expects FIELD_DECLs in reverse order! */ @@ -1990,7 +1998,8 @@ objc_build_string_object (tree string) = objc_add_static_instance (constructor, constant_string_type); else { - var = build_decl (CONST_DECL, NULL, TREE_TYPE (constructor)); + var = build_decl (input_location, + CONST_DECL, NULL, TREE_TYPE (constructor)); DECL_INITIAL (var) = constructor; TREE_STATIC (var) = 1; pushdecl_top_level (var); @@ -2028,7 +2037,8 @@ objc_add_static_instance (tree constructor, tree class_decl) } sprintf (buf, "_OBJC_INSTANCE_%d", num_static_inst++); - decl = build_decl (VAR_DECL, get_identifier (buf), class_decl); + decl = build_decl (input_location, + VAR_DECL, get_identifier (buf), class_decl); DECL_COMMON (decl) = 1; TREE_STATIC (decl) = 1; DECL_ARTIFICIAL (decl) = 1; @@ -2371,7 +2381,8 @@ build_module_initializer_routine (void) push_lang_context (lang_name_c); /* extern "C" */ #endif - objc_push_parm (build_decl (PARM_DECL, NULL_TREE, void_type_node)); + objc_push_parm (build_decl (input_location, + PARM_DECL, NULL_TREE, void_type_node)); objc_start_function (get_identifier (TAG_GNUINIT), build_function_type (void_type_node, OBJC_VOID_AT_END), @@ -2379,12 +2390,13 @@ build_module_initializer_routine (void) body = c_begin_compound_stmt (true); add_stmt (build_function_call - (execclass_decl, + (input_location, + execclass_decl, build_tree_list (NULL_TREE, build_unary_op (input_location, ADDR_EXPR, UOBJC_MODULES_decl, 0)))); - add_stmt (c_end_compound_stmt (body, true)); + add_stmt (c_end_compound_stmt (input_location, body, true)); TREE_PUBLIC (current_function_decl) = 0; @@ -2417,8 +2429,9 @@ objc_static_init_needed_p (void) tree objc_generate_static_init_call (tree ctors ATTRIBUTE_UNUSED) { - add_stmt (build_stmt (EXPR_STMT, - build_function_call (GNU_INIT_decl, NULL_TREE))); + add_stmt (build_stmt (input_location, EXPR_STMT, + build_function_call (input_location, + GNU_INIT_decl, NULL_TREE))); return ctors; } @@ -2647,10 +2660,11 @@ get_proto_encoding (tree proto) } /* sel_ref_chain is a list whose "value" fields will be instances of - identifier_node that represent the selector. */ + identifier_node that represent the selector. LOC is the location of + the @selector. */ static tree -build_typed_selector_reference (tree ident, tree prototype) +build_typed_selector_reference (location_t loc, tree ident, tree prototype) { tree *chain = &sel_ref_chain; tree expr; @@ -2668,16 +2682,15 @@ build_typed_selector_reference (tree ident, tree prototype) *chain = tree_cons (prototype, ident, NULL_TREE); return_at_index: - expr = build_unary_op (input_location, ADDR_EXPR, - build_array_ref (UOBJC_SELECTOR_TABLE_decl, - build_int_cst (NULL_TREE, index), - input_location), + expr = build_unary_op (loc, ADDR_EXPR, + build_array_ref (loc, UOBJC_SELECTOR_TABLE_decl, + build_int_cst (NULL_TREE, index)), 1); return convert (objc_selector_type, expr); } static tree -build_selector_reference (tree ident) +build_selector_reference (location_t loc, tree ident) { tree *chain = &sel_ref_chain; tree expr; @@ -2688,9 +2701,8 @@ build_selector_reference (tree ident) if (TREE_VALUE (*chain) == ident) return (flag_next_runtime ? TREE_PURPOSE (*chain) - : build_array_ref (UOBJC_SELECTOR_TABLE_decl, - build_int_cst (NULL_TREE, index), - input_location)); + : build_array_ref (loc, UOBJC_SELECTOR_TABLE_decl, + build_int_cst (NULL_TREE, index))); index++; chain = &TREE_CHAIN (*chain); @@ -2702,9 +2714,8 @@ build_selector_reference (tree ident) return (flag_next_runtime ? expr - : build_array_ref (UOBJC_SELECTOR_TABLE_decl, - build_int_cst (NULL_TREE, index), - input_location)); + : build_array_ref (loc, UOBJC_SELECTOR_TABLE_decl, + build_int_cst (NULL_TREE, index))); } static GTY(()) int class_reference_idx; @@ -2816,7 +2827,7 @@ objc_get_class_reference (tree ident) IDENTIFIER_POINTER (ident))); assemble_external (objc_get_class_decl); - return build_function_call (objc_get_class_decl, params); + return build_function_call (input_location, objc_get_class_decl, params); } } @@ -2884,7 +2895,8 @@ build_objc_string_decl (enum string_section section) ident = get_identifier (buf); - decl = build_decl (VAR_DECL, ident, build_array_type (char_type_node, 0)); + decl = build_decl (input_location, + VAR_DECL, ident, build_array_type (char_type_node, 0)); DECL_EXTERNAL (decl) = 1; TREE_PUBLIC (decl) = 0; TREE_USED (decl) = 1; @@ -2924,7 +2936,8 @@ objc_declare_alias (tree alias_ident, tree class_ident) push_lang_context (lang_name_c); /* extern "C" */ #endif lang_hooks.decls.pushdecl (build_decl - (TYPE_DECL, + (input_location, + TYPE_DECL, alias_ident, xref_tag (RECORD_TYPE, underlying_class))); #ifdef OBJCPLUS @@ -3088,11 +3101,11 @@ objc_substitute_decl (tree expr, tree oldexpr, tree newexpr) newexpr), DECL_NAME (TREE_OPERAND (expr, 1))); case ARRAY_REF: - return build_array_ref (objc_substitute_decl (TREE_OPERAND (expr, 0), + return build_array_ref (input_location, + objc_substitute_decl (TREE_OPERAND (expr, 0), oldexpr, newexpr), - TREE_OPERAND (expr, 1), - input_location); + TREE_OPERAND (expr, 1)); case INDIRECT_REF: return build_indirect_ref (input_location, objc_substitute_decl (TREE_OPERAND (expr, 0), @@ -3129,7 +3142,7 @@ objc_build_ivar_assignment (tree outervar, tree lhs, tree rhs) NULL_TREE))); assemble_external (func); - return build_function_call (func, func_params); + return build_function_call (input_location, func, func_params); } static tree @@ -3142,7 +3155,8 @@ objc_build_global_assignment (tree lhs, tree rhs) NULL_TREE)); assemble_external (objc_assign_global_decl); - return build_function_call (objc_assign_global_decl, func_params); + return build_function_call (input_location, + objc_assign_global_decl, func_params); } static tree @@ -3155,7 +3169,8 @@ objc_build_strong_cast_assignment (tree lhs, tree rhs) NULL_TREE)); assemble_external (objc_assign_strong_cast_decl); - return build_function_call (objc_assign_strong_cast_decl, func_params); + return build_function_call (input_location, + objc_assign_strong_cast_decl, func_params); } static int @@ -3422,7 +3437,8 @@ objc_create_temporary_var (tree type) { tree decl; - decl = build_decl (VAR_DECL, NULL_TREE, type); + decl = build_decl (input_location, + VAR_DECL, NULL_TREE, type); TREE_USED (decl) = 1; DECL_ARTIFICIAL (decl) = 1; DECL_IGNORED_P (decl) = 1; @@ -3542,7 +3558,8 @@ next_sjlj_build_try_exit (void) tree t; t = build_fold_addr_expr (cur_try_context->stack_decl); t = tree_cons (NULL, t, NULL); - t = build_function_call (objc_exception_try_exit_decl, t); + t = build_function_call (input_location, + objc_exception_try_exit_decl, t); return t; } @@ -3562,7 +3579,8 @@ next_sjlj_build_enter_and_setjmp (void) t = build_fold_addr_expr (cur_try_context->stack_decl); t = tree_cons (NULL, t, NULL); - enter = build_function_call (objc_exception_try_enter_decl, t); + enter = build_function_call (input_location, + objc_exception_try_enter_decl, t); t = objc_build_component_ref (cur_try_context->stack_decl, get_identifier ("buf")); @@ -3577,7 +3595,8 @@ next_sjlj_build_enter_and_setjmp (void) t = convert (ptr_type_node, t); #endif t = tree_cons (NULL, t, NULL); - sj = build_function_call (objc_setjmp_decl, t); + sj = build_function_call (input_location, + objc_setjmp_decl, t); cond = build2 (COMPOUND_EXPR, TREE_TYPE (sj), enter, sj); cond = c_common_truthvalue_conversion (input_location, cond); @@ -3596,7 +3615,8 @@ next_sjlj_build_exc_extract (tree decl) t = build_fold_addr_expr (cur_try_context->stack_decl); t = tree_cons (NULL, t, NULL); - t = build_function_call (objc_exception_extract_decl, t); + t = build_function_call (input_location, + objc_exception_extract_decl, t); t = convert (TREE_TYPE (decl), t); t = build2 (MODIFY_EXPR, void_type_node, decl, t); @@ -3646,7 +3666,8 @@ next_sjlj_build_catch_list (void) args = tree_cons (NULL, cur_try_context->caught_decl, NULL); t = objc_get_class_reference (OBJC_TYPE_NAME (TREE_TYPE (type))); args = tree_cons (NULL, t, args); - t = build_function_call (objc_exception_match_decl, args); + t = build_function_call (input_location, + objc_exception_match_decl, args); cond = c_common_truthvalue_conversion (input_location, t); } t = build3 (COND_EXPR, void_type_node, cond, body, NULL); @@ -3744,7 +3765,7 @@ next_sjlj_build_try_catch_finally (void) if (cur_try_context->catch_list) { tree caught_decl = objc_build_exc_ptr (); - catch_seq = build_stmt (BIND_EXPR, caught_decl, NULL, NULL); + catch_seq = build_stmt (input_location, BIND_EXPR, caught_decl, NULL, NULL); TREE_SIDE_EFFECTS (catch_seq) = 1; t = next_sjlj_build_exc_extract (caught_decl); @@ -3768,7 +3789,7 @@ next_sjlj_build_try_catch_finally (void) /* Build the complete FINALLY statement list. */ t = next_sjlj_build_try_exit (); - t = build_stmt (COND_EXPR, + t = build_stmt (input_location, COND_EXPR, c_common_truthvalue_conversion (input_location, rethrow_decl), NULL, t); @@ -3779,8 +3800,9 @@ next_sjlj_build_try_catch_finally (void) &TREE_OPERAND (try_fin, 1)); t = tree_cons (NULL, rethrow_decl, NULL); - t = build_function_call (objc_exception_throw_decl, t); - t = build_stmt (COND_EXPR, + t = build_function_call (input_location, + objc_exception_throw_decl, t); + t = build_stmt (input_location, COND_EXPR, c_common_truthvalue_conversion (input_location, rethrow_decl), t, NULL); @@ -3822,7 +3844,8 @@ objc_begin_catch_clause (tree decl) compound = c_begin_compound_stmt (true); /* The parser passed in a PARM_DECL, but what we really want is a VAR_DECL. */ - decl = build_decl (VAR_DECL, DECL_NAME (decl), TREE_TYPE (decl)); + decl = build_decl (input_location, + VAR_DECL, DECL_NAME (decl), TREE_TYPE (decl)); lang_hooks.decls.pushdecl (decl); /* Since a decl is required here by syntax, don't warn if its unused. */ @@ -3865,7 +3888,7 @@ objc_begin_catch_clause (tree decl) /* Record the data for the catch in the try context so that we can finalize it later. */ - t = build_stmt (CATCH_EXPR, type, compound); + t = build_stmt (input_location, CATCH_EXPR, type, compound); cur_try_context->current_catch = t; /* Initialize the decl from the EXC_PTR_EXPR we get from the runtime. */ @@ -3885,7 +3908,7 @@ objc_finish_catch_clause (void) cur_try_context->current_catch = NULL; cur_try_context->end_catch_locus = input_location; - CATCH_BODY (c) = c_end_compound_stmt (CATCH_BODY (c), 1); + CATCH_BODY (c) = c_end_compound_stmt (input_location, CATCH_BODY (c), 1); append_to_statement_list (c, &cur_try_context->catch_list); } @@ -3930,12 +3953,12 @@ objc_finish_try_stmt (void) stmt = c->try_body; if (c->catch_list) { - stmt = build_stmt (TRY_CATCH_EXPR, stmt, c->catch_list); + stmt = build_stmt (input_location, TRY_CATCH_EXPR, stmt, c->catch_list); SET_EXPR_LOCATION (stmt, cur_try_context->try_locus); } if (c->finally_body) { - stmt = build_stmt (TRY_FINALLY_EXPR, stmt, c->finally_body); + stmt = build_stmt (input_location, TRY_FINALLY_EXPR, stmt, c->finally_body); SET_EXPR_LOCATION (stmt, cur_try_context->try_locus); } } @@ -3947,7 +3970,7 @@ objc_finish_try_stmt (void) } tree -objc_build_throw_stmt (tree throw_expr) +objc_build_throw_stmt (location_t loc, tree throw_expr) { tree args; @@ -3960,7 +3983,7 @@ objc_build_throw_stmt (tree throw_expr) if (cur_try_context == NULL || cur_try_context->current_catch == NULL) { - error ("%<@throw%> (rethrow) used outside of a @catch block"); + error_at (loc, "%<@throw%> (rethrow) used outside of a @catch block"); return NULL_TREE; } @@ -3972,7 +3995,8 @@ objc_build_throw_stmt (tree throw_expr) /* A throw is just a call to the runtime throw function with the object as a parameter. */ args = tree_cons (NULL, throw_expr, NULL); - return add_stmt (build_function_call (objc_exception_throw_decl, args)); + return add_stmt (build_function_call (loc, + objc_exception_throw_decl, args)); } tree @@ -3983,13 +4007,15 @@ objc_build_synchronized (location_t start_locus, tree mutex, tree body) /* First lock the mutex. */ mutex = save_expr (mutex); args = tree_cons (NULL, mutex, NULL); - call = build_function_call (objc_sync_enter_decl, args); + call = build_function_call (input_location, + objc_sync_enter_decl, args); SET_EXPR_LOCATION (call, start_locus); add_stmt (call); /* Build the mutex unlock. */ args = tree_cons (NULL, mutex, NULL); - call = build_function_call (objc_sync_exit_decl, args); + call = build_function_call (input_location, + objc_sync_exit_decl, args); SET_EXPR_LOCATION (call, input_location); /* Put the that and the body in a TRY_FINALLY. */ @@ -5792,13 +5818,14 @@ generate_shared_structures (int cls_flags) if (my_super_id) { super_expr = add_objc_string (my_super_id, class_names); - super_expr = build_c_cast (cast_type, super_expr); /* cast! */ + super_expr = build_c_cast (input_location, + cast_type, super_expr); /* cast! */ } else super_expr = build_int_cst (NULL_TREE, 0); root_expr = add_objc_string (my_root_id, class_names); - root_expr = build_c_cast (cast_type, root_expr); /* cast! */ + root_expr = build_c_cast (input_location, cast_type, root_expr); /* cast! */ if (CLASS_PROTOCOL_LIST (implementation_template)) { @@ -6234,6 +6261,7 @@ tree objc_build_message_expr (tree mess) { tree receiver = TREE_PURPOSE (mess); + location_t loc; tree sel_name; #ifdef OBJCPLUS tree args = TREE_PURPOSE (TREE_VALUE (mess)); @@ -6245,6 +6273,11 @@ objc_build_message_expr (tree mess) if (TREE_CODE (receiver) == ERROR_MARK) return error_mark_node; + if (CAN_HAVE_LOCATION_P (receiver)) + loc = EXPR_LOCATION (receiver); + else + loc = input_location; + /* Obtain the full selector name. */ if (TREE_CODE (args) == IDENTIFIER_NODE) /* A unary selector. */ @@ -6501,9 +6534,12 @@ objc_finish_message_expr (tree receiver, tree sel_name, tree method_params) if (!warn_missing_methods) { - warning (0, "(Messages without a matching method signature"); - warning (0, "will be assumed to return %<id%> and accept"); - warning (0, "%<...%> as arguments.)"); + warning_at (input_location, + 0, "(Messages without a matching method signature"); + warning_at (input_location, + 0, "will be assumed to return %<id%> and accept"); + warning_at (input_location, + 0, "%<...%> as arguments.)"); warn_missing_methods = true; } } @@ -6515,11 +6551,12 @@ objc_finish_message_expr (tree receiver, tree sel_name, tree method_params) These are the object itself and the selector. */ if (flag_typed_selectors) - selector = build_typed_selector_reference (sel_name, method_prototype); + selector = build_typed_selector_reference (input_location, + sel_name, method_prototype); else - selector = build_selector_reference (sel_name); + selector = build_selector_reference (input_location, sel_name); - retval = build_objc_method_call (super, method_prototype, + retval = build_objc_method_call (input_location, super, method_prototype, receiver, selector, method_params); @@ -6532,11 +6569,12 @@ objc_finish_message_expr (tree receiver, tree sel_name, tree method_params) looking up the method on object LOOKUP_OBJECT (often same as OBJECT), assuming the method has prototype METHOD_PROTOTYPE. (That is an INSTANCE_METHOD_DECL or CLASS_METHOD_DECL.) + LOC is the location of the expression to build. Use METHOD_PARAMS as list of args to pass to the method. If SUPER_FLAG is nonzero, we look up the superclass's method. */ static tree -build_objc_method_call (int super_flag, tree method_prototype, +build_objc_method_call (location_t loc, int super_flag, tree method_prototype, tree lookup_object, tree selector, tree method_params) { @@ -6563,7 +6601,7 @@ build_objc_method_call (int super_flag, tree method_prototype, (method_prototype, METHOD_REF, super_flag))); tree method, t; - lookup_object = build_c_cast (rcv_p, lookup_object); + lookup_object = build_c_cast (loc, rcv_p, lookup_object); /* Use SAVE_EXPR to avoid evaluating the receiver twice. */ lookup_object = save_expr (lookup_object); @@ -6599,7 +6637,8 @@ build_objc_method_call (int super_flag, tree method_prototype, t = tree_cons (NULL_TREE, selector, NULL_TREE); t = tree_cons (NULL_TREE, lookup_object, t); - method = build_function_call (sender, t); + method = build_function_call (loc, + sender, t); /* Pass the object to the method. */ method_params = tree_cons (NULL_TREE, object, @@ -6610,7 +6649,8 @@ build_objc_method_call (int super_flag, tree method_prototype, /* ??? Selector is not at this point something we can use inside the compiler itself. Set it to garbage for the nonce. */ t = build3 (OBJ_TYPE_REF, sender_cast, method, lookup_object, size_zero_node); - return build_function_call (t, method_params); + return build_function_call (loc, + t, method_params); } static void @@ -6701,9 +6741,10 @@ objc_build_protocol_expr (tree protoname) /* This function is called by the parser when a @selector() expression is found, in order to compile it. It is only called by the parser - and only to compile a @selector(). */ + and only to compile a @selector(). LOC is the location of the + @selector. */ tree -objc_build_selector_expr (tree selnamelist) +objc_build_selector_expr (location_t loc, tree selnamelist) { tree selname; @@ -6743,9 +6784,9 @@ objc_build_selector_expr (tree selnamelist) if (flag_typed_selectors) - return build_typed_selector_reference (selname, 0); + return build_typed_selector_reference (loc, selname, 0); else - return build_selector_reference (selname); + return build_selector_reference (loc, selname); } tree @@ -8363,7 +8404,7 @@ objc_get_parm_info (int have_ellipsis) TREE_CHAIN (parm_info) = NULL_TREE; parm_info = pushdecl (parm_info); - finish_decl (parm_info, NULL_TREE, NULL_TREE, NULL_TREE); + finish_decl (parm_info, input_location, NULL_TREE, NULL_TREE, NULL_TREE); parm_info = next; } arg_info = get_parm_info (have_ellipsis); @@ -8391,10 +8432,12 @@ synth_self_and_ucmd_args (void) self_type = objc_object_type; /* id self; */ - objc_push_parm (build_decl (PARM_DECL, self_id, self_type)); + objc_push_parm (build_decl (input_location, + PARM_DECL, self_id, self_type)); /* SEL _cmd; */ - objc_push_parm (build_decl (PARM_DECL, ucmd_id, objc_selector_type)); + objc_push_parm (build_decl (input_location, + PARM_DECL, ucmd_id, objc_selector_type)); } /* Transform an Objective-C method definition into a static C function @@ -8434,7 +8477,8 @@ start_method_def (tree method) { tree type = TREE_VALUE (TREE_TYPE (parmlist)), parm; - parm = build_decl (PARM_DECL, KEYWORD_ARG_NAME (parmlist), type); + parm = build_decl (input_location, + PARM_DECL, KEYWORD_ARG_NAME (parmlist), type); objc_push_parm (parm); parmlist = TREE_CHAIN (parmlist); } @@ -8576,7 +8620,8 @@ objc_start_function (tree name, tree type, tree attrs, #endif ) { - tree fndecl = build_decl (FUNCTION_DECL, name, type); + tree fndecl = build_decl (input_location, + FUNCTION_DECL, name, type); #ifdef OBJCPLUS DECL_ARGUMENTS (fndecl) = params; @@ -8612,7 +8657,8 @@ objc_start_function (tree name, tree type, tree attrs, push_scope (); declare_parm_level (); DECL_RESULT (current_function_decl) - = build_decl (RESULT_DECL, NULL_TREE, + = build_decl (input_location, + RESULT_DECL, NULL_TREE, TREE_TYPE (TREE_TYPE (current_function_decl))); DECL_ARTIFICIAL (DECL_RESULT (current_function_decl)) = 1; DECL_IGNORED_P (DECL_RESULT (current_function_decl)) = 1; @@ -8749,19 +8795,22 @@ get_super_receiver (void) if (!UOBJC_SUPER_decl) { - UOBJC_SUPER_decl = build_decl (VAR_DECL, get_identifier (TAG_SUPER), + UOBJC_SUPER_decl = build_decl (input_location, + VAR_DECL, get_identifier (TAG_SUPER), objc_super_template); /* This prevents `unused variable' warnings when compiling with -Wall. */ TREE_USED (UOBJC_SUPER_decl) = 1; lang_hooks.decls.pushdecl (UOBJC_SUPER_decl); - finish_decl (UOBJC_SUPER_decl, NULL_TREE, NULL_TREE, NULL_TREE); + finish_decl (UOBJC_SUPER_decl, input_location, NULL_TREE, NULL_TREE, + NULL_TREE); UOBJC_SUPER_scope = objc_get_current_scope (); } /* Set receiver to self. */ super_expr = objc_build_component_ref (UOBJC_SUPER_decl, self_id); super_expr = build_modify_expr (input_location, super_expr, NULL_TREE, - NOP_EXPR, self_decl, NULL_TREE); + NOP_EXPR, input_location, self_decl, + NULL_TREE); super_expr_list = super_expr; /* Set class to begin searching. */ @@ -8775,6 +8824,7 @@ get_super_receiver (void) super_expr = build_modify_expr (input_location, super_expr, NULL_TREE, NOP_EXPR, + input_location, ((TREE_CODE (objc_method_context) == INSTANCE_METHOD_DECL) ? ucls_super_ref @@ -8807,7 +8857,8 @@ get_super_receiver (void) super_class = build_indirect_ref (input_location, - build_c_cast (build_pointer_type (objc_class_type), + build_c_cast (input_location, + build_pointer_type (objc_class_type), super_class), "unary *"); } else @@ -8818,7 +8869,8 @@ get_super_receiver (void) assemble_external (super_class); super_class = build_function_call - (super_class, + (input_location, + super_class, build_tree_list (NULL_TREE, my_build_string_pointer @@ -8829,16 +8881,20 @@ get_super_receiver (void) super_expr = build_modify_expr (input_location, super_expr, NULL_TREE, NOP_EXPR, - build_c_cast (TREE_TYPE (super_expr), + input_location, + build_c_cast (input_location, + TREE_TYPE (super_expr), super_class), NULL_TREE); } - super_expr_list = build_compound_expr (super_expr_list, super_expr); + super_expr_list = build_compound_expr (input_location, + super_expr_list, super_expr); super_expr = build_unary_op (input_location, ADDR_EXPR, UOBJC_SUPER_decl, 0); - super_expr_list = build_compound_expr (super_expr_list, super_expr); + super_expr_list = build_compound_expr (input_location, + super_expr_list, super_expr); return super_expr_list; } @@ -9350,7 +9406,8 @@ handle_class_ref (tree chain) #endif /* Make a decl for this name, so we can use its address in a tree. */ - decl = build_decl (VAR_DECL, get_identifier (string), char_type_node); + decl = build_decl (input_location, + VAR_DECL, get_identifier (string), char_type_node); DECL_EXTERNAL (decl) = 1; TREE_PUBLIC (decl) = 1; @@ -9361,7 +9418,8 @@ handle_class_ref (tree chain) sprintf (string, "%sobjc_class_ref_%s", (flag_next_runtime ? "." : "__"), name); exp = build1 (ADDR_EXPR, string_type_node, decl); - decl = build_decl (VAR_DECL, get_identifier (string), string_type_node); + decl = build_decl (input_location, + VAR_DECL, get_identifier (string), string_type_node); DECL_INITIAL (decl) = exp; TREE_STATIC (decl) = 1; TREE_USED (decl) = 1; @@ -9421,7 +9479,8 @@ handle_impent (struct imp_entry *impent) tree decl, init; init = build_int_cst (c_common_type_for_size (BITS_PER_WORD, 1), 0); - decl = build_decl (VAR_DECL, get_identifier (string), TREE_TYPE (init)); + decl = build_decl (input_location, + VAR_DECL, get_identifier (string), TREE_TYPE (init)); TREE_PUBLIC (decl) = 1; TREE_READONLY (decl) = 1; TREE_USED (decl) = 1; |