[PATCH] Delete EXPR_LOCUS

Eric Botcazou ebotcazou@adacore.com
Thu Apr 23 20:43:00 GMT 2009


Hi,

this patch removes EXPR_LOCUS and all traces of indirection from the source 
location business.  This means changing the signature of the 'H' specifier 
from location_t* to location_t, hence a few warnings during stage #1.

Tested on x86_64-suse-linux, OK for mainline?


2009-04-23  Eric Botcazou  <ebotcazou@adacore.com>

	* builtins.c (fold_call_expr): Do not test CAN_HAVE_LOCATION_P.
	* c-common.c (c_do_switch_warnings): Pass locations directly.
	* c-decl.c (undeclared_variable, define_label, pending_xref_error,
	store_parm_decls_oldstyle): Likewise.
	* c-format.c (init_dynamic_diag_info): Do not use indirection for 'H'.
	* c-lex.c (cb_def_pragma): Pass locations directly.
	(c_lex_with_flags): Likewise.
	* c-typeck.c (build_unary_op): Do not test EXPR_P.
	(c_finish_if_stmt): Pass locations directly.
	(emit_side_effect_warnings): Use EXPR_LOCATION in lieu of EXPR_LOCUS.
	(c_finish_stmt_expr): Likewise.
	* fold-const.c (fold_undefer_overflow_warnings): Pass locations
	directly.
	* gimplify.c (internal_get_tmp_var): Use EXPR_LOCATION in lieu of
	EXPR_LOCUS.
	(gimplify_call_expr): Likewise.
	(omp_notice_variable): Pass locations directly.
	(gimplify_one_sizepos): Use EXPR_LOCATION in lieu of EXPR_LOCUS.
	* pretty-print.c (pp_base_format) <'H'>: Remove indirection.
	* stmt.c (warn_if_unused_value) <warn>: Pass locations directly.
	* tree-cfg.c (remove_useless_stmts_warn_notreached): Likewise.
	(remove_bb): Likewise.
	(execute_warn_function_return): Likewise.
	* tree-ssa-loop-niter.c (number_of_iterations_exit): Likewise.
	* tree-vrp.c (vrp_evaluate_conditional): Likewise.
	(simplify_div_or_mod_using_ranges): Likewise.
	(simplify_abs_using_ranges): Likewise.
	* tree.c (set_expr_locus): Delete.
	* tree.h (set_expr_locus): Likewise.
	(EXPR_LOCUS, SET_EXPR_LOCUS): Likewise.
	* value-prof.c (check_counter): Likewise.
ada/
	* gcc-interface/trans.c (gnat_to_gnu): Use CAN_HAVE_LOCATION_P.
	(gnat_gimplify_expr): Use EXPR_LOCATION in lieu of EXPR_LOCUS.
cp/
	* decl.c (identify_goto): Change LOCUS type.
	(check_previous_goto_1): Likewise.
	(check_previous_goto): Pass locations directly.
	(check_switch_goto): Likewise.
	* except.c (check_handlers_1): Likewise.
	(check_handlers): Likewise.
	* parser.c (cp_parser_error, cp_parser_name_lookup_error,
	cp_parser_check_decl_spec, cp_parser_check_for_definition_in_return,
	cp_parser_check_for_invalid_template_id,
	cp_parser_diagnose_invalid_type_name,
	cp_parser_string_literal, cp_parser_primary_expression,
	cp_parser_unqualified_id, cp_parser_nested_name_specifier_opt,
	cp_parser_postfix_dot_deref_expression, cp_parser_new_expression,
	cp_parser_direct_new_declarator, cp_parser_binary_expression,
	cp_parser_label_for_labeled_statement, cp_parser_statement_seq_opt,
	cp_parser_selection_statement, cp_parser_jump_statement,
	cp_parser_block_declaration, cp_parser_simple_declaration,
	cp_parser_decl_specifier_seq, cp_parser_function_specifier_opt,
	cp_parser_mem_initializer_list, cp_parser_mem_initializer_id,
	cp_parser_template_parameter, cp_parser_type_parameter,
	cp_parser_template_id, cp_parser_template_name,
	cp_parser_template_argument_list, cp_parser_explicit_specialization,
	cp_parser_namespace_name, cp_parser_namespace_alias_definition,
	cp_parser_using_declaration, cp_parser_init_declarator,
	cp_parser_direct_declarator, cp_parser_ptr_operator,
	cp_parser_cv_qualifier_seq_opt, cp_parser_parameter_declaration,
	cp_parser_class_name, cp_parser_class_head,
	cp_parser_member_declaration, cp_parser_pure_specifier,
	cp_parser_base_specifier, cp_parser_lookup_name,
	cp_parser_check_template_parameters,
	cp_parser_function_definition_after_decl,
	cp_parser_template_declaration_after_exp, cp_parser_single_declaration,
	cp_parser_enclosed_template_argument_lis, cp_parser_set_storage_class,
	cp_parser_check_access_in_redeclaration,
	cp_parser_optional_template_keyword, cp_parser_objc_expression,
	cp_parser_objc_encode_expression, cp_parser_objc_selector,
	cp_parser_objc_protocol_declaration, cp_parser_objc_declaration,
	cp_parser_objc_statement, check_no_duplicate_clause,
	cp_parser_omp_clause_collapse, cp_parser_omp_clause_schedule,
	cp_parser_omp_all_clauses,
	cp_parser_omp_for_loop, cp_parser_initial_pragma cp_parser_pragma):
	Likewise.
	* semantics.c (qualified_name_lookup_error): Likewise.
	(finalize_nrv_r): Use EXPR_LOCATION in lieu of EXPR_LOCUS.
	(handle_omp_for_class_iterator): Pass locations directly.
	(finish_omp_for): Likewise.
java/
	* jcf-parse.c (duplicate_class_warning): Likewise.
objc/
	* objc-act.c (build_selector_translation_table): Likewise.  Use
	EXPR_LOCATION in lieu of EXPR_LOCUS.
testsuite/
	* gcc.dg/format/gcc_diag-1.c: Adjust for new spec of 'H'.


-- 
Eric Botcazou
-------------- next part --------------
A non-text attachment was scrubbed...
Name: delete_locus.diff
Type: text/x-diff
Size: 70325 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20090423/b60c9609/attachment.bin>


More information about the Gcc-patches mailing list