asan.c: Remove struct tags when referring to class varpool_node.

* asan.c: Remove struct tags when referring to class varpool_node.
	* cgraph.h: Likewise.
	* cgraphbuild.c: Likewise.
	* cgraphunit.c: Likewise.
	* dbxout.c: Likewise.
	* dwarf2out.c: Likewise.
	* gimple-fold.c: Likewise.
	* ipa-devirt.c: Likewise.
	* ipa-ref-inline.h: Likewise.
	* ipa-ref.h: Likewise.
	* ipa-reference.c: Likewise.
	* ipa-utils.c: Likewise.
	* ipa.c: Likewise.
	* lto-cgraph.c: Likewise.
	* lto-streamer-out.c: Likewise.
	* lto-streamer.h: Likewise.
	* passes.c: Likewise.
	* toplev.c: Likewise.
	* tree-eh.c: Likewise.
	* tree-emutls.c: Likewise.
	* tree-pass.h: Likewise.
	* tree-ssa-structalias.c: Likewise.
	* tree-vectorizer.c: Likewise.
	* tree.c: Likewise.
	* varasm.c: Likewise.
	* varpool.c: Likewise.

	* cp/decl2.c: Remove struct tags when referring to class varpool_node.

	* lto/lto.c: Remove struct tags when referring to class varpool_node.
	* lto/lto-partition.c: Likewise.
	* lto/lto-symtab.c: Likewise.

From-SVN: r205733
This commit is contained in:
Oleg Endo 2013-12-06 10:40:53 +00:00
parent 6a5ac314de
commit 2c8326a568
33 changed files with 195 additions and 155 deletions

View File

@ -1,3 +1,32 @@
2013-12-06 Oleg Endo <olegendo@gcc.gnu.org>
* asan.c: Remove struct tags when referring to class varpool_node.
* cgraph.h: Likewise.
* cgraphbuild.c: Likewise.
* cgraphunit.c: Likewise.
* dbxout.c: Likewise.
* dwarf2out.c: Likewise.
* gimple-fold.c: Likewise.
* ipa-devirt.c: Likewise.
* ipa-ref-inline.h: Likewise.
* ipa-ref.h: Likewise.
* ipa-reference.c: Likewise.
* ipa-utils.c: Likewise.
* ipa.c: Likewise.
* lto-cgraph.c: Likewise.
* lto-streamer-out.c: Likewise.
* lto-streamer.h: Likewise.
* passes.c: Likewise.
* toplev.c: Likewise.
* tree-eh.c: Likewise.
* tree-emutls.c: Likewise.
* tree-pass.h: Likewise.
* tree-ssa-structalias.c: Likewise.
* tree-vectorizer.c: Likewise.
* tree.c: Likewise.
* varasm.c: Likewise.
* varpool.c: Likewise.
2013-12-06 Oleg Endo <olegendo@gcc.gnu.org>
* cgraphunit.c: Remove struct tags when referring to class

View File

@ -1632,7 +1632,7 @@ instrument_derefs (gimple_stmt_iterator *iter, tree t,
{
/* For static vars if they are known not to be dynamically
initialized, they will be always accessible. */
struct varpool_node *vnode = varpool_get_node (inner);
varpool_node *vnode = varpool_get_node (inner);
if (vnode && !vnode->dynamically_initialized)
return;
}
@ -2212,7 +2212,7 @@ asan_add_global (tree decl, tree type, vec<constructor_elt, va_gc> *v)
fold_convert (const_ptr_type_node, str_cst));
CONSTRUCTOR_APPEND_ELT (vinner, NULL_TREE,
fold_convert (const_ptr_type_node, module_name_cst));
struct varpool_node *vnode = varpool_get_node (decl);
varpool_node *vnode = varpool_get_node (decl);
int has_dynamic_init = vnode ? vnode->dynamically_initialized : 0;
CONSTRUCTOR_APPEND_ELT (vinner, NULL_TREE,
build_int_cst (uptr, has_dynamic_init));
@ -2378,7 +2378,7 @@ static GTY(()) tree asan_ctor_statements;
void
asan_finish_file (void)
{
struct varpool_node *vnode;
varpool_node *vnode;
unsigned HOST_WIDE_INT gcount = 0;
if (shadow_ptr_types[0] == NULL_TREE)

View File

@ -483,7 +483,8 @@ struct cgraph_node_set_def
vec<cgraph_node_ptr> nodes;
};
typedef struct varpool_node *varpool_node_ptr;
class varpool_node;
typedef varpool_node *varpool_node_ptr;
/* A varpool node set is a collection of varpool nodes. A varpool node
@ -796,7 +797,7 @@ void cgraph_mark_address_taken_node (struct cgraph_node *);
typedef void (*cgraph_edge_hook)(struct cgraph_edge *, void *);
typedef void (*cgraph_node_hook)(struct cgraph_node *, void *);
typedef void (*varpool_node_hook)(struct varpool_node *, void *);
typedef void (*varpool_node_hook)(varpool_node *, void *);
typedef void (*cgraph_2edge_hook)(struct cgraph_edge *, struct cgraph_edge *,
void *);
typedef void (*cgraph_2node_hook)(struct cgraph_node *, struct cgraph_node *,
@ -910,50 +911,50 @@ void cgraph_build_static_cdtor (char which, tree body, int priority);
varpool_node_set varpool_node_set_new (void);
varpool_node_set_iterator varpool_node_set_find (varpool_node_set,
struct varpool_node *);
void varpool_node_set_add (varpool_node_set, struct varpool_node *);
void varpool_node_set_remove (varpool_node_set, struct varpool_node *);
varpool_node *);
void varpool_node_set_add (varpool_node_set, varpool_node *);
void varpool_node_set_remove (varpool_node_set, varpool_node *);
void dump_varpool_node_set (FILE *, varpool_node_set);
void debug_varpool_node_set (varpool_node_set);
void free_varpool_node_set (varpool_node_set);
void ipa_discover_readonly_nonaddressable_vars (void);
bool varpool_externally_visible_p (struct varpool_node *);
bool varpool_externally_visible_p (varpool_node *);
/* In predict.c */
bool cgraph_maybe_hot_edge_p (struct cgraph_edge *e);
bool cgraph_optimize_for_size_p (struct cgraph_node *);
/* In varpool.c */
struct varpool_node *varpool_create_empty_node (void);
struct varpool_node *varpool_node_for_decl (tree);
struct varpool_node *varpool_node_for_asm (tree asmname);
void varpool_mark_needed_node (struct varpool_node *);
varpool_node *varpool_create_empty_node (void);
varpool_node *varpool_node_for_decl (tree);
varpool_node *varpool_node_for_asm (tree asmname);
void varpool_mark_needed_node (varpool_node *);
void debug_varpool (void);
void dump_varpool (FILE *);
void dump_varpool_node (FILE *, struct varpool_node *);
void dump_varpool_node (FILE *, varpool_node *);
void varpool_finalize_decl (tree);
enum availability cgraph_variable_initializer_availability (struct varpool_node *);
enum availability cgraph_variable_initializer_availability (varpool_node *);
void cgraph_make_node_local (struct cgraph_node *);
bool cgraph_node_can_be_local_p (struct cgraph_node *);
void varpool_remove_node (struct varpool_node *node);
void varpool_finalize_named_section_flags (struct varpool_node *node);
void varpool_remove_node (varpool_node *node);
void varpool_finalize_named_section_flags (varpool_node *node);
bool varpool_output_variables (void);
bool varpool_assemble_decl (struct varpool_node *node);
void varpool_analyze_node (struct varpool_node *);
struct varpool_node * varpool_extra_name_alias (tree, tree);
struct varpool_node * varpool_create_variable_alias (tree, tree);
bool varpool_assemble_decl (varpool_node *node);
void varpool_analyze_node (varpool_node *);
varpool_node * varpool_extra_name_alias (tree, tree);
varpool_node * varpool_create_variable_alias (tree, tree);
void varpool_reset_queue (void);
tree ctor_for_folding (tree);
bool varpool_for_node_and_aliases (struct varpool_node *,
bool (*) (struct varpool_node *, void *),
bool varpool_for_node_and_aliases (varpool_node *,
bool (*) (varpool_node *, void *),
void *, bool);
void varpool_add_new_variable (tree);
void symtab_initialize_asm_name_hash (void);
void symtab_prevail_in_asm_name_hash (symtab_node *node);
void varpool_remove_initializer (struct varpool_node *);
void varpool_remove_initializer (varpool_node *);
/* In cgraph.c */
extern void change_decl_assembler_name (tree, tree);
@ -967,11 +968,11 @@ cgraph (symtab_node *node)
}
/* Return varpool node for given symbol and check it is a variable. */
static inline struct varpool_node *
static inline varpool_node *
varpool (symtab_node *node)
{
gcc_checking_assert (!node || node->type == SYMTAB_VARIABLE);
return (struct varpool_node *)node;
return (varpool_node *)node;
}
/* Return callgraph node for given symbol and check it is a function. */
@ -983,7 +984,7 @@ cgraph_get_node (const_tree decl)
}
/* Return varpool node for given symbol and check it is a function. */
static inline struct varpool_node *
static inline varpool_node *
varpool_get_node (const_tree decl)
{
gcc_checking_assert (TREE_CODE (decl) == VAR_DECL);
@ -996,7 +997,7 @@ varpool_get_node (const_tree decl)
/* Return first variable. */
static inline struct varpool_node *
static inline varpool_node *
varpool_first_variable (void)
{
symtab_node *node;
@ -1007,8 +1008,8 @@ varpool_first_variable (void)
}
/* Return next variable after NODE. */
static inline struct varpool_node *
varpool_next_variable (struct varpool_node *node)
static inline varpool_node *
varpool_next_variable (varpool_node *node)
{
symtab_node *node1 = node->next;
for (; node1; node1 = node1->next)
@ -1023,7 +1024,7 @@ varpool_next_variable (struct varpool_node *node)
(node) = varpool_next_variable ((node)))
/* Return first reachable static variable with initializer. */
static inline struct varpool_node *
static inline varpool_node *
varpool_first_static_initializer (void)
{
symtab_node *node;
@ -1037,8 +1038,8 @@ varpool_first_static_initializer (void)
}
/* Return next reachable static variable with initializer after NODE. */
static inline struct varpool_node *
varpool_next_static_initializer (struct varpool_node *node)
static inline varpool_node *
varpool_next_static_initializer (varpool_node *node)
{
symtab_node *node1 = node->next;
for (; node1; node1 = node1->next)
@ -1056,7 +1057,7 @@ varpool_next_static_initializer (struct varpool_node *node)
(node) = varpool_next_static_initializer (node))
/* Return first reachable static variable with initializer. */
static inline struct varpool_node *
static inline varpool_node *
varpool_first_defined_variable (void)
{
symtab_node *node;
@ -1070,8 +1071,8 @@ varpool_first_defined_variable (void)
}
/* Return next reachable static variable with initializer after NODE. */
static inline struct varpool_node *
varpool_next_defined_variable (struct varpool_node *node)
static inline varpool_node *
varpool_next_defined_variable (varpool_node *node)
{
symtab_node *node1 = node->next;
for (; node1; node1 = node1->next)
@ -1257,7 +1258,7 @@ vsi_next (varpool_node_set_iterator *vsi)
}
/* Return the node pointed to by VSI. */
static inline struct varpool_node *
static inline varpool_node *
vsi_node (varpool_node_set_iterator vsi)
{
return vsi.set->nodes[vsi.index];
@ -1276,7 +1277,7 @@ vsi_start (varpool_node_set set)
/* Return true if SET contains NODE. */
static inline bool
varpool_node_in_set_p (struct varpool_node *node, varpool_node_set set)
varpool_node_in_set_p (varpool_node *node, varpool_node_set set)
{
varpool_node_set_iterator vsi;
vsi = varpool_node_set_find (set, node);
@ -1341,7 +1342,7 @@ cgraph_only_called_directly_or_aliased_p (struct cgraph_node *node)
if all direct calls are eliminated. */
static inline bool
varpool_can_remove_if_no_refs (struct varpool_node *node)
varpool_can_remove_if_no_refs (varpool_node *node)
{
if (DECL_EXTERNAL (node->decl))
return true;
@ -1359,7 +1360,7 @@ varpool_can_remove_if_no_refs (struct varpool_node *node)
The magic uses are all summarized in force_output flag. */
static inline bool
varpool_all_refs_explicit_p (struct varpool_node *vnode)
varpool_all_refs_explicit_p (varpool_node *vnode)
{
return (vnode->definition
&& !vnode->externally_visible
@ -1390,8 +1391,8 @@ cgraph_alias_target (struct cgraph_node *n)
return dyn_cast <cgraph_node> (symtab_alias_target (n));
}
static inline struct varpool_node *
varpool_alias_target (struct varpool_node *n)
static inline varpool_node *
varpool_alias_target (varpool_node *n)
{
return dyn_cast <varpool_node> (symtab_alias_target (n));
}
@ -1416,11 +1417,11 @@ cgraph_function_or_thunk_node (struct cgraph_node *node,
Do not walk through thunks.
When AVAILABILITY is non-NULL, get minimal availability in the chain. */
static inline struct varpool_node *
varpool_variable_node (struct varpool_node *node,
static inline varpool_node *
varpool_variable_node (varpool_node *node,
enum availability *availability = NULL)
{
struct varpool_node *n;
varpool_node *n;
n = dyn_cast <varpool_node> (symtab_alias_ultimate_target (node,
availability));

View File

@ -44,7 +44,7 @@ along with GCC; see the file COPYING3. If not see
struct record_reference_ctx
{
bool only_vars;
struct varpool_node *varpool_node;
class varpool_node *varpool_node;
};
/* Walk tree and record all calls and references to functions/variables.
@ -89,7 +89,7 @@ record_reference (tree *tp, int *walk_subtrees, void *data)
if (TREE_CODE (decl) == VAR_DECL)
{
struct varpool_node *vnode = varpool_node_for_decl (decl);
varpool_node *vnode = varpool_node_for_decl (decl);
ipa_record_reference (ctx->varpool_node,
vnode,
IPA_REF_ADDR, NULL);
@ -128,7 +128,7 @@ record_type_list (struct cgraph_node *node, tree list)
type = TREE_OPERAND (type, 0);
if (TREE_CODE (type) == VAR_DECL)
{
struct varpool_node *vnode = varpool_node_for_decl (type);
varpool_node *vnode = varpool_node_for_decl (type);
ipa_record_reference (node,
vnode,
IPA_REF_ADDR, NULL);
@ -238,7 +238,7 @@ mark_address (gimple stmt, tree addr, void *data)
else if (addr && TREE_CODE (addr) == VAR_DECL
&& (TREE_STATIC (addr) || DECL_EXTERNAL (addr)))
{
struct varpool_node *vnode = varpool_node_for_decl (addr);
varpool_node *vnode = varpool_node_for_decl (addr);
ipa_record_reference ((symtab_node *)data,
vnode,
@ -267,7 +267,7 @@ mark_load (gimple stmt, tree t, void *data)
else if (t && TREE_CODE (t) == VAR_DECL
&& (TREE_STATIC (t) || DECL_EXTERNAL (t)))
{
struct varpool_node *vnode = varpool_node_for_decl (t);
varpool_node *vnode = varpool_node_for_decl (t);
ipa_record_reference ((symtab_node *)data,
vnode,
@ -285,7 +285,7 @@ mark_store (gimple stmt, tree t, void *data)
if (t && TREE_CODE (t) == VAR_DECL
&& (TREE_STATIC (t) || DECL_EXTERNAL (t)))
{
struct varpool_node *vnode = varpool_node_for_decl (t);
varpool_node *vnode = varpool_node_for_decl (t);
ipa_record_reference ((symtab_node *)data,
vnode,
@ -426,7 +426,7 @@ void
record_references_in_initializer (tree decl, bool only_vars)
{
struct pointer_set_t *visited_nodes = pointer_set_create ();
struct varpool_node *node = varpool_node_for_decl (decl);
varpool_node *node = varpool_node_for_decl (decl);
struct record_reference_ctx ctx = {false, NULL};
ctx.varpool_node = node;

View File

@ -737,10 +737,10 @@ process_common_attributes (tree decl)
static void
process_function_and_variable_attributes (struct cgraph_node *first,
struct varpool_node *first_var)
varpool_node *first_var)
{
struct cgraph_node *node;
struct varpool_node *vnode;
varpool_node *vnode;
for (node = cgraph_first_function (); node != first;
node = cgraph_next_function (node))
@ -813,7 +813,7 @@ process_function_and_variable_attributes (struct cgraph_node *first,
void
varpool_finalize_decl (tree decl)
{
struct varpool_node *node = varpool_node_for_decl (decl);
varpool_node *node = varpool_node_for_decl (decl);
gcc_assert (TREE_STATIC (decl) || DECL_EXTERNAL (decl));
@ -928,8 +928,8 @@ analyze_functions (void)
intermodule optimization. */
static struct cgraph_node *first_analyzed;
struct cgraph_node *first_handled = first_analyzed;
static struct varpool_node *first_analyzed_var;
struct varpool_node *first_handled_var = first_analyzed_var;
static varpool_node *first_analyzed_var;
varpool_node *first_handled_var = first_analyzed_var;
struct pointer_set_t *reachable_call_targets = pointer_set_create ();
symtab_node *node;
@ -1891,7 +1891,7 @@ struct cgraph_order_sort
union
{
struct cgraph_node *f;
struct varpool_node *v;
varpool_node *v;
struct asm_node *a;
} u;
};
@ -1909,7 +1909,7 @@ output_in_order (void)
struct cgraph_order_sort *nodes;
int i;
struct cgraph_node *pf;
struct varpool_node *pv;
varpool_node *pv;
struct asm_node *pa;
max = symtab_order;

View File

@ -1,3 +1,7 @@
2013-12-06 Oleg Endo <olegendo@gcc.gnu.org>
* decl2.c: Remove struct tags when referring to class varpool_node.
2013-12-05 Jason Merrill <jason@redhat.com>
PR c++/59044

View File

@ -1749,7 +1749,7 @@ maybe_make_one_only (tree decl)
if (VAR_P (decl))
{
struct varpool_node *node = varpool_node_for_decl (decl);
varpool_node *node = varpool_node_for_decl (decl);
DECL_COMDAT (decl) = 1;
/* Mark it needed so we don't forget to emit it. */
node->forced_by_abi = true;
@ -1871,7 +1871,7 @@ mark_needed (tree decl)
}
else if (TREE_CODE (decl) == VAR_DECL)
{
struct varpool_node *node = varpool_node_for_decl (decl);
varpool_node *node = varpool_node_for_decl (decl);
/* C++ frontend use mark_decl_references to force COMDAT variables
to be output that might appear dead otherwise. */
node->forced_by_abi = true;
@ -1920,7 +1920,7 @@ maybe_emit_vtables (tree ctype)
tree vtbl;
tree primary_vtbl;
int needed = 0;
struct varpool_node *current = NULL, *last = NULL;
varpool_node *current = NULL, *last = NULL;
/* If the vtables for this class have already been emitted there is
nothing more to do. */
@ -3466,7 +3466,7 @@ one_static_initialization_or_destruction (tree decl, tree init, bool initp)
finish_expr_stmt (init);
if (flag_sanitize & SANITIZE_ADDRESS)
{
struct varpool_node *vnode = varpool_get_node (decl);
varpool_node *vnode = varpool_get_node (decl);
if (vnode)
vnode->dynamically_initialized = 1;
}

View File

@ -2481,7 +2481,7 @@ dbxout_expand_expr (tree expr)
/* If this is a var that might not be actually output,
return NULL, otherwise stabs might reference an undefined
symbol. */
struct varpool_node *node = varpool_get_node (expr);
varpool_node *node = varpool_get_node (expr);
if (!node || !node->definition)
return NULL;
}

View File

@ -15148,7 +15148,7 @@ reference_to_unused (tree * tp, int * walk_subtrees,
return *tp;
else if (TREE_CODE (*tp) == VAR_DECL)
{
struct varpool_node *node = varpool_get_node (*tp);
varpool_node *node = varpool_get_node (*tp);
if (!node || !node->definition)
return *tp;
}
@ -17828,7 +17828,7 @@ premark_types_used_by_global_vars_helper (void **slot,
{
/* Ask cgraph if the global variable really is to be emitted.
If yes, then we'll keep the DIE of ENTRY->TYPE. */
struct varpool_node *node = varpool_get_node (entry->var_decl);
varpool_node *node = varpool_get_node (entry->var_decl);
if (node && node->definition)
{
die->die_perennial_p = 1;

View File

@ -77,7 +77,7 @@ along with GCC; see the file COPYING3. If not see
static bool
can_refer_decl_in_current_unit_p (tree decl, tree from_decl)
{
struct varpool_node *vnode;
varpool_node *vnode;
struct cgraph_node *node;
symtab_node *snode;

View File

@ -653,7 +653,7 @@ record_target_from_binfo (vec <cgraph_node *> &nodes,
if (!flag_ltrans && anonymous)
{
tree vtable = BINFO_VTABLE (inner_binfo);
struct varpool_node *vnode;
varpool_node *vnode;
if (TREE_CODE (vtable) == POINTER_PLUS_EXPR)
vtable = TREE_OPERAND (TREE_OPERAND (vtable, 0), 0);
@ -1144,7 +1144,7 @@ record_targets_from_bases (tree otr_type,
/* When virtual table is removed, we may need to flush the cache. */
static void
devirt_variable_node_removal_hook (struct varpool_node *n,
devirt_variable_node_removal_hook (varpool_node *n,
void *d ATTRIBUTE_UNUSED)
{
if (cached_polymorphic_call_targets

View File

@ -27,7 +27,7 @@ ipa_ref_node (struct ipa_ref *ref)
/* Return varpool node REF is referring. */
static inline struct varpool_node *
static inline varpool_node *
ipa_ref_varpool_node (struct ipa_ref *ref)
{
return varpool (ref->referred);
@ -43,7 +43,7 @@ ipa_ref_referring_node (struct ipa_ref *ref)
/* Return varpool node REF is in. */
static inline struct varpool_node *
static inline varpool_node *
ipa_ref_referring_varpool_node (struct ipa_ref *ref)
{
return varpool (ref->referring);

View File

@ -19,7 +19,7 @@ along with GCC; see the file COPYING3. If not see
<http://www.gnu.org/licenses/>. */
struct cgraph_node;
struct varpool_node;
class varpool_node;
class symtab_node;

View File

@ -667,7 +667,7 @@ static unsigned int
propagate (void)
{
struct cgraph_node *node;
struct varpool_node *vnode;
varpool_node *vnode;
struct cgraph_node **order =
XCNEWVEC (struct cgraph_node *, cgraph_n_nodes);
int order_pos;

View File

@ -527,7 +527,7 @@ varpool_node_set_new (void)
/* Add varpool_node NODE to varpool_node_set SET. */
void
varpool_node_set_add (varpool_node_set set, struct varpool_node *node)
varpool_node_set_add (varpool_node_set set, varpool_node *node)
{
void **slot;
@ -551,11 +551,11 @@ varpool_node_set_add (varpool_node_set set, struct varpool_node *node)
/* Remove varpool_node NODE from varpool_node_set SET. */
void
varpool_node_set_remove (varpool_node_set set, struct varpool_node *node)
varpool_node_set_remove (varpool_node_set set, varpool_node *node)
{
void **slot, **last_slot;
int index;
struct varpool_node *last_node;
varpool_node *last_node;
slot = pointer_map_contains (set->map, node);
if (slot == NULL || !*slot)
@ -587,7 +587,7 @@ varpool_node_set_remove (varpool_node_set set, struct varpool_node *node)
is returned if NODE is not in SET. */
varpool_node_set_iterator
varpool_node_set_find (varpool_node_set set, struct varpool_node *node)
varpool_node_set_find (varpool_node_set set, varpool_node *node)
{
void **slot;
varpool_node_set_iterator vsi;
@ -612,7 +612,7 @@ dump_varpool_node_set (FILE *f, varpool_node_set set)
for (iter = vsi_start (set); !vsi_end_p (iter); vsi_next (&iter))
{
struct varpool_node *node = vsi_node (iter);
varpool_node *node = vsi_node (iter);
fprintf (f, " %s", node->name ());
}
fprintf (f, "\n");

View File

@ -291,7 +291,7 @@ symtab_remove_unreachable_nodes (bool before_inlining_p, FILE *file)
{
symtab_node *first = (symtab_node *) (void *) 1;
struct cgraph_node *node, *next;
struct varpool_node *vnode, *vnext;
varpool_node *vnode, *vnext;
bool changed = false;
struct pointer_set_t *reachable = pointer_set_create ();
struct pointer_set_t *body_needed_for_clonning = pointer_set_create ();
@ -606,7 +606,7 @@ symtab_remove_unreachable_nodes (bool before_inlining_p, FILE *file)
void
ipa_discover_readonly_nonaddressable_vars (void)
{
struct varpool_node *vnode;
varpool_node *vnode;
if (dump_file)
fprintf (dump_file, "Clearing variable flags:");
FOR_EACH_VARIABLE (vnode)
@ -663,7 +663,7 @@ address_taken_from_non_vtable_p (symtab_node *node)
i, ref); i++)
if (ref->use == IPA_REF_ADDR)
{
struct varpool_node *node;
varpool_node *node;
if (is_a <cgraph_node> (ref->referring))
return true;
node = ipa_ref_referring_varpool_node (ref);
@ -801,7 +801,7 @@ cgraph_externally_visible_p (struct cgraph_node *node,
/* Return true when variable VNODE should be considered externally visible. */
bool
varpool_externally_visible_p (struct varpool_node *vnode)
varpool_externally_visible_p (varpool_node *vnode)
{
if (DECL_EXTERNAL (vnode->decl))
return true;
@ -895,7 +895,7 @@ static unsigned int
function_and_variable_visibility (bool whole_program)
{
struct cgraph_node *node;
struct varpool_node *vnode;
varpool_node *vnode;
/* All aliases should be procssed at this point. */
gcc_checking_assert (!alias_pairs || !alias_pairs->length ());

View File

@ -204,7 +204,7 @@ lto_set_symtab_encoder_encode_body (lto_symtab_encoder_t encoder,
bool
lto_symtab_encoder_encode_initializer_p (lto_symtab_encoder_t encoder,
struct varpool_node *node)
varpool_node *node)
{
int index = lto_symtab_encoder_lookup (encoder, node);
if (index == LCC_NOT_FOUND)
@ -216,7 +216,7 @@ lto_symtab_encoder_encode_initializer_p (lto_symtab_encoder_t encoder,
static void
lto_set_symtab_encoder_encode_initializer (lto_symtab_encoder_t encoder,
struct varpool_node *node)
varpool_node *node)
{
int index = lto_symtab_encoder_lookup (encoder, node);
encoder->nodes[index].initializer = true;
@ -539,7 +539,7 @@ lto_output_node (struct lto_simple_output_block *ob, struct cgraph_node *node,
If NODE is not in SET, then NODE is a boundary. */
static void
lto_output_varpool_node (struct lto_simple_output_block *ob, struct varpool_node *node,
lto_output_varpool_node (struct lto_simple_output_block *ob, varpool_node *node,
lto_symtab_encoder_t encoder)
{
bool boundary_p = !lto_symtab_encoder_in_partition_p (encoder, node);
@ -796,7 +796,7 @@ compute_ltrans_boundary (lto_symtab_encoder_t in_encoder)
for (lsei = lsei_start_variable_in_partition (in_encoder);
!lsei_end_p (lsei); lsei_next_variable_in_partition (&lsei))
{
struct varpool_node *vnode = lsei_varpool_node (lsei);
varpool_node *vnode = lsei_varpool_node (lsei);
lto_set_symtab_encoder_in_partition (encoder, vnode);
lto_set_symtab_encoder_encode_initializer (encoder, vnode);
@ -804,7 +804,7 @@ compute_ltrans_boundary (lto_symtab_encoder_t in_encoder)
/* For proper debug info, we need to ship the origins, too. */
if (DECL_ABSTRACT_ORIGIN (vnode->decl))
{
struct varpool_node *origin_node
varpool_node *origin_node
= varpool_get_node (DECL_ABSTRACT_ORIGIN (node->decl));
lto_set_symtab_encoder_in_partition (encoder, origin_node);
}
@ -1113,13 +1113,13 @@ input_node (struct lto_file_decl_data *file_data,
/* Read a node from input_block IB. TAG is the node's tag just read.
Return the node read or overwriten. */
static struct varpool_node *
static varpool_node *
input_varpool_node (struct lto_file_decl_data *file_data,
struct lto_input_block *ib)
{
int decl_index;
tree var_decl;
struct varpool_node *node;
varpool_node *node;
struct bitpack_d bp;
int ref = LCC_NOT_FOUND;
int order;

View File

@ -339,7 +339,7 @@ get_symbol_initial_value (struct output_block *ob, tree expr)
&& initial)
{
lto_symtab_encoder_t encoder;
struct varpool_node *vnode;
varpool_node *vnode;
encoder = ob->decl_state->symtab_node_encoder;
vnode = varpool_get_node (expr);

View File

@ -886,7 +886,7 @@ void lto_set_symtab_encoder_in_partition (lto_symtab_encoder_t,
symtab_node *);
bool lto_symtab_encoder_encode_initializer_p (lto_symtab_encoder_t,
struct varpool_node *);
varpool_node *);
void output_symtab (void);
void input_symtab (void);
bool referenced_from_other_partition_p (struct ipa_ref_list *,
@ -1081,7 +1081,7 @@ lsei_cgraph_node (lto_symtab_encoder_iterator lsei)
}
/* Return the node pointed to by LSI. */
static inline struct varpool_node *
static inline varpool_node *
lsei_varpool_node (lto_symtab_encoder_iterator lsei)
{
return varpool (lsei.encoder->nodes[lsei.index].node);

View File

@ -1,3 +1,9 @@
2013-12-06 Oleg Endo <olegendo@gcc.gnu.org>
* lto.c: Remove struct tags when referring to class varpool_node.
* lto-partition.c: Likewise.
* lto-symtab.c: Likewise.
2013-11-29 Jakub Jelinek <jakub@redhat.com>
Richard Biener <rguenther@suse.de>

View File

@ -408,8 +408,8 @@ node_cmp (const void *pa, const void *pb)
static int
varpool_node_cmp (const void *pa, const void *pb)
{
const struct varpool_node *a = *(const struct varpool_node * const *) pa;
const struct varpool_node *b = *(const struct varpool_node * const *) pb;
const varpool_node *a = *(const varpool_node * const *) pa;
const varpool_node *b = *(const varpool_node * const *) pb;
return b->order - a->order;
}
@ -457,14 +457,14 @@ lto_balanced_map (void)
int n_nodes = 0;
int n_varpool_nodes = 0, varpool_pos = 0, best_varpool_pos = 0;
struct cgraph_node **order = XNEWVEC (struct cgraph_node *, cgraph_max_uid);
struct varpool_node **varpool_order = NULL;
varpool_node **varpool_order = NULL;
int i;
struct cgraph_node *node;
int total_size = 0, best_total_size = 0;
int partition_size;
ltrans_partition partition;
int last_visited_node = 0;
struct varpool_node *vnode;
varpool_node *vnode;
int cost = 0, internal = 0;
int best_n_nodes = 0, best_i = 0, best_cost =
INT_MAX, best_internal = 0;
@ -494,13 +494,13 @@ lto_balanced_map (void)
FOR_EACH_VARIABLE (vnode)
if (get_symbol_class (vnode) == SYMBOL_PARTITION)
n_varpool_nodes++;
varpool_order = XNEWVEC (struct varpool_node *, n_varpool_nodes);
varpool_order = XNEWVEC (varpool_node *, n_varpool_nodes);
n_varpool_nodes = 0;
FOR_EACH_VARIABLE (vnode)
if (get_symbol_class (vnode) == SYMBOL_PARTITION)
varpool_order[n_varpool_nodes++] = vnode;
qsort (varpool_order, n_varpool_nodes, sizeof (struct varpool_node *),
qsort (varpool_order, n_varpool_nodes, sizeof (varpool_node *),
varpool_node_cmp);
}

View File

@ -103,8 +103,8 @@ lto_cgraph_replace_node (struct cgraph_node *node,
all edges and removing the old node. */
static void
lto_varpool_replace_node (struct varpool_node *vnode,
struct varpool_node *prevailing_node)
lto_varpool_replace_node (varpool_node *vnode,
varpool_node *prevailing_node)
{
gcc_assert (!vnode->definition || prevailing_node->definition);
gcc_assert (!vnode->analyzed || prevailing_node->analyzed);

View File

@ -3314,7 +3314,7 @@ lto_main (void)
do_whole_program_analysis ();
else
{
struct varpool_node *vnode;
varpool_node *vnode;
timevar_start (TV_PHASE_OPT_GEN);

View File

@ -2351,7 +2351,7 @@ ipa_write_summaries (void)
{
lto_symtab_encoder_t encoder;
int i, order_pos;
struct varpool_node *vnode;
varpool_node *vnode;
struct cgraph_node *node;
struct cgraph_node **order;

View File

@ -390,7 +390,7 @@ wrapup_global_declaration_2 (tree decl)
if (TREE_CODE (decl) == VAR_DECL && TREE_STATIC (decl))
{
struct varpool_node *node;
varpool_node *node;
bool needed = true;
node = varpool_get_node (decl);

View File

@ -2685,7 +2685,7 @@ tree_could_trap_p (tree expr)
LTO partition. */
if (DECL_WEAK (expr) && !DECL_COMDAT (expr))
{
struct varpool_node *node;
varpool_node *node;
if (!DECL_EXTERNAL (expr))
return false;
node = varpool_variable_node (varpool_get_node (expr), NULL);

View File

@ -373,7 +373,7 @@ emutls_index (tree decl)
static tree
emutls_decl (tree decl)
{
struct varpool_node *var;
varpool_node *var;
unsigned int i;
i = emutls_index (decl);
@ -435,7 +435,7 @@ gen_emutls_addr (tree decl, struct lower_emutls_data *d)
addr = access_vars[index];
if (addr == NULL)
{
struct varpool_node *cvar;
varpool_node *cvar;
tree cdecl;
gimple x;
@ -707,10 +707,10 @@ lower_emutls_function_body (struct cgraph_node *node)
Callback for varpool_for_variable_and_aliases. */
static bool
create_emultls_var (struct varpool_node *var, void *data)
create_emultls_var (varpool_node *var, void *data)
{
tree cdecl;
struct varpool_node *cvar;
varpool_node *cvar;
cdecl = new_emutls_decl (var->decl,
var->alias && var->analyzed
@ -743,7 +743,7 @@ create_emultls_var (struct varpool_node *var, void *data)
static unsigned int
ipa_lower_emutls (void)
{
struct varpool_node *var;
varpool_node *var;
struct cgraph_node *func;
bool any_aliases = false;
tree ctor_body = NULL;

View File

@ -138,7 +138,7 @@ protected:
}
};
struct varpool_node;
class varpool_node;
struct cgraph_node;
struct lto_symtab_encoder_d;
@ -171,7 +171,7 @@ public:
function body via this hook. */
unsigned int function_transform_todo_flags_start;
unsigned int (*function_transform) (struct cgraph_node *);
void (*variable_transform) (struct varpool_node *);
void (*variable_transform) (varpool_node *);
protected:
ipa_opt_pass_d (const pass_data& data, gcc::context *ctxt,
@ -183,7 +183,7 @@ protected:
void (*stmt_fixup) (struct cgraph_node *, gimple *),
unsigned int function_transform_todo_flags_start,
unsigned int (*function_transform) (struct cgraph_node *),
void (*variable_transform) (struct varpool_node *))
void (*variable_transform) (varpool_node *))
: opt_pass (data, ctxt),
generate_summary (generate_summary),
write_summary (write_summary),

View File

@ -2913,7 +2913,7 @@ get_constraint_for_ssa_var (tree t, vec<ce_s> *results, bool address_p)
if (TREE_CODE (t) == VAR_DECL
&& (TREE_STATIC (t) || DECL_EXTERNAL (t)))
{
struct varpool_node *node = varpool_get_node (t);
varpool_node *node = varpool_get_node (t);
if (node && node->alias && node->analyzed)
{
node = varpool_variable_node (node, NULL);
@ -5746,7 +5746,7 @@ create_variable_info_for (tree decl, const char *name)
for it. */
else
{
struct varpool_node *vnode = varpool_get_node (decl);
varpool_node *vnode = varpool_get_node (decl);
/* For escaped variables initialize them from nonlocal. */
if (!varpool_all_refs_explicit_p (vnode))
@ -7079,7 +7079,7 @@ static unsigned int
ipa_pta_execute (void)
{
struct cgraph_node *node;
struct varpool_node *var;
varpool_node *var;
int from;
in_ipa_mode = 1;

View File

@ -551,7 +551,7 @@ make_pass_slp_vectorize (gcc::context *ctxt)
static unsigned int
increase_alignment (void)
{
struct varpool_node *vnode;
varpool_node *vnode;
vect_location = UNKNOWN_LOCATION;

View File

@ -5476,7 +5476,7 @@ find_decls_types_in_node (struct cgraph_node *n, struct free_lang_data_d *fld)
NAMESPACE_DECLs, etc). */
static void
find_decls_types_in_var (struct varpool_node *v, struct free_lang_data_d *fld)
find_decls_types_in_var (varpool_node *v, struct free_lang_data_d *fld)
{
find_decls_types (v->decl, fld);
}
@ -5530,7 +5530,7 @@ static void
free_lang_data_in_cgraph (void)
{
struct cgraph_node *n;
struct varpool_node *v;
varpool_node *v;
struct free_lang_data_d fld;
tree t;
unsigned i;

View File

@ -2366,7 +2366,7 @@ mark_decl_referenced (tree decl)
}
else if (TREE_CODE (decl) == VAR_DECL)
{
struct varpool_node *node = varpool_node_for_decl (decl);
varpool_node *node = varpool_node_for_decl (decl);
/* C++ frontend use mark_decl_references to force COMDAT variables
to be output that might appear dead otherwise. */
node->force_output = true;
@ -6727,7 +6727,7 @@ default_binds_local_p_1 (const_tree exp, int shlib)
if (TREE_CODE (exp) == VAR_DECL && TREE_PUBLIC (exp)
&& (TREE_STATIC (exp) || DECL_EXTERNAL (exp)))
{
struct varpool_node *vnode = varpool_get_node (exp);
varpool_node *vnode = varpool_get_node (exp);
if (vnode && resolution_local_p (vnode->resolution))
resolved_locally = true;
if (vnode
@ -6820,7 +6820,7 @@ decl_binds_to_current_def_p (tree decl)
if (TREE_CODE (decl) == VAR_DECL
&& (TREE_STATIC (decl) || DECL_EXTERNAL (decl)))
{
struct varpool_node *vnode = varpool_get_node (decl);
varpool_node *vnode = varpool_get_node (decl);
if (vnode
&& vnode->resolution != LDPR_UNKNOWN)
return resolution_to_local_definition_p (vnode->resolution);

View File

@ -78,7 +78,7 @@ varpool_remove_node_removal_hook (struct varpool_node_hook_list *entry)
/* Call all node removal hooks. */
static void
varpool_call_node_removal_hooks (struct varpool_node *node)
varpool_call_node_removal_hooks (varpool_node *node)
{
struct varpool_node_hook_list *entry = first_varpool_node_removal_hook;
while (entry)
@ -119,7 +119,7 @@ varpool_remove_variable_insertion_hook (struct varpool_node_hook_list *entry)
/* Call all node insertion hooks. */
void
varpool_call_variable_insertion_hooks (struct varpool_node *node)
varpool_call_variable_insertion_hooks (varpool_node *node)
{
struct varpool_node_hook_list *entry = first_varpool_variable_insertion_hook;
while (entry)
@ -131,19 +131,19 @@ varpool_call_variable_insertion_hooks (struct varpool_node *node)
/* Allocate new callgraph node and insert it into basic data structures. */
struct varpool_node *
varpool_node *
varpool_create_empty_node (void)
{
struct varpool_node *node = ggc_alloc_cleared_varpool_node ();
varpool_node *node = ggc_alloc_cleared_varpool_node ();
node->type = SYMTAB_VARIABLE;
return node;
}
/* Return varpool node assigned to DECL. Create new one when needed. */
struct varpool_node *
varpool_node *
varpool_node_for_decl (tree decl)
{
struct varpool_node *node = varpool_get_node (decl);
varpool_node *node = varpool_get_node (decl);
gcc_checking_assert (TREE_CODE (decl) == VAR_DECL);
if (node)
return node;
@ -156,7 +156,7 @@ varpool_node_for_decl (tree decl)
/* Remove node from the varpool. */
void
varpool_remove_node (struct varpool_node *node)
varpool_remove_node (varpool_node *node)
{
tree init;
varpool_call_node_removal_hooks (node);
@ -174,7 +174,7 @@ varpool_remove_node (struct varpool_node *node)
/* Renove node initializer when it is no longer needed. */
void
varpool_remove_initializer (struct varpool_node *node)
varpool_remove_initializer (varpool_node *node)
{
if (DECL_INITIAL (node->decl)
&& !DECL_IN_CONSTANT_POOL (node->decl)
@ -192,7 +192,7 @@ varpool_remove_initializer (struct varpool_node *node)
/* Dump given cgraph node. */
void
dump_varpool_node (FILE *f, struct varpool_node *node)
dump_varpool_node (FILE *f, varpool_node *node)
{
dump_symtab_base (f, node);
fprintf (f, " Availability: %s\n",
@ -215,7 +215,7 @@ dump_varpool_node (FILE *f, struct varpool_node *node)
void
dump_varpool (FILE *f)
{
struct varpool_node *node;
varpool_node *node;
fprintf (f, "variable pool:\n\n");
FOR_EACH_VARIABLE (node)
@ -231,7 +231,7 @@ debug_varpool (void)
}
/* Given an assembler name, lookup node. */
struct varpool_node *
varpool_node *
varpool_node_for_asm (tree asmname)
{
if (symtab_node *node = symtab_node_for_asm (asmname))
@ -247,7 +247,7 @@ varpool_node_for_asm (tree asmname)
tree
ctor_for_folding (tree decl)
{
struct varpool_node *node, *real_node;
varpool_node *node, *real_node;
tree real_decl;
if (TREE_CODE (decl) != VAR_DECL
@ -337,7 +337,7 @@ ctor_for_folding (tree decl)
void
varpool_add_new_variable (tree decl)
{
struct varpool_node *node;
varpool_node *node;
varpool_finalize_decl (decl);
node = varpool_node_for_decl (decl);
varpool_call_variable_insertion_hooks (node);
@ -348,7 +348,7 @@ varpool_add_new_variable (tree decl)
/* Return variable availability. See cgraph.h for description of individual
return values. */
enum availability
cgraph_variable_initializer_availability (struct varpool_node *node)
cgraph_variable_initializer_availability (varpool_node *node)
{
gcc_assert (cgraph_function_flags_ready);
if (!node->definition)
@ -376,7 +376,7 @@ cgraph_variable_initializer_availability (struct varpool_node *node)
}
void
varpool_analyze_node (struct varpool_node *node)
varpool_analyze_node (varpool_node *node)
{
tree decl = node->decl;
@ -401,14 +401,14 @@ varpool_analyze_node (struct varpool_node *node)
/* Assemble thunks and aliases associated to NODE. */
static void
assemble_aliases (struct varpool_node *node)
assemble_aliases (varpool_node *node)
{
int i;
struct ipa_ref *ref;
for (i = 0; ipa_ref_list_referring_iterate (&node->ref_list, i, ref); i++)
if (ref->use == IPA_REF_ALIAS)
{
struct varpool_node *alias = ipa_ref_referring_varpool_node (ref);
varpool_node *alias = ipa_ref_referring_varpool_node (ref);
do_assemble_alias (alias->decl,
DECL_ASSEMBLER_NAME (node->decl));
assemble_aliases (alias);
@ -418,7 +418,7 @@ assemble_aliases (struct varpool_node *node)
/* Output one variable, if necessary. Return whether we output it. */
bool
varpool_assemble_decl (struct varpool_node *node)
varpool_assemble_decl (varpool_node *node)
{
tree decl = node->decl;
@ -465,7 +465,7 @@ varpool_assemble_decl (struct varpool_node *node)
The queue is linked via AUX pointers and terminated by pointer to 1. */
static void
enqueue_node (struct varpool_node *node, struct varpool_node **first)
enqueue_node (varpool_node *node, varpool_node **first)
{
if (node->aux)
return;
@ -482,8 +482,8 @@ enqueue_node (struct varpool_node *node, struct varpool_node **first)
static void
varpool_remove_unreferenced_decls (void)
{
struct varpool_node *next, *node;
struct varpool_node *first = (struct varpool_node *)(void *)1;
varpool_node *next, *node;
varpool_node *first = (varpool_node *)(void *)1;
int i;
struct ipa_ref *ref;
@ -505,10 +505,10 @@ varpool_remove_unreferenced_decls (void)
fprintf (cgraph_dump_file, " %s", node->asm_name ());
}
}
while (first != (struct varpool_node *)(void *)1)
while (first != (varpool_node *)(void *)1)
{
node = first;
first = (struct varpool_node *)first->aux;
first = (varpool_node *)first->aux;
if (node->same_comdat_group)
{
@ -553,7 +553,7 @@ varpool_remove_unreferenced_decls (void)
conflicts between read-only and read-only requiring relocations
sections can be resolved. */
void
varpool_finalize_named_section_flags (struct varpool_node *node)
varpool_finalize_named_section_flags (varpool_node *node)
{
if (!TREE_ASM_WRITTEN (node->decl)
&& !node->alias
@ -570,7 +570,7 @@ bool
varpool_output_variables (void)
{
bool changed = false;
struct varpool_node *node;
varpool_node *node;
if (seen_error ())
return false;
@ -594,7 +594,7 @@ tree
add_new_static_var (tree type)
{
tree new_decl;
struct varpool_node *new_node;
varpool_node *new_node;
new_decl = create_tmp_var_raw (type, NULL);
DECL_NAME (new_decl) = create_tmp_var_name (NULL);
@ -613,10 +613,10 @@ add_new_static_var (tree type)
/* Attempt to mark ALIAS as an alias to DECL. Return TRUE if successful.
Extra name aliases are output whenever DECL is output. */
struct varpool_node *
varpool_node *
varpool_create_variable_alias (tree alias, tree decl)
{
struct varpool_node *alias_node;
varpool_node *alias_node;
gcc_assert (TREE_CODE (decl) == VAR_DECL);
gcc_assert (TREE_CODE (alias) == VAR_DECL);
@ -632,10 +632,10 @@ varpool_create_variable_alias (tree alias, tree decl)
/* Attempt to mark ALIAS as an alias to DECL. Return TRUE if successful.
Extra name aliases are output whenever DECL is output. */
struct varpool_node *
varpool_node *
varpool_extra_name_alias (tree alias, tree decl)
{
struct varpool_node *alias_node;
varpool_node *alias_node;
#ifndef ASM_OUTPUT_DEF
/* If aliases aren't supported by the assembler, fail. */
@ -659,8 +659,8 @@ varpool_extra_name_alias (tree alias, tree decl)
skipped. */
bool
varpool_for_node_and_aliases (struct varpool_node *node,
bool (*callback) (struct varpool_node *, void *),
varpool_for_node_and_aliases (varpool_node *node,
bool (*callback) (varpool_node *, void *),
void *data,
bool include_overwritable)
{
@ -672,7 +672,7 @@ varpool_for_node_and_aliases (struct varpool_node *node,
for (i = 0; ipa_ref_list_referring_iterate (&node->ref_list, i, ref); i++)
if (ref->use == IPA_REF_ALIAS)
{
struct varpool_node *alias = ipa_ref_referring_varpool_node (ref);
varpool_node *alias = ipa_ref_referring_varpool_node (ref);
if (include_overwritable
|| cgraph_variable_initializer_availability (alias) > AVAIL_OVERWRITABLE)
if (varpool_for_node_and_aliases (alias, callback, data,