aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/gcc-interface/utils.cc
diff options
context:
space:
mode:
authorJavier Miranda <miranda@adacore.com>2024-12-01 19:02:52 +0000
committerMarc Poulhiès <dkm@gcc.gnu.org>2024-12-13 09:36:02 +0100
commit71d515570824a3d4f76da8c1b1bdc13762ab694f (patch)
treebe4fafca09985a818bd028f3001e9e3a01b4e124 /gcc/ada/gcc-interface/utils.cc
parentad51d92159fa6788175b1fc05912669eb1ea1c0a (diff)
downloadgcc-71d515570824a3d4f76da8c1b1bdc13762ab694f.zip
gcc-71d515570824a3d4f76da8c1b1bdc13762ab694f.tar.gz
gcc-71d515570824a3d4f76da8c1b1bdc13762ab694f.tar.bz2
ada: Cleanup preanalysis of static expressions
During preanalysis, the frontend does not generate freeze nodes. The exception to this rule occurs during the preanalysis of default and per-object expressions, where static expressions are frozen. A patch merged six years ago to address an issue in this area introduced additional complexity and confusion regarding the frontend's behavior in such cases. The purpose of this patch is to revert that change, simplifying the support for the preanalysis of static expressions to make it cleaner and easier to understand. gcc/ada/ChangeLog: * sem.ads (Inside_Preanalysis_Without_Freezing): Removed. * sem.adb (Semantics): Remove Inside_Preanalysis_Without_Freezing. * sem_ch6.adb (Preanalyze_Formal_Expression): Removed. * sem_ch3.ads (Preanalyze_Assert_Expression): Add documentation. (Preanalyze_Spec_Expression): Add documentation. * sem_ch3.adb (Preanalyze_Assert_Expression) Code cleanup. (Preanalyze_Default_Expression): Code cleanup. * sem_res.ads (Preanalyze_With_Freezing_And_Resolve): Removed. * sem_res.adb (Preanalyze_With_Freezing_And_Resolve): Removed. (Preanalyze_And_Resolve): Code cleanup. * freeze.adb (Freeze_Entity): No freeze under strict preanalysis. (Freeze_Expression): Code cleanup. (Freeze_Expr_Types): Replace call to Preanalyze_Spec_Expression by strict preanalysis during preanalysis of a duplicate of the expression performed to have available the minimum decoration to locate referenced unfrozen types. * sem_aggr.adb (Resolve_Array_Aggregate): Minor code cleanup. * sem_attr.adb (Resolve_Attribute): Add documentation. * sem_ch13.adb (Resolve_Aspect_Expressions[Aspect_Default_Value]): Replace call to Preanalyze_Spec_Expression by Preanalyze_And_Resolve. (Resolve_Aspect_Expressions[Aspect_Default_Component_Value]): Ditto. * sem_ch8.adb (Set_Entity_Or_Discriminal): Code cleaup. * sem_prag.adb (Analyze_Initial_Condition_In_Decl_Part): Replace call to Preanalyze_Assert_Expression by call to Preanalyze_And_Resolve. (Analyze_Pre_Post_Condition): Replace call to Preanayze_Spec_Expression by call to Preanalyze_Assert_Expression. * sem_util.ads (In_Pragma_Expression): Adding a formal to extend the functionality of this subprogram. (Within_Static_Expression): New subprogram. * sem_util.adb (In_Pragma_Expression): Ditto. (Within_Static_Expression): Ditto. * checks.adb (Install_Null_Excluding_Check): No check during preanalysis. (Install_Primitive_Elaboration_Check): Ditto.
Diffstat (limited to 'gcc/ada/gcc-interface/utils.cc')
0 files changed, 0 insertions, 0 deletions