preserve_user_namespace);
}
+/* Return the function decl with MVE function subcode CODE, or error_mark_node
+ if no such function exists. */
+tree
+builtin_decl (unsigned int code)
+{
+ if (code >= vec_safe_length (registered_functions))
+ return error_mark_node;
+ return (*registered_functions)[code]->decl;
+}
+
/* Return true if CANDIDATE is equivalent to MODEL_TYPE for overloading
purposes. */
static bool
? integer_zero_node
: simulate_builtin_function_decl (input_location, name, fntype,
code, NULL, attrs);
-
registered_function &rfn = *ggc_alloc <registered_function> ();
rfn.instance = instance;
rfn.decl = decl;
gcc_assert (!*rfn_slot);
*rfn_slot = &rfn;
- /* Also add the non-prefixed non-overloaded function, if the user namespace
- does not need to be preserved. */
- if (!preserve_user_namespace)
- {
- char *noprefix_name = get_name (instance, false, false);
- tree attrs = get_attributes (instance);
- add_function (instance, noprefix_name, fntype, attrs, requires_float,
- false, false);
- }
+ /* Also add the non-prefixed non-overloaded function, as placeholder
+ if the user namespace does not need to be preserved. */
+ char *noprefix_name = get_name (instance, false, false);
+ attrs = get_attributes (instance);
+ add_function (instance, noprefix_name, fntype, attrs, requires_float,
+ false, preserve_user_namespace);
/* Also add the function under its overloaded alias, if we want
a separate decl for each instance of an overloaded function. */
if (strcmp (name, overload_name) != 0)
{
/* Attribute lists shouldn't be shared. */
- tree attrs = get_attributes (instance);
+ attrs = get_attributes (instance);
bool placeholder_p = !(m_direct_overloads || force_direct_overloads);
add_function (instance, overload_name, fntype, attrs,
requires_float, false, placeholder_p);
- /* Also add the non-prefixed overloaded function, if the user namespace
- does not need to be preserved. */
- if (!preserve_user_namespace)
- {
- char *noprefix_overload_name = get_name (instance, false, true);
- tree attrs = get_attributes (instance);
- add_function (instance, noprefix_overload_name, fntype, attrs,
- requires_float, false, placeholder_p);
- }
+ /* Also add the non-prefixed overloaded function, as placeholder
+ if the user namespace does not need to be preserved. */
+ char *noprefix_overload_name = get_name (instance, false, true);
+ attrs = get_attributes (instance);
+ add_function (instance, noprefix_overload_name, fntype, attrs,
+ requires_float, false, preserve_user_namespace || placeholder_p);
}
obstack_free (&m_string_obstack, name);
= add_function (instance, name, m_overload_type, NULL_TREE,
requires_float, true, m_direct_overloads);
m_overload_names.put (name, &rfn);
- if (!preserve_user_namespace)
- {
- char *noprefix_name = get_name (instance, false, true);
- registered_function &noprefix_rfn
- = add_function (instance, noprefix_name, m_overload_type,
- NULL_TREE, requires_float, true,
- m_direct_overloads);
- m_overload_names.put (noprefix_name, &noprefix_rfn);
- }
+
+ /* Also add the non-prefixed function, as placeholder if the
+ user namespace does not need to be preserved. */
+ char *noprefix_name = get_name (instance, false, true);
+ registered_function &noprefix_rfn
+ = add_function (instance, noprefix_name, m_overload_type,
+ NULL_TREE, requires_float, true,
+ preserve_user_namespace || m_direct_overloads);
+ m_overload_names.put (noprefix_name, &noprefix_rfn);
}
}