[Ada] Fold Enum_Rep attribute in evaluation and not in expansion
authorPiotr Trojanek <trojanek@adacore.com>
Thu, 5 Mar 2020 10:46:59 +0000 (11:46 +0100)
committerPierre-Marie de Rodat <derodat@adacore.com>
Wed, 10 Jun 2020 13:34:58 +0000 (09:34 -0400)
commitc64ac479d37f32198f75eee496d32c175fc4260b
tree85d00dc2b9d555ac89ace0bd3392574976a2e4f2
parent4322f3d99b7e5875de59c04939c4a4def1ffde5c
[Ada] Fold Enum_Rep attribute in evaluation and not in expansion

2020-06-10  Piotr Trojanek  <trojanek@adacore.com>

gcc/ada/

* exp_attr.adb (Expand_N_Attribute_Reference): Remove folding
for Enum_Rep attribute.
* exp_spark.adb (Expand_SPARK_N_Attribute_Reference): Remove
duplicated code for folding Enum_Rep attribute.
* sem_attr.adb (Eval_Attribute): Relax condition for folding
Enum_Rep attribute; previously dead code is now executed when
the attribute prefix is an enumeration literal; refine type in
processing of Enum_Val.
gcc/ada/exp_attr.adb
gcc/ada/exp_spark.adb
gcc/ada/sem_attr.adb