Commit a3ace685 by Richard Henderson Committed by Richard Henderson

Add visibility to libfunc constructors

	* optabs-libfuncs.c (build_libfunc_function_visibility):
	New, split out from...
	(build_libfunc_function): ... here.
	(init_one_libfunc_visibility): New, split out from ...
	(init_one_libfunc): ... here.

From-SVN: r265704
parent 53de1ea8
2018-10-31 Richard Henderson <richard.henderson@linaro.org> 2018-10-31 Richard Henderson <richard.henderson@linaro.org>
* optabs-libfuncs.c (build_libfunc_function_visibility):
New, split out from...
(build_libfunc_function): ... here.
(init_one_libfunc_visibility): New, split out from ...
(init_one_libfunc): ... here.
* config/aarch64/atomics.md (aarch64_atomic_<ATOMIC_LDOP><ALLI>_lse): * config/aarch64/atomics.md (aarch64_atomic_<ATOMIC_LDOP><ALLI>_lse):
scratch register need not be early-clobber. Document the reason scratch register need not be early-clobber. Document the reason
why we cannot use ST<OP>. why we cannot use ST<OP>.
...@@ -719,10 +719,10 @@ struct libfunc_decl_hasher : ggc_ptr_hash<tree_node> ...@@ -719,10 +719,10 @@ struct libfunc_decl_hasher : ggc_ptr_hash<tree_node>
/* A table of previously-created libfuncs, hashed by name. */ /* A table of previously-created libfuncs, hashed by name. */
static GTY (()) hash_table<libfunc_decl_hasher> *libfunc_decls; static GTY (()) hash_table<libfunc_decl_hasher> *libfunc_decls;
/* Build a decl for a libfunc named NAME. */ /* Build a decl for a libfunc named NAME with visibility VIS. */
tree tree
build_libfunc_function (const char *name) build_libfunc_function_visibility (const char *name, symbol_visibility vis)
{ {
/* ??? We don't have any type information; pretend this is "int foo ()". */ /* ??? We don't have any type information; pretend this is "int foo ()". */
tree decl = build_decl (UNKNOWN_LOCATION, FUNCTION_DECL, tree decl = build_decl (UNKNOWN_LOCATION, FUNCTION_DECL,
...@@ -731,7 +731,7 @@ build_libfunc_function (const char *name) ...@@ -731,7 +731,7 @@ build_libfunc_function (const char *name)
DECL_EXTERNAL (decl) = 1; DECL_EXTERNAL (decl) = 1;
TREE_PUBLIC (decl) = 1; TREE_PUBLIC (decl) = 1;
DECL_ARTIFICIAL (decl) = 1; DECL_ARTIFICIAL (decl) = 1;
DECL_VISIBILITY (decl) = VISIBILITY_DEFAULT; DECL_VISIBILITY (decl) = vis;
DECL_VISIBILITY_SPECIFIED (decl) = 1; DECL_VISIBILITY_SPECIFIED (decl) = 1;
gcc_assert (DECL_ASSEMBLER_NAME (decl)); gcc_assert (DECL_ASSEMBLER_NAME (decl));
...@@ -742,11 +742,19 @@ build_libfunc_function (const char *name) ...@@ -742,11 +742,19 @@ build_libfunc_function (const char *name)
return decl; return decl;
} }
/* Build a decl for a libfunc named NAME. */
tree
build_libfunc_function (const char *name)
{
return build_libfunc_function_visibility (name, VISIBILITY_DEFAULT);
}
/* Return a libfunc for NAME, creating one if we don't already have one. /* Return a libfunc for NAME, creating one if we don't already have one.
The returned rtx is a SYMBOL_REF. */ The decl is given visibility VIS. The returned rtx is a SYMBOL_REF. */
rtx rtx
init_one_libfunc (const char *name) init_one_libfunc_visibility (const char *name, symbol_visibility vis)
{ {
tree id, decl; tree id, decl;
hashval_t hash; hashval_t hash;
...@@ -763,12 +771,18 @@ init_one_libfunc (const char *name) ...@@ -763,12 +771,18 @@ init_one_libfunc (const char *name)
{ {
/* Create a new decl, so that it can be passed to /* Create a new decl, so that it can be passed to
targetm.encode_section_info. */ targetm.encode_section_info. */
decl = build_libfunc_function (name); decl = build_libfunc_function_visibility (name, vis);
*slot = decl; *slot = decl;
} }
return XEXP (DECL_RTL (decl), 0); return XEXP (DECL_RTL (decl), 0);
} }
rtx
init_one_libfunc (const char *name)
{
return init_one_libfunc_visibility (name, VISIBILITY_DEFAULT);
}
/* Adjust the assembler name of libfunc NAME to ASMSPEC. */ /* Adjust the assembler name of libfunc NAME to ASMSPEC. */
rtx rtx
......
...@@ -63,7 +63,9 @@ void gen_satfract_conv_libfunc (convert_optab, const char *, ...@@ -63,7 +63,9 @@ void gen_satfract_conv_libfunc (convert_optab, const char *,
void gen_satfractuns_conv_libfunc (convert_optab, const char *, void gen_satfractuns_conv_libfunc (convert_optab, const char *,
machine_mode, machine_mode); machine_mode, machine_mode);
tree build_libfunc_function_visibility (const char *, symbol_visibility);
tree build_libfunc_function (const char *); tree build_libfunc_function (const char *);
rtx init_one_libfunc_visibility (const char *, symbol_visibility);
rtx init_one_libfunc (const char *); rtx init_one_libfunc (const char *);
rtx set_user_assembler_libfunc (const char *, const char *); rtx set_user_assembler_libfunc (const char *, const char *);
......
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