ada: Move splitting of pre/post aspect expressions to expansion
We split expressions of pre/post aspects into individual conjuncts and
emit messages with their precise location when they fail at runtime.
This was done when processing the aspects and caused inefficiency when
the original expression had to be recovered to detects uses of 'Old that
changed in Ada 2022. This patch moves splitting to expansion.
Conceptually, splitting in expansion is easy, but we need to take care
of locations for inherited pre/post contracts. Previously the location
string was generated while splitting the aspect into pragmas and then
it was manipulated when inheriting the pragmas. Now the location string
is built when installing the Pre'Class check and when splitting the
expression in expansion.
gcc/ada/
* exp_ch6.adb (Append_Message): Build the location string from
scratch and not rely on the one produced while splitting the
aspect into pragmas.
* exp_prag.adb (Expand_Pragma_Check): Split pre/post checks in
expansion.
* sem_ch13.adb (Analyze_Aspect_Specification): Don't split
pre/post expressions into conjuncts; don't add message with
location to the corresponding pragma.
* sem_prag.adb (Build_Pragma_Check_Equivalent): Inherited
pragmas no longer have messages that would need to be updated.
* sinput.adb (Build_Location_String): Adjust to keep previous
messages while using with inherited pragmas.