lto-cgraph.c (input_node_opt_summary): Remove unused code.

gcc/
2012-10-08  Tobias Burnus  <burnus@net-b.de>

	* lto-cgraph.c (input_node_opt_summary): Remove unused code.
	* lto-opts.c (append_to_collect_gcc_options): Fix condition.
	* lto-symtab.c (lto_cgraph_replace_node): Don't xstrdup string
	which is passed to fprintf.

gcc/lto/
2012-10-08  Tobias Burnus  <burnus@net-b.de>

	* lto-lang.c (lto_register_builtin_type): Avoid useless
	decl creation.
	* lto-object.c (lto_obj_file_open, lto_obj_file_open): Free memory.

From-SVN: r192250
This commit is contained in:
Tobias Burnus 2012-10-09 13:46:25 +02:00 committed by Tobias Burnus
parent 5d9de0d0a5
commit 0b8c30f9aa
7 changed files with 29 additions and 13 deletions

View File

@ -1,3 +1,10 @@
2012-10-09 Tobias Burnus <burnus@net-b.de>
* lto-cgraph.c (input_node_opt_summary): Remove unused code.
* lto-opts.c (append_to_collect_gcc_options): Fix condition.
* lto-symtab.c (lto_cgraph_replace_node): Don't xstrdup string
which is passed to fprintf.
2012-10-09 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/54194

View File

@ -1517,14 +1517,9 @@ input_node_opt_summary (struct cgraph_node *node,
count = streamer_read_uhwi (ib_main);
for (i = 0; i < count; i++)
{
int parm_num;
tree parm;
struct ipa_replace_map *map = ggc_alloc_ipa_replace_map ();
VEC_safe_push (ipa_replace_map_p, gc, node->clone.tree_map, map);
for (parm_num = 0, parm = DECL_ARGUMENTS (node->symbol.decl); parm_num;
parm = DECL_CHAIN (parm))
parm_num --;
map->parm_num = streamer_read_uhwi (ib_main);
map->old_tree = NULL;
map->new_tree = stream_read_tree (ib_main, data_in);

View File

@ -44,7 +44,7 @@ append_to_collect_gcc_options (struct obstack *ob,
bool *first_p, const char *opt)
{
const char *p, *q = opt;
if (!first_p)
if (!*first_p)
obstack_grow (ob, " ", 1);
obstack_grow (ob, "'", 1);
while ((p = strchr (q, '\'')))

View File

@ -46,8 +46,8 @@ lto_cgraph_replace_node (struct cgraph_node *node,
{
fprintf (cgraph_dump_file, "Replacing cgraph node %s/%i by %s/%i"
" for symbol %s\n",
xstrdup (cgraph_node_name (node)), node->uid,
xstrdup (cgraph_node_name (prevailing_node)),
cgraph_node_name (node), node->uid,
cgraph_node_name (prevailing_node),
prevailing_node->uid,
IDENTIFIER_POINTER ((*targetm.asm_out.mangle_assembler_name)
(IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (node->symbol.decl)))));

View File

@ -1,3 +1,9 @@
2012-10-09 Tobias Burnus <burnus@net-b.de>
* lto-lang.c (lto_register_builtin_type): Avoid useless
decl creation.
* lto-object.c (lto_obj_file_open, lto_obj_file_open): Free memory.
2012-10-08 Tobias Burnus <burnus@net-b.de>
* lto.c (lto_wpa_write_files, read_cgraph_and_symbols):

View File

@ -1079,10 +1079,13 @@ lto_register_builtin_type (tree type, const char *name)
{
tree decl;
decl = build_decl (UNKNOWN_LOCATION, TYPE_DECL, get_identifier (name), type);
DECL_ARTIFICIAL (decl) = 1;
if (!TYPE_NAME (type))
TYPE_NAME (type) = decl;
{
decl = build_decl (UNKNOWN_LOCATION, TYPE_DECL,
get_identifier (name), type);
DECL_ARTIFICIAL (decl) = 1;
TYPE_NAME (type) = decl;
}
registered_builtin_types = tree_cons (0, type, registered_builtin_types);
}

View File

@ -133,7 +133,10 @@ lto_obj_file_open (const char *filename, bool writable)
errmsg = simple_object_attributes_merge (saved_attributes, attrs,
&err);
if (errmsg != NULL)
goto fail_errmsg;
{
free (attrs);
goto fail_errmsg;
}
}
}
else
@ -155,11 +158,13 @@ lto_obj_file_open (const char *filename, bool writable)
error ("%s: %s: %s", fname, errmsg, xstrerror (err));
fail:
if (lo != NULL)
if (lo->fd != -1)
lto_obj_file_close ((lto_file *) lo);
free (lo);
return NULL;
}
/* Close FILE. If FILE was opened for writing, it is written out
now. */