insert_to_assembler_name_hash (node, false);
}
-/* Initalize asm name hash unless. */
+/* Initialize asm name hash unless. */
void
symbol_table::symtab_initialize_asm_name_hash (void)
}
/* Return ipa reference from this symtab_node to
- REFERED_NODE or REFERED_VARPOOL_NODE. USE_TYPE specify type
+ REFERRED_NODE or REFERRED_VARPOOL_NODE. USE_TYPE specify type
of the use. */
ipa_ref *
/* Return ipa reference from this symtab_node to
- REFERED_NODE or REFERED_VARPOOL_NODE. USE_TYPE specify type
+ REFERRED_NODE or REFERRED_VARPOOL_NODE. USE_TYPE specify type
of the use and STMT the statement (if it exists). */
ipa_ref *
}
/* Remove all stmt references in non-speculative references.
- Those are not maintained during inlining & clonning.
+ Those are not maintained during inlining & cloning.
The exception are speculative references that are updated along
with callgraph edges associated with them. */
static const char * const symtab_type_names[] = {"symbol", "function", "variable"};
+/* Dump the visibility of the symbol. */
+
+const char *
+symtab_node::get_visibility_string () const
+{
+ static const char * const visibility_types[]
+ = { "default", "protected", "hidden", "internal" };
+ return visibility_types[DECL_VISIBILITY (decl)];
+}
+
+/* Dump the type_name of the symbol. */
+const char *
+symtab_node::get_symtab_type_string () const
+{
+ return symtab_type_names[type];
+}
+
/* Dump base fields of symtab nodes to F. Not to be used directly. */
void
vnode->dump (f);
}
+void
+symtab_node::dump_graphviz (FILE *f)
+{
+ if (cgraph_node *cnode = dyn_cast <cgraph_node *> (this))
+ cnode->dump_graphviz (f);
+}
+
void
symbol_table::dump (FILE *f)
{
node->dump (f);
}
+void
+symbol_table::dump_graphviz (FILE *f)
+{
+ symtab_node *node;
+ fprintf (f, "digraph symtab {\n");
+ FOR_EACH_SYMBOL (node)
+ node->dump_graphviz (f);
+ fprintf (f, "}\n");
+}
+
DEBUG_FUNCTION void
symbol_table::debug (void)
{
/* Verify common part of symtab nodes. */
+#if __GNUC__ >= 10
+/* Disable warnings about missing quoting in GCC diagnostics for
+ the verification errors. Their format strings don't follow GCC
+ diagnostic conventions and the calls are ultimately followed by
+ one to internal_error. */
+# pragma GCC diagnostic push
+# pragma GCC diagnostic ignored "-Wformat-diag"
+#endif
+
DEBUG_FUNCTION bool
symtab_node::verify_base (void)
{
!= NULL)
!= dyn_cast <cgraph_node *> (this)->ifunc_resolver)
{
- error ("inconsistent `ifunc' attribute");
+ error ("inconsistent %<ifunc%> attribute");
error_found = true;
}
}
}
}
+#if __GNUC__ >= 10
+# pragma GCC diagnostic pop
+#endif
+
/* Make DECL local. FIXME: We shouldn't need to mess with rtl this early,
but other code such as notice_global_symbol generates rtl. */
availability prevails the availability of its target (i.e. static alias of
weak definition is available.
- Transaparent alias is just alternative anme of a given symbol used within
+ Transparent alias is just alternative name of a given symbol used within
one compilation unit and is translated prior hitting the object file. It
inherits the visibility of its target.
Weakref is a different animal (and noweak definition is weak).
void
symtab_node::set_section (const char *section)
{
- gcc_assert (!this->alias);
+ gcc_assert (!this->alias || !this->analyzed);
call_for_symbol_and_aliases
(symtab_node::set_section, const_cast<char *>(section), true);
}
h->init = priority;
}
-/* Set fialization priority to PRIORITY. */
+/* Set finalization priority to PRIORITY. */
void
cgraph_node::set_fini_priority (priority_type priority)
symtab_node::get_partitioning_class (void)
{
/* Inline clones are always duplicated.
- This include external delcarations. */
+ This include external declarations. */
cgraph_node *cnode = dyn_cast <cgraph_node *> (this);
if (DECL_ABSTRACT_P (decl))
return SYMBOL_EXTERNAL;
- if (cnode && cnode->global.inlined_to)
+ if (cnode && cnode->inlined_to)
return SYMBOL_DUPLICATE;
/* Transparent aliases are always duplicated. */
If MEMORY_ACCESSED is true, assume that both memory pointer to THIS
and S2 is going to be accessed. This eliminates the situations when
- either THIS or S2 is NULL and is seful for comparing bases when deciding
+ either THIS or S2 is NULL and is useful for comparing bases when deciding
about memory aliasing. */
int
symtab_node::equal_address_to (symtab_node *s2, bool memory_accessed)
code and are used only within speculation. In this case we may make
symbol equivalent to its alias even if interposition may break this
rule. Doing so will allow us to turn speculative inlining into
- non-speculative more agressively. */
+ non-speculative more aggressively. */
if (DECL_VIRTUAL_P (this->decl) && avail1 >= AVAIL_AVAILABLE)
binds_local1 = true;
if (DECL_VIRTUAL_P (s2->decl) && avail2 >= AVAIL_AVAILABLE)
/* TODO: Alias oracle basically assume that addresses of global variables
are different unless they are declared as alias of one to another while
- the code folding comparsions doesn't.
+ the code folding comparisons doesn't.
We probably should be consistent and use this fact here, too, but for
the moment return false only when we are called from the alias oracle. */
return true;
/* Inline clones always binds locally. */
- if (cnode && cnode->global.inlined_to)
+ if (cnode && cnode->inlined_to)
return true;
if (DECL_EXTERNAL (decl))
{
cgraph_node *cref = dyn_cast <cgraph_node *> (ref);
if (cref)
- ref = cref->global.inlined_to;
+ ref = cref->inlined_to;
}
/* If this is a reference from symbol itself and there are no aliases, we
first place. */
if (VAR_P (decl) && DECL_HARD_REGISTER (decl))
return false;
- /* FIXME: Builtins corresponding to real functions probably should have
- symbol table entries. */
- if (TREE_CODE (decl) == FUNCTION_DECL && fndecl_built_in_p (decl))
- return false;
+ if (TREE_CODE (decl) == FUNCTION_DECL && !definition
+ && fndecl_built_in_p (decl))
+ {
+ /* Builtins like those for most math functions have actual implementations
+ in libraries so make sure to output references into the symbol table to
+ make those libraries referenced. Note this is incomplete handling for
+ now and only covers math functions. */
+ if (builtin_with_linkage_p (decl))
+ return true;
+ else
+ return false;
+ }
/* We have real symbol that should be in symbol table. However try to trim
- down the refernces to libraries bit more because linker will otherwise
- bring unnecesary object files into the final link.
+ down the references to libraries bit more because linker will otherwise
+ bring unnecessary object files into the final link.
FIXME: The following checks can easily be confused i.e. by self recursive
function or self-referring variable. */