[Ada] Performance degradation with references
This patch modifies the creation of markers for variable references in the
context of SPARK elaboration checks. Previously, prior to checking whether a
reference requires such a marker, the compiler performed a logarithmic look up
to determine whether the reference appears within a call. This action caused
the compiler to degrade when a source program contains multiple (100,000s)
references. Now, the compiler no longer performs the look up immediately.
2018-06-11 Hristian Kirtchev <kirtchev@adacore.com>
gcc/ada/
* sem_ch8.adb (Find_Direct_Name): Mode the declaration of
Is_Assignment_LHS further in. Use predicate
Needs_Variable_Reference_Marker to determine whether to create a
variable marker.
(Find_Expanded_Name): Mode the declaration of Is_Assignment_LHS further
in. Use predicate Needs_Variable_Reference_Marker to determine whether
to create a variable marker.
* sem_elab.adb (Build_Variable_Reference_Marker): Remove the various
checks that determine whether the identifier or expanded name is a
suitable variable reference. The checks are now performed by
Needs_Variable_Reference_Marker.
* sem_res.adb (Resolve_Actuals): Use predicate
Needs_Variable_Reference_Marker to determine whether to create a
variable marker.
* sem_util.adb (Needs_Variable_Reference_Marker): New routine.
* sem_util.ads (Needs_Variable_Reference_Marker): New routine.
From-SVN: r261400