return info;
}
-/* Try to get the underlying FUNCTION_DECL from reflection if any,
- otherwise return R. */
-
-static tree
-maybe_get_reflection_fndecl (tree r)
-{
- r = MAYBE_BASELINK_FUNCTIONS (r);
- r = OVL_FIRST (r);
- return r;
-}
-
/* Helper function for get_range_elts, called through cp_walk_tree. */
static tree
static tree
eval_is_function (tree r)
{
- r = maybe_get_reflection_fndecl (r);
+ r = maybe_get_first_fn (r);
if (TREE_CODE (r) == FUNCTION_DECL)
return boolean_true_node;
static tree
eval_is_function_template (tree r)
{
- r = maybe_get_reflection_fndecl (r);
+ r = maybe_get_first_fn (r);
if (DECL_FUNCTION_TEMPLATE_P (r))
return boolean_true_node;
static tree
eval_is_class_member (tree r)
{
- r = maybe_get_reflection_fndecl (r);
+ r = maybe_get_first_fn (r);
if (TREE_CODE (r) == CONST_DECL)
{
/* [class.mem.general]/5 - The enumerators of an unscoped enumeration
{
if (eval_is_class_member (r) == boolean_true_node)
{
- r = maybe_get_reflection_fndecl (r);
+ r = maybe_get_first_fn (r);
if (TYPE_P (r))
{
static tree
eval_is_virtual (tree r, reflect_kind kind)
{
- r = maybe_get_reflection_fndecl (r);
+ r = maybe_get_first_fn (r);
if (TREE_CODE (r) == FUNCTION_DECL && DECL_VIRTUAL_P (r))
return boolean_true_node;
static tree
eval_is_pure_virtual (tree r)
{
- r = maybe_get_reflection_fndecl (r);
+ r = maybe_get_first_fn (r);
if (TREE_CODE (r) == FUNCTION_DECL && DECL_PURE_VIRTUAL_P (r))
return boolean_true_node;
else
static tree
eval_is_override (tree r)
{
- r = maybe_get_reflection_fndecl (r);
+ r = maybe_get_first_fn (r);
if (TREE_CODE (r) == FUNCTION_DECL
&& DECL_VIRTUAL_P (r)
&& !DECL_STATIC_FUNCTION_P (r)
static tree
eval_is_namespace_member (tree r)
{
- r = maybe_get_reflection_fndecl (r);
+ r = maybe_get_first_fn (r);
if (TREE_CODE (r) == CONST_DECL)
{
if (UNSCOPED_ENUM_P (DECL_CONTEXT (r)))
static tree
eval_is_static_member (tree r)
{
- r = maybe_get_reflection_fndecl (r);
+ r = maybe_get_first_fn (r);
r = STRIP_TEMPLATE (r);
if (TREE_CODE (r) == FUNCTION_DECL && DECL_STATIC_FUNCTION_P (r))
return boolean_true_node;
static tree
eval_is_deleted (tree r)
{
- r = maybe_get_reflection_fndecl (r);
+ r = maybe_get_first_fn (r);
if (TREE_CODE (r) == FUNCTION_DECL && DECL_MAYBE_DELETED (r))
{
++function_depth;
static tree
eval_is_defaulted (tree r)
{
- r = maybe_get_reflection_fndecl (r);
+ r = maybe_get_first_fn (r);
if (TREE_CODE (r) == FUNCTION_DECL && DECL_DEFAULTED_FN (r))
return boolean_true_node;
else
static tree
eval_is_user_provided (tree r)
{
- r = maybe_get_reflection_fndecl (r);
+ r = maybe_get_first_fn (r);
if (TREE_CODE (r) == FUNCTION_DECL
&& user_provided_p (r)
// TODO: user_provided_p is false for non-members defaulted on
static tree
eval_is_user_declared (tree r)
{
- r = maybe_get_reflection_fndecl (r);
+ r = maybe_get_first_fn (r);
if (TREE_CODE (r) == FUNCTION_DECL && !DECL_ARTIFICIAL (r))
return boolean_true_node;
else
static tree
eval_is_explicit (tree r)
{
- r = maybe_get_reflection_fndecl (r);
+ r = maybe_get_first_fn (r);
if (TREE_CODE (r) == FUNCTION_DECL && DECL_NONCONVERTING_P (r))
return boolean_true_node;
&& eval_is_template (r) == boolean_false_node
&& eval_is_namespace (r) == boolean_false_node)
return boolean_false_node;
- r = maybe_get_reflection_fndecl (r);
+ r = maybe_get_first_fn (r);
r = STRIP_TEMPLATE (r);
if (TYPE_P (r))
{
&& eval_is_template (r) == boolean_false_node
&& eval_is_namespace (r) == boolean_false_node)
return boolean_false_node;
- r = maybe_get_reflection_fndecl (r);
+ r = maybe_get_first_fn (r);
r = STRIP_TEMPLATE (r);
if (TYPE_P (r))
{
&& eval_is_template (r) == boolean_false_node
&& eval_is_namespace (r) == boolean_false_node)
return boolean_false_node;
- r = maybe_get_reflection_fndecl (r);
+ r = maybe_get_first_fn (r);
r = STRIP_TEMPLATE (r);
if (TYPE_P (r))
{
&& eval_is_function (r) == boolean_false_node
&& eval_is_function_type (r) == boolean_false_node)
return boolean_false_node;
- r = maybe_get_reflection_fndecl (r);
+ r = maybe_get_first_fn (r);
r = STRIP_TEMPLATE (r);
if (TYPE_P (r))
{
&& eval_is_template (r) == boolean_false_node
&& eval_is_namespace (r) == boolean_false_node)
return boolean_false_node;
- r = maybe_get_reflection_fndecl (r);
+ r = maybe_get_first_fn (r);
r = STRIP_TEMPLATE (r);
if (TYPE_P (r))
{
static tree
eval_is_operator_function (tree r)
{
- r = maybe_get_reflection_fndecl (r);
+ r = maybe_get_first_fn (r);
if (TREE_CODE (r) == FUNCTION_DECL
&& DECL_OVERLOADED_OPERATOR_P (r)
static tree
eval_is_destructor (tree r)
{
- r = maybe_get_reflection_fndecl (r);
+ r = maybe_get_first_fn (r);
if (TREE_CODE (r) == FUNCTION_DECL
&& DECL_MAYBE_IN_CHARGE_DESTRUCTOR_P (r))
return boolean_true_node;
static tree
eval_is_conversion_function_template (tree r)
{
- r = maybe_get_reflection_fndecl (r);
+ r = maybe_get_first_fn (r);
if (DECL_FUNCTION_TEMPLATE_P (r) && DECL_CONV_FN_P (r))
return boolean_true_node;
static tree
eval_is_operator_function_template (tree r)
{
- r = maybe_get_reflection_fndecl (r);
+ r = maybe_get_first_fn (r);
if (DECL_FUNCTION_TEMPLATE_P (r))
{
static tree
eval_is_constructor_template (tree r)
{
- r = maybe_get_reflection_fndecl (r);
+ r = maybe_get_first_fn (r);
if (DECL_FUNCTION_TEMPLATE_P (r) && DECL_CONSTRUCTOR_P (r))
return boolean_true_node;
"reflection does not represent an operator "
"function or operator function template",
fun, non_constant_p, jump_target);
- r = maybe_get_reflection_fndecl (r);
+ r = maybe_get_first_fn (r);
r = STRIP_TEMPLATE (r);
maybe_init_meta_operators (loc);
int i = IDENTIFIER_ASSIGN_OP_P (DECL_NAME (r)) ? 1 : 0;
{
if (eval_is_function (r) == boolean_true_node)
{
- r = maybe_get_reflection_fndecl (r);
+ r = maybe_get_first_fn (r);
maybe_instantiate_noexcept (r);
if (TYPE_NOTHROW_P (TREE_TYPE (r)))
return boolean_true_node;
else
return boolean_false_node;
}
- r = maybe_get_reflection_fndecl (r);
+ r = maybe_get_first_fn (r);
if (kind == REFLECT_BASE)
return boolean_true_node;
if (!DECL_P (r))
"entity with parent",
fun, non_constant_p, jump_target);
tree c;
- r = maybe_get_reflection_fndecl (r);
+ r = maybe_get_first_fn (r);
if (TYPE_P (r))
{
if (TYPE_NAME (r) && DECL_P (TYPE_NAME (r)))
&& eval_is_function_type (r) != boolean_true_node)
return throw_exception_nofn (loc, ctx, fun, non_constant_p, jump_target);
- r = maybe_get_reflection_fndecl (r);
+ r = maybe_get_first_fn (r);
vec<constructor_elt, va_gc> *elts = nullptr;
tree args = (TREE_CODE (r) == FUNCTION_DECL
? FUNCTION_FIRST_USER_PARM (r)
static tree
eval_has_identifier (tree r, reflect_kind kind)
{
- r = maybe_get_reflection_fndecl (r);
+ r = maybe_get_first_fn (r);
if (kind == REFLECT_BASE)
{
r = type_of (r, kind);
return throw_exception (loc, ctx,
"reflection with has_identifier false",
fun, non_constant_p, jump_target);
- r = maybe_get_reflection_fndecl (r);
+ r = maybe_get_first_fn (r);
const char *name = NULL;
if (kind == REFLECT_BASE)
{
#pragma GCC diagnostic ignored "-Wformat"
#pragma GCC diagnostic ignored "-Wformat-diag"
#endif
- r = maybe_get_reflection_fndecl (r);
+ r = maybe_get_first_fn (r);
pretty_printer pp, *refpp = global_dc->get_reference_printer ();
pp_format_decoder (&pp) = pp_format_decoder (refpp);
pp.set_format_postprocessor (pp_format_postprocessor (refpp)->clone ());
{
if (eval_is_function (r) == boolean_true_node)
{
- r = maybe_get_reflection_fndecl (r);
+ r = maybe_get_first_fn (r);
if (TREE_CODE (r) == FUNCTION_DECL && DECL_FINAL_P (r))
return boolean_true_node;
else
if (eval_is_class_member (r) == boolean_true_node)
{
- r = maybe_get_reflection_fndecl (r);
+ r = maybe_get_first_fn (r);
c = r;
if (TREE_CODE (r) == CONST_DECL && UNSCOPED_ENUM_P (DECL_CONTEXT (r)))
c = DECL_CONTEXT (r);
the RHS will be OVERLOAD<TEMPLATE_DECL> but the LHS will
only be TEMPLATE_DECL. They should compare equal, though. */
// ??? Can we do something better?
- lhs = maybe_get_reflection_fndecl (lhs);
- rhs = maybe_get_reflection_fndecl (rhs);
+ lhs = maybe_get_first_fn (lhs);
+ rhs = maybe_get_first_fn (rhs);
if (lkind == REFLECT_PARM)
{
lhs = maybe_update_function_parm (lhs);
if (eval_is_function (h) == boolean_true_node)
{
strcpy (prefix, "fn");
- return maybe_get_reflection_fndecl (h);
+ return maybe_get_first_fn (h);
}
if (eval_is_function_parameter (h, kind) == boolean_true_node)
{
if (eval_is_function_template (h) == boolean_true_node)
{
strcpy (prefix, "ft");
- h = maybe_get_reflection_fndecl (h);
+ h = maybe_get_first_fn (h);
return h;
}
if (eval_is_variable_template (h) == boolean_true_node)