Commit 582f770b by Uros Bizjak

diagnostic.c (build_message_string): Use xvasprintf.

	* diagnostic.c (build_message_string): Use xvasprintf.
	* final.c (output_operand_lossage): Use xvasprintf and xasprintf.
	* lto-wrapper.c (merge_and_complain): Use xasprintf.
	* targhooks.c (pch_option_mismatch): Ditto.
	* tree-ssa-structalias.c (create_function_info_for): Ditto.
	(create_variable_info_for_1): Ditto.

From-SVN: r219122
parent ec5f0102
2014-12-31 Uros Bizjak <ubizjak@gmail.com>
* diagnostic.c (build_message_string): Use xvasprintf.
* final.c (output_operand_lossage): Use xvasprintf and xasprintf.
* lto-wrapper.c (merge_and_complain): Use xasprintf.
* targhooks.c (pch_option_mismatch): Ditto.
* tree-ssa-structalias.c (create_function_info_for): Ditto.
(create_variable_info_for_1): Ditto.
2014-12-30 Anthony Green <green@moxielogic.com> 2014-12-30 Anthony Green <green@moxielogic.com>
* config/moxie/moxie.md (zero_extendqisi2, zero_extendhisi2): * config/moxie/moxie.md (zero_extendqisi2, zero_extendhisi2):
...@@ -147,8 +156,8 @@ ...@@ -147,8 +156,8 @@
2014-12-22 Martin Liska <mliska@suse.cz> 2014-12-22 Martin Liska <mliska@suse.cz>
* cgraphunit.c (symbol_table::process_new_functions): New inline_summaries * cgraphunit.c (symbol_table::process_new_functions): New
is used. inline_summaries is used.
* ipa-cp.c (ipcp_cloning_candidate_p): Likewise. * ipa-cp.c (ipcp_cloning_candidate_p): Likewise.
(devirtualization_time_bonus): Likewise. (devirtualization_time_bonus): Likewise.
(estimate_local_effects): Likewise. (estimate_local_effects): Likewise.
...@@ -223,8 +232,8 @@ ...@@ -223,8 +232,8 @@
is used. is used.
* ipa-polymorphic-call.c: Include of symbol-summary.h is added. * ipa-polymorphic-call.c: Include of symbol-summary.h is added.
* ipa-profile.c: Include of symbol-summary.h is added. * ipa-profile.c: Include of symbol-summary.h is added.
* ipa-prop.c (ipa_propagate_indirect_call_infos): New ipa_node_params_sum * ipa-prop.c (ipa_propagate_indirect_call_infos): New
data structure is used. ipa_node_params_sum data structure is used.
(ipa_node_params::~ipa_node_params): New function. (ipa_node_params::~ipa_node_params): New function.
(ipa_free_all_node_params): Destruction is simplified. (ipa_free_all_node_params): Destruction is simplified.
(ipa_node_removal_hook): Removed. (ipa_node_removal_hook): Removed.
...@@ -777,8 +786,7 @@ ...@@ -777,8 +786,7 @@
(parser::parse_pattern): Properly allocate capture_ids before (parser::parse_pattern): Properly allocate capture_ids before
using them. Set capture_ids to zero when its lifetime is using them. Set capture_ids to zero when its lifetime is
supposed to finish. supposed to finish.
(parser::parse_simplify): Allocate capture_ids only if (parser::parse_simplify): Allocate capture_ids only if required.
required.
2014-12-16 Michael Haubenwallner <michael.haubenwallner@ssi-schaefer.com> 2014-12-16 Michael Haubenwallner <michael.haubenwallner@ssi-schaefer.com>
...@@ -70,7 +70,7 @@ build_message_string (const char *msg, ...) ...@@ -70,7 +70,7 @@ build_message_string (const char *msg, ...)
va_list ap; va_list ap;
va_start (ap, msg); va_start (ap, msg);
vasprintf (&str, msg, ap); str = xvasprintf (msg, ap);
va_end (ap); va_end (ap);
return str; return str;
......
...@@ -3420,8 +3420,8 @@ output_operand_lossage (const char *cmsgid, ...) ...@@ -3420,8 +3420,8 @@ output_operand_lossage (const char *cmsgid, ...)
va_start (ap, cmsgid); va_start (ap, cmsgid);
pfx_str = this_is_asm_operands ? _("invalid 'asm': ") : "output_operand: "; pfx_str = this_is_asm_operands ? _("invalid 'asm': ") : "output_operand: ";
asprintf (&fmt_string, "%s%s", pfx_str, _(cmsgid)); fmt_string = xasprintf ("%s%s", pfx_str, _(cmsgid));
vasprintf (&new_message, fmt_string, ap); new_message = xvasprintf (fmt_string, ap);
if (this_is_asm_operands) if (this_is_asm_operands)
error_for_asm (this_is_asm_operands, "%s", new_message); error_for_asm (this_is_asm_operands, "%s", new_message);
......
...@@ -371,7 +371,7 @@ merge_and_complain (struct cl_decoded_option **decoded_options, ...@@ -371,7 +371,7 @@ merge_and_complain (struct cl_decoded_option **decoded_options,
} }
(*decoded_options)[j].opt_index = OPT_O; (*decoded_options)[j].opt_index = OPT_O;
char *tem; char *tem;
asprintf (&tem, "-O%d", level); tem = xasprintf ("-O%d", level);
(*decoded_options)[j].arg = &tem[2]; (*decoded_options)[j].arg = &tem[2];
(*decoded_options)[j].canonical_option[0] = tem; (*decoded_options)[j].canonical_option[0] = tem;
(*decoded_options)[j].value = 1; (*decoded_options)[j].value = 1;
......
...@@ -1639,12 +1639,8 @@ default_get_pch_validity (size_t *sz) ...@@ -1639,12 +1639,8 @@ default_get_pch_validity (size_t *sz)
static const char * static const char *
pch_option_mismatch (const char *option) pch_option_mismatch (const char *option)
{ {
char *r; return xasprintf (_("created and used with differing settings of '%s'"),
option);
asprintf (&r, _("created and used with differing settings of '%s'"), option);
if (r == NULL)
return _("out of memory");
return r;
} }
/* Default version of pch_valid_p. */ /* Default version of pch_valid_p. */
......
...@@ -5457,7 +5457,7 @@ create_function_info_for (tree decl, const char *name) ...@@ -5457,7 +5457,7 @@ create_function_info_for (tree decl, const char *name)
const char *newname; const char *newname;
char *tempname; char *tempname;
asprintf (&tempname, "%s.clobber", name); tempname = xasprintf ("%s.clobber", name);
newname = ggc_strdup (tempname); newname = ggc_strdup (tempname);
free (tempname); free (tempname);
...@@ -5471,7 +5471,7 @@ create_function_info_for (tree decl, const char *name) ...@@ -5471,7 +5471,7 @@ create_function_info_for (tree decl, const char *name)
prev_vi->next = clobbervi->id; prev_vi->next = clobbervi->id;
prev_vi = clobbervi; prev_vi = clobbervi;
asprintf (&tempname, "%s.use", name); tempname = xasprintf ("%s.use", name);
newname = ggc_strdup (tempname); newname = ggc_strdup (tempname);
free (tempname); free (tempname);
...@@ -5493,7 +5493,7 @@ create_function_info_for (tree decl, const char *name) ...@@ -5493,7 +5493,7 @@ create_function_info_for (tree decl, const char *name)
const char *newname; const char *newname;
char *tempname; char *tempname;
asprintf (&tempname, "%s.chain", name); tempname = xasprintf ("%s.chain", name);
newname = ggc_strdup (tempname); newname = ggc_strdup (tempname);
free (tempname); free (tempname);
...@@ -5521,7 +5521,7 @@ create_function_info_for (tree decl, const char *name) ...@@ -5521,7 +5521,7 @@ create_function_info_for (tree decl, const char *name)
if (DECL_RESULT (decl)) if (DECL_RESULT (decl))
resultdecl = DECL_RESULT (decl); resultdecl = DECL_RESULT (decl);
asprintf (&tempname, "%s.result", name); tempname = xasprintf ("%s.result", name);
newname = ggc_strdup (tempname); newname = ggc_strdup (tempname);
free (tempname); free (tempname);
...@@ -5551,7 +5551,7 @@ create_function_info_for (tree decl, const char *name) ...@@ -5551,7 +5551,7 @@ create_function_info_for (tree decl, const char *name)
if (arg) if (arg)
argdecl = arg; argdecl = arg;
asprintf (&tempname, "%s.arg%d", name, i); tempname = xasprintf ("%s.arg%d", name, i);
newname = ggc_strdup (tempname); newname = ggc_strdup (tempname);
free (tempname); free (tempname);
...@@ -5580,7 +5580,7 @@ create_function_info_for (tree decl, const char *name) ...@@ -5580,7 +5580,7 @@ create_function_info_for (tree decl, const char *name)
char *tempname; char *tempname;
tree decl; tree decl;
asprintf (&tempname, "%s.varargs", name); tempname = xasprintf ("%s.varargs", name);
newname = ggc_strdup (tempname); newname = ggc_strdup (tempname);
free (tempname); free (tempname);
...@@ -5717,8 +5717,10 @@ create_variable_info_for_1 (tree decl, const char *name) ...@@ -5717,8 +5717,10 @@ create_variable_info_for_1 (tree decl, const char *name)
if (dump_file) if (dump_file)
{ {
asprintf (&tempname, "%s." HOST_WIDE_INT_PRINT_DEC tempname
"+" HOST_WIDE_INT_PRINT_DEC, name, fo->offset, fo->size); = xasprintf ("%s." HOST_WIDE_INT_PRINT_DEC
"+" HOST_WIDE_INT_PRINT_DEC, name,
fo->offset, fo->size);
newname = ggc_strdup (tempname); newname = ggc_strdup (tempname);
free (tempname); free (tempname);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment