Minor cleanup in elaborate_expression

gcc/ada/ChangeLog:
	* gcc-interface/decl.c (elaborate_expression): Replace calls to
	Is_OK_Static_Expression with Compile_Time_Known_Value.
This commit is contained in:
Eric Botcazou 2020-06-23 17:44:43 +02:00
parent fa0588dbec
commit cd42cdc225

View File

@ -6774,13 +6774,13 @@ elaborate_expression (Node_Id gnat_expr, Entity_Id gnat_entity, const char *s,
/* If we don't need a value and this is static or a discriminant, /* If we don't need a value and this is static or a discriminant,
we don't need to do anything. */ we don't need to do anything. */
if (!need_value if (!need_value
&& (Is_OK_Static_Expression (gnat_expr) && (Compile_Time_Known_Value (gnat_expr)
|| (Nkind (gnat_expr) == N_Identifier || (Nkind (gnat_expr) == N_Identifier
&& Ekind (Entity (gnat_expr)) == E_Discriminant))) && Ekind (Entity (gnat_expr)) == E_Discriminant)))
return NULL_TREE; return NULL_TREE;
/* If it's a static expression, we don't need a variable for debugging. */ /* If it's a static expression, we don't need a variable for debugging. */
if (need_debug && Is_OK_Static_Expression (gnat_expr)) if (need_debug && Compile_Time_Known_Value (gnat_expr))
need_debug = false; need_debug = false;
/* Otherwise, convert this tree to its GCC equivalent and elaborate it. */ /* Otherwise, convert this tree to its GCC equivalent and elaborate it. */