+2017-07-25 Georg-Johann Lay <avr@gjlay.de>
+
+ PR 81487
+ * hsa-brig.c (brig_init): Use xasprintf instead of asprintf.
+ * gimple-pretty-print.c (dump_profile, dump_probability): Same.
+ * tree-ssa-structalias.c (alias_get_name): Same.
+
2017-07-25 Bin Cheng <bin.cheng@arm.com>
PR target/81414
char *buf;
if (count.initialized_p ())
- asprintf (&buf, "[%.2f%%] [count: %" PRId64 "]", fvalue,
- count.to_gcov_type ());
+ buf = xasprintf ("[%.2f%%] [count: %" PRId64 "]", fvalue,
+ count.to_gcov_type ());
else
- asprintf (&buf, "[%.2f%%] [count: INV]", fvalue);
+ buf = xasprintf ("[%.2f%%] [count: INV]", fvalue);
const char *ret = xstrdup_for_dump (buf);
free (buf);
char *buf;
if (count.initialized_p ())
- asprintf (&buf, "[%.2f%%] [count: %" PRId64 "]", fvalue,
- count.to_gcov_type ());
+ buf = xasprintf ("[%.2f%%] [count: %" PRId64 "]", fvalue,
+ count.to_gcov_type ());
else if (probability.initialized_p ())
- asprintf (&buf, "[%.2f%%] [count: INV]", fvalue);
+ buf = xasprintf ("[%.2f%%] [count: INV]", fvalue);
else
- asprintf (&buf, "[INV] [count: INV]");
+ buf = xasprintf ("[INV] [count: INV]");
const char *ret = xstrdup_for_dump (buf);
free (buf);
else
part++;
char *modname2;
- asprintf (&modname2, "%s_%s", modname, part);
+ modname2 = xasprintf ("%s_%s", modname, part);
free (modname);
modname = modname2;
}
{
const char *res = NULL;
char *temp;
- int num_printed = 0;
if (!dump_file)
return "NULL";
{
res = get_name (decl);
if (res)
- num_printed = asprintf (&temp, "%s_%u", res, SSA_NAME_VERSION (decl));
+ temp = xasprintf ("%s_%u", res, SSA_NAME_VERSION (decl));
else
- num_printed = asprintf (&temp, "_%u", SSA_NAME_VERSION (decl));
- if (num_printed > 0)
- {
- res = ggc_strdup (temp);
- free (temp);
- }
+ temp = xasprintf ("_%u", SSA_NAME_VERSION (decl));
+ res = ggc_strdup (temp);
+ free (temp);
}
else if (DECL_P (decl))
{
res = get_name (decl);
if (!res)
{
- num_printed = asprintf (&temp, "D.%u", DECL_UID (decl));
- if (num_printed > 0)
- {
- res = ggc_strdup (temp);
- free (temp);
- }
+ temp = xasprintf ("D.%u", DECL_UID (decl));
+ res = ggc_strdup (temp);
+ free (temp);
}
}
}