aboutsummaryrefslogtreecommitdiff
path: root/gcc/objc
diff options
context:
space:
mode:
authorAldy Hernandez <aldyh@redhat.com>2009-06-12 22:06:47 +0000
committerAldy Hernandez <aldyh@gcc.gnu.org>2009-06-12 22:06:47 +0000
commitc2255bc4884a7624b32185e188fdb94a4167a35c (patch)
tree67f495ddc3964a90084152e177995da72e7bce30 /gcc/objc
parent312243969e3a0022c0eabe6f974c24abd4a2211b (diff)
downloadgcc-c2255bc4884a7624b32185e188fdb94a4167a35c.zip
gcc-c2255bc4884a7624b32185e188fdb94a4167a35c.tar.gz
gcc-c2255bc4884a7624b32185e188fdb94a4167a35c.tar.bz2
java-gimplify.c (java_gimplify_block): New argument to build_empty_stmt.
gcc/java/ * java-gimplify.c (java_gimplify_block): New argument to build_empty_stmt. * expr.c (force_evaluation_order): Same. * typeck.c: Add location to build_decl or PUSH_FIELD calls. * class.c: Same. * decl.c: Same. * jcf-parse.c: Same. * constants.c: Same. * resource.c: Same. * except.c: Same. * builtins.c: Same. * expr.c: Same. * java-tree.h (PUSH_FIELD): Add location field. gcc/objc/ * objc-act.c (finish_var_decl): Pass location to finish_decl. (objc_get_parm_info): Same. (get_super_receiver): Same. * objc-act.c (objc_build_component_ref): Pass location to build_compound_ref. (build_module_initializer_routine): Pass location to c_end_compound_stmt. (objc_generate_static_init_call): Pass location to build_stmt. (build_typed_selector_reference): New location argument. (build_selector_reference): Same. (objc_substitute_decl): Pass location to build_array_ref. (next_sjlj_build_try_catch_finally): Pass location to build_stmt. (objc_begin_catch_clause): Same. (objc_finish_try_stmt): Same. (objc_finish_catch_clause): Pass location to c_end_compound_stmt. (objc_build_throw_stmt): New argument. (generate_shared_structures): Pass location to build_c_cast. (objc_build_message_expr): Use local location. (objc_finish_message_expr): Use input_location. (build_objc_method_call): New argument. (objc_build_selector_expr): Same. (get_super_receiver): Pass location to build_c_cast, build_modify_expr, build_compound_expr. * objc-act.c: Add location to all calls to start_struct, build_decl, finish_struct. gcc/ * tree-pretty-print.c (dump_generic_node): Dump column numbers. * gimple-pretty-print.c (dump_gimple_stmt): Same. * gimplify.c (gimplify_modify_expr): Set location for GIMPLE_ASSIGNs created. * c-parser.c (c_parser_binary_expression): Use current column while building binary operations. * common.opt (fshow-column): Enable by default. * tree-vrp.c (check_array_ref): Use warning_at. (check_array_bounds): Use location from call back if expr has no location. * tree.h: Add location argument to maybe_fold_*. * tree-ssa-ccp.c (ccp_fold): Pass location to maybe_fold_*. (maybe_fold_offset_to_array_ref): Add location argument and use it. (maybe_fold_offset_to_component_ref): Same. (maybe_fold_offset_to_reference): Same. (maybe_fold_offset_to_address): Same. (maybe_fold_stmt_indirect): Same. (maybe_fold_stmt_addition): Same. (fold_stmt_r): Pass location to maybe_fold_*. (fold_gimple_assign): Same. * c-tree.h: Add location argument to finish_decl, default_function_array_conversion, store_init_value. * c-decl.c (define_label): Use error_at. (c_make_fname_decl): Pass location to finish_decl. (finish_decl): New location argument. (build_compound_literal): Pass location to store_init_value. (grokdeclarator): Pass location to finish_decl. (grokfield): Same. * c-typeck.c (array_to_pointer_conversion): New location argument. (function_to_pointer_conversion): Same. (default_function_array_conversion): Same. (parser_build_unary_op): Pass location to overflow_warning. (parser_build_binary_op): Same. Use warning_at. (build_unary_op): Pass location to array_to_pointer_conversion. (build_c_cast): Pass location to digest_init. (build_modify_expr): New location argument. (convert_for_assignment): Same. (store_init_value): Same. (digest_init): Same. (output_init_element): Pass location to digest_init and array_to_pointer_conversion. (c_finish_return): Pass location to convert_for_assignment. * gimplify.c (gimplify_conversion): Pass location to maybe_fold_offset_to_address. * tree-ssa-forwprop.c (forward_propagate_addr_expr_1): Pass location to maybe_fold_stmt_addition. * c-omp.c (c_finish_omp_atomic): Pass new location to build_modify_expr. (c_finish_omp_for): Same. * c-common.c (overflow_warning): New argument. * c-common.h: New argument to build_modify_expr, overflow_warning. * c-parser.c (c_parser_declaration_or_fndef): Pass location to finish_decl. (c_parser_initializer): Pass location to default_function_array_conversion. (c_parser_initelt): Same. (c_parser_initval): Same. (c_parser_asm_operands): Same. (c_parser_expr_no_commas): Same. Pass location to build_modify_expr. (c_parser_conditional_expression): Same. (c_parser_binary_expression): Add location info to stack. Use it. (c_parser_unary_expression): Pass location to default_function_array_conversion, parser_build_unary_op, build_indirect_ref, c_parser_postfix_expression_after_primary. (c_parser_postfix_expression_after_primary): New location argument. Use it. (c_parser_expression_conv): Pass location to default_function_array_conversion. (c_parser_expr_list): Same. (c_parser_omp_atomic): Same. (c_parser_omp_for_loop): Same. * c-tree.h: (struct c_declarator): Add comment to id_loc. (build_array_declarator): New argument. * c-decl.c (build_array_declarator): Add location argument. (grokdeclarator): Set id_loc for cdk_array. * c-parser.c (c_parser_direct_declarator_inner): Pass location to build_array_declarator. * tree.c (build_omp_clause): Add location argument. * tree.h (OMP_CLAUSE_HAS_LOCATION): New macro. (OMP_CLAUSE_LOCATION): New macro. (struct tree_omp_clause): Add location field. (build_omp_clause): Add argument. * testsuite/gcc.dg/gomp/for-1.c: Fix column. * cp/pt.c (tsubst_omp_for_iterator): Pass location to build_omp_clause. * cp/parser.c (cp_parser_omp_var_list_no_open): Same. (cp_parser_omp_clause_collapse): Same. (cp_parser_omp_clause_default): Same. (cp_parser_omp_clause_if): Same. (cp_parser_omp_clause_nowait): Same. (cp_parser_omp_clause_num_threads): Same. (cp_parser_omp_clause_ordered): Same. (cp_parser_omp_clause_schedule): Same. (cp_parser_omp_clause_untied): Same. (cp_parser_omp_for_loop): Same. (cp_parser_omp_parallel): Pass location to c_split_parallel_clauses. * c-tree.h (c_start_case): Add location argument. (c_process_expr_stmt): Same. (c_finish_goto_*): Same. * tree-parloops.c (initialize_reductions): Pass location to build_omp_clause. (create_parallel_loop): Same. * fortran/trans-openmp.c (gfc_trans_omp_variable_list): Same. (gfc_trans_omp_reduction_list): Same. (gfc_trans_omp_clauses): Same. (gfc_trans_omp_do): Same. * c-typeck.c (c_finish_goto_label): Same. (c_finish_goto_ptr): New location argument. (c_start_case): Same. (emit_side_effect_warnings): Same. (c_process_expr_stmt): Same. (c_finish_stmt_expr): Same. (c_finish_omp_clauses): Use error_at instead of error. * gimplify.c (gimplify_adjust_omp_clauses_1): Pass location to build_omp_clause. * c-omp.c (c_split_parallel_clauses): New location argument. * tree-nested.c (convert_nonlocal_reference_stmt): Pass location to build_omp_clause. (convert_local_reference_stmt): Same. (convert_gimple_call): Same. * c-common.h (c_split_parallel_clauses): New argument. * c-parser.c (c_parser_statement_after_labels): Pass location to c_finish_goto_label. (c_parser_switch_statement): Pass location to c_start_case. (c_parser_for_statement): Pass location to c_finish_expr_stmt, and c_process_expr_stmt. (c_parser_omp_variable_list): Add location argument. (c_parser_omp_clause_collapse): Pass location to build_omp_clause. (c_parser_omp_clause_default): Same. (c_parser_omp_clause_if): Same. (c_parser_omp_clause_num_threads): Same. (-c_parser_omp_clause_ordered): Same. (c_parser_omp_clause_reduction): Pass location to c_parser_omp_variable_list. (c_parser_omp_clause_schedule): Pass location to build_omp_clause. (c_parser_omp_clause_untied): Same. (c_parser_omp_for_loop): Pass location to c_process_expr_stmt. (c_parser_omp_parallel): Pass location to c_split_parallel_clauses. * c-tree.h (check_for_loop_decls, undeclared_variable, build_component_ref, build_array_ref, build_external_ref, c_expr_sizeof_expr, c_expr_sizeof_type, parser_build_unary_op, build_conditional_expr, build_compound_expr, c_cast_expr, build_c_cast, build_asm_expr, c_end_compound_stmt, c_finish_stmt_expr, c_finish_return, c_finish_omp_parallel, c_finish_omp_task): New argument. * c-semantics.c (build_stmt): Same. (build_case_label): Same. * c-decl.c (c_finish_incomplete_decl): Pass location on down. (undeclared_variable): New argument. (make_label): Same. (lookup_label): Pass location on down. (define_label): Same. (finish_decl): Same. (build_compound_literal): Same. (finish_struct): Same. (finish_function): Do not set location here. (check_for_loop_decls): New argument. * tree.c (save_expr): Set location. (build_empty_stmt): New argument. * tree.h (build_empty_stmt): New argument to build_empty_stmt. (CAN_HAVE_LOCATION_P): Make sure we have a non empty node. * builtins.c (gimplify_va_arg_expr): Use locations. (expand_builtin_sync_operation): Same. * c-typeck.c (build_component_ref): New argument. (build_array_ref): Same. (build_external_ref): Same. (c_expr_sizeof_expr): Same. (c_expr_sizeof_type): Same. (parser_build_unary_op): Same. (build_conditional_expr): Same. (build_compound_expr): Pass location on down. (build_compound_expr): New argument. (build_c_cast): Same. (c_cast_expr): Same. (build_asm_expr): Same. (c_finish_return): Same. (c_process_expr_stmt): Pass location on down. (c_finish_stmt_expr): New argument. (push_clenaup): Same. (c_finish_omp_parallel): Same. (c_finish_omp_task): Same. * gimplify.c (gimplify_call_expr): Pass location on down. * c-omp.c (c_finish_omp_master): New argument. (c_finish_omp_critical): Same. (c_finish_omp_ordered): Same. (c_finish_omp_barrier): Same. (-c_finish_omp_taskwait): Same. (c_finish_omp_atomic): Same. (c_finish_omp_flush): Same. * tree-inline.c (copy_tree_body_r): Pass location on down. (inline_forbidden_p): Remove use of input_location. * c-gimplify.c (c_build_bind_expr): New argument. * c-common.c (c_common_truthvalue_conversion): Pass location on down. (c_sizeof_or_alignof_type): New argument. (c_alignof_expr): Same. (build_va_arg): Same. (c_add_case_label): Same. * c-common.h (c_sizeof_or_alignof_type, c_alignof_expr, c_sizeof, c_alignof, build_va_arg, build_stmt, build_case_label, c_build_bind_expr, objc_build_selector_expr, objc_build_throw_stmt, c_finish_omp_master, c_finish_omp_critical, c_finish_omp_ordered, c_finish_omp_barrier, c_finish_omp_atomic, c_finish_omp_flush, c_finish_omp_taskwait, c_finish_omp_for, c_split_parallel_clauses): New argument. * stub-objc.c (objc_build_selector_expr): Same. (objc_build_throw_stmt): Same. * c-parser.c (c_parser_declaration_or_fndef): Pass location on down. (c_parser_initelt): Same. (c_parser_compound_statement): Same. (c_parser_compound_statement_nostart): Same. (c_parser_label): Same. (c_parser_statement_after_labels): Same. (c_parser_if_body): Same. (c_parser_else_body): Same. (c_parser_if_statement): Same. (c_parser_switch_statement): Same. (c_parser_while_statement): Same. (c_parser_do_statement): Same. (c_parser_for_statement): Same. (c_parser_asm_statement): Same. (c_parser_conditional_expression): Same. (c_parser_binary_expression): Same. (c_parser_cast_expression): Same. (c_parser_unary_expression): Same. (c_parser_sizeof_expression): Same. (c_parser_alignof_expression): Same. (c_parser_postfix_expression): Same. (c_parser_expression): Same. (c_parser_objc_receiver): Same. (c_parser_omp_variable_list): Same. (c_parser_omp_structured_block): Same. (c_parser_omp_atomic): New argument. (c_parser_omp_barrier): Same. (c_parser_omp_critical): Same. (c_parser_omp_flush): Pass location on down. (c_parser_omp_for_loop): New argument. (c_parser_omp_for): Same. (c_parser_omp_master): Same. (c_parser_omp_ordered): Same. (c_parser_omp_sections_scope): Same. (c_parser_omp_sections): Same. (c_parser_omp_parallel): Same. (c_parser_omp_single): Same. (c_parser_omp_task): Same. (c_parser_omp_taskwait): Pass location on down. (c_parser_omp_construct): Same. (c_parser_omp_threadprivate): Same. * dwarf2asm.c, targhooks.c, optabs.c, tree.c, tree.h, target.h, builtins.c, omp-low.c, cgraphunit.c, tree-call-cdce.c, tree-ssa-alias.c, gimple-low.c, c-tree.h, expr.c, tree-parloops.c, c-decl.c, tree-eh.c, langhooks.c, function.c, stor-layout.c, c-typeck.c, gimplify.c, c-pragma.c, expmed.c, except.c, coverage.c, emit-rtl.c, cfgexpand.c, tree-mudflap.c, varasm.c, tree-nested.c, rtl.h, tree-inline.c, tree-profile.c, c-common.c, c-common.h, tree-switch-conversion.c, tree-cfg.c, ipa-struct-reorg.c, c-parser.c, config/i386/i386.c, stmt.c: Add location argument to the following function definitions and/or function calls: build_decl, objcp_start_struct, objcp_finish_struct, start_struct, finish_struct, PUSH_FIELD, create_artificial_label, cp_make_fname_decl, pushtag, implicitly_declare, c_make_fname_decl, build_compound_literal, parser_xref_tag, resolve_overloaded_builtin, do_case, c_finish_bc_stmt, build_compound_literal, build_function_call. * c-decl.c (build_compound_literal): Add location argument. Make all diagnostic calls use location. (start_struct): Same. (finish_struct): Same. (start_enum): Same. (build_enumerator): Same. (start_function): Same. (grokdeclarator): Make all diagnostic calls use location. (store_parm_decls_oldstyle): Same. * c-typeck.c (build_function_call): Add location argument. Make all diagnostic calls use location. (do_case): Same. (c_finish_bc_stmt): Same. * tree-nested.c (get_trampoline_type): Add argument. Pass location to build_decl. (lookup_tramp_for_decl): Pass location to get_trampoline_type. * rtl.h (RTL_LOCATION): New. * c-common.c (c_add_case_label): Add location argument. Make all diagnostic calls use location. * c-common.h: Add location argument to make_fname_decl, do_case, c_add_case_label, build_function_call, resolve_overloaded_builtin. * c-parser.c (c_parser_enum_specifier): Rename ident_loc to enum_loc. Set it appropriately for every case. Pass enum_loc to start_enum call. Pass value_loc first to build_enumerator. Pass enum_loc to parser_xref_tag. (c_parser_struct_or_union_specifier): Save location. Use it for start_struct, finish_struct, and parser_xref_tag. gcc/testsuite/ * gcc.dg/old-style-prom-3.c: Add column info. * gcc.dg/overflow-warn-1.c * gcc.dg/gomp/pr27415.c * gcc.dg/gomp/for-1.c: Same. * gcc.dg/enum-compat-1.c: Same. * gcc.dg/c99-tag-3.c: Same. * gcc.dg/Wredundant-decls-2.c: Same. * gcc.dg/func-ptr-conv-1.c: Same. * gcc.dg/asm-wide-1.c: Same. * gcc.dg/nofixed-point-2.c: Same. * gcc.dg/cpp/line3.c: Same. * gcc.dg/array-10.c: Same. * gcc.dg/c99-vla-jump-1.c: Same. * gcc.dg/pr20368-1.c: Same. * gcc.dg/Wshadow-3.c: Same. * gcc.dg/c90-const-expr-8.c: Same. * gcc.dg/label-decl-2.c: Same. * gcc.dg/dremf-type-compat-2.c: Same. * gcc.dg/c90-const-expr-5.c: Same. * gcc.dg/builtins-30.c: Same. * gcc.dg/Warray-bounds.c: Same. * gcc.dg/Wcxx-compat-2.c: Same. * gcc.dg/tree-ssa/col-1.c: Same. * gcc.dg/old-style-prom-2.c: Same. * gcc.dg/cast-function-1.c: Same. * gcc.dg/pr15698-1.c: Same. * gcc.dg/dremf-type-compat-3.c: Same. * gcc.dg/vla-8.c: Same. * gcc.dg/gomp/pr27415.c: Move firstprivate diagnostics to correct line. * gcc.dg/label-decl-2.c: Move label diagnostic to correct line. * gcc.dg/old-style-prom-3.c: Check for error on the correct line. * gcc.dg/enum-compat-1.c: Same. * gcc.dg/dremf-type-compat-2.c: Same. * gcc.dg/old-style-prom-2.c: Same. * gcc.dg/pr15698-1.c: Same. * gcc.dg/pr20368-1.c: Same. * gcc.dg/dremf-type-compat-3.c: Same. * gcc.dg/builtins-30.c: Same. Test for columns. gcc/objcp/ * objcp-decl.h (c_end_compound_stmt): New argument. * objcp-decl.c (objcp_start_struct): Add argument. (objcp_finish_struct): Same. gcc/cp/ * typeck.c (cp_build_binary_op): Pass location to overflow_warning. (build_modify_expr): New arg. * semantics.c (finish_unary_op_expr): Pass location to overflow_warning. (handle_omp_for_class_iterator): Pass location to build_modify_expr. * typeck.c (cxx_sizeof_or_alignof_type): Pass location to c_sizeof_or_alignof_type. (build_array_ref): New argument. (build_compound_expr): Same. (build_const_cast): Same. (build_ptrmemfunc): Pass location to build_c_cast. * init.c (avoid_placement_new_aliasing): Pass location to build_stmt. (build_vec_delete_1): Pass location to cp_build_modify_expr, build_compound_expr. * class.c (build_vtbl_ref_1): Pass location to build_array_ref. * decl.c (poplevel): Pass location to c_build_bind_expr. (finish_case_label): Pass location to build_case_label. (finish_constructor_body): Same. (finish_destructor_body): Pass location to build_stmt. (cxx_maybe_build_cleanup): Same, but to build_compound_expr. * call.c (build_new_op): Pass location to build_array_ref. (build_x_va_arg): Pass location to build_va_arg. * except.c (expand_end_catch_block): Pass location to build_stmt. * cp-tree.h (build_array_ref): New argument. (build_compound_expr): Same. (build_c_cast): Same. * cp-gimplify.c (gimplify_if_stmt): Pass location on down. (gimplify_switch_stmt): Same. * typeck2.c (split_nonconstant_init_1): Same. * pt.c (tsubst_copy): Same. * semantics.c (add_decl_expr): Same. (do_poplevel): Same. (push_cleanup): Same. (finish_goto_stmt): Same. (finish_expr_stmt): Same. (begin_if_stmt): Same. (begin_while_stmt): Same. (begin_do_stmt): Same. (finish_return_stmt): Same. (begin_for_stmt): Same. (finish_break_stmt): Same. (finish_continue_stmt): Same. (begin_switch_stmt): Same. (begin_try_block): Same. (begin_handler): Same. (finish_asm_stmt): Same. (finish_label_stmt): Same. (finish_stmt_expr_expr): Same. (finalize_nrv_r): Same. (finish_omp_atomic): Same. * name-lookup.c (do_using_directive): Same. * decl2.c (grok_array_decl): Same. * parser.c (cp_parser_cast_expression): Same. (cp_parser_selection_statement): Same. (cp_parser_implicitly_scoped_statement): Same. (cp_parser_objc_selector_expression): Same. (cp_parser_objc_synchronized_statement): Same. (cp_parser_objc_throw_statement): Same. (cp_parser_omp_critical): Same. (cp_parser_omp_master): Same. * typeck.c (build_function_call): Add location argument. * init.c: Add location argument to all build_decl calls. * class.c: Same. * method.c: Same. * rtti.c: Same. * tree.c: Same. * pt.c: Same. * semantics.c: Same. * lex.c: Same. * decl2.c: Same. * cp-gimplify.c: Same. * decl.c: Same. (cp_make_fname_decl): Add location argument. Pass location ot build_decl. (finish_case_label): Same. * cp-tree.h (finish_case_label): Add location argument. * parser.c (cp_parser_label_for_labeled_statement): Pass location to finish_case_label. gcc/fortran/ * trans-array.c (gfc_trans_allocate_array_storage): Pass location on down. (gfc_trans_array_constructor_value): Same. (gfc_trans_scalarized_loop_end): Same. (gfc_conv_ss_startstride): Same. (gfc_trans_g77_array): Same. (gfc_trans_dummy_array_bias): Same. (gfc_conv_array_parameter): Same. (structure_alloc_comps): Same. * trans-expr.c (gfc_conv_function_call): Same. (fill_with_spaces): Same. (gfc_trans_string_copy): Same. (gfc_trans_scalar_assign): Same. * trans-stmt.c (gfc_trans_goto): Same. (gfc_trans_if_1): Same. (gfc_trans_simple_do): Same. (gfc_trans_do): Same. (gfc_trans_do_while): Same. (gfc_trans_logical_select): Same. (gfc_trans_select): Same. (gfc_trans_forall_loop): Same. (gfc_trans_nested_forall_loop): Same. (generate_loop_for_temp_to_lhs): Same. (generate_loop_for_rhs_to_temp): Same. (gfc_trans_forall_1): Same. (gfc_trans_where_assign): Same. (gfc_trans_where_3): Same. (gfc_trans_allocate): Same. * trans.c (gfc_finish_block): Same. (gfc_trans_runtime_check): Same. (gfc_call_malloc): Same. (gfc_allocate_with_status): Same. (gfc_call_free): Same. (gfc_deallocate_with_status): Same. (gfc_call_realloc): Same. (gfc_trans_code): Same. * trans-decl.c (gfc_init_default_dt): Same. (gfc_generate_constructors): Same. * trans-io.c (gfc_trans_io_runtime_check): Same. * trans-intrinsic.c (gfc_conv_intrinsic_ctime): Same. (gfc_conv_intrinsic_fdate): Same. (gfc_conv_intrinsic_ttynam): Same. (gfc_conv_intrinsic_minmax): Same. (gfc_conv_intrinsic_minmax_char): Same. (gfc_conv_intrinsic_anyall): Same. (gfc_conv_intrinsic_count): Same. (gfc_conv_intrinsic_arith): Same. (gfc_conv_intrinsic_minmaxloc): Same. (gfc_conv_intrinsic_minmaxval): Same. (gfc_conv_intrinsic_rrspacing): Same. (gfc_conv_intrinsic_array_transfer): Same. (gfc_conv_intrinsic_trim): Same. (gfc_conv_intrinsic_repeat): Same. From-SVN: r148442
Diffstat (limited to 'gcc/objc')
-rw-r--r--gcc/objc/ChangeLog28
-rw-r--r--gcc/objc/objc-act.c253
2 files changed, 184 insertions, 97 deletions
diff --git a/gcc/objc/ChangeLog b/gcc/objc/ChangeLog
index 110c1a0..5aaa3b7 100644
--- a/gcc/objc/ChangeLog
+++ b/gcc/objc/ChangeLog
@@ -1,3 +1,31 @@
+2009-06-12 Aldy Hernandez <aldyh@redhat.com>
+
+ * objc-act.c (finish_var_decl): Pass location to finish_decl.
+ (objc_get_parm_info): Same.
+ (get_super_receiver): Same.
+ * objc-act.c (objc_build_component_ref): Pass location to
+ build_compound_ref.
+ (build_module_initializer_routine): Pass location to
+ c_end_compound_stmt.
+ (objc_generate_static_init_call): Pass location to build_stmt.
+ (build_typed_selector_reference): New location argument.
+ (build_selector_reference): Same.
+ (objc_substitute_decl): Pass location to build_array_ref.
+ (next_sjlj_build_try_catch_finally): Pass location to build_stmt.
+ (objc_begin_catch_clause): Same.
+ (objc_finish_try_stmt): Same.
+ (objc_finish_catch_clause): Pass location to c_end_compound_stmt.
+ (objc_build_throw_stmt): New argument.
+ (generate_shared_structures): Pass location to build_c_cast.
+ (objc_build_message_expr): Use local location.
+ (objc_finish_message_expr): Use input_location.
+ (build_objc_method_call): New argument.
+ (objc_build_selector_expr): Same.
+ (get_super_receiver): Pass location to build_c_cast,
+ build_modify_expr, build_compound_expr.
+ * objc-act.c: Add location to all calls to start_struct, build_decl,
+ finish_struct.
+
2009-06-09 Ian Lance Taylor <iant@google.com>
* objc-act.c (objc_gimplify_expr): Change return type to int.
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;