]> git.ipfire.org Git - thirdparty/gcc.git/commit
ada: Set Related_Expression on compiler-generated Valid_Scalars functions
authorTucker Taft <taft@adacore.com>
Mon, 11 Aug 2025 21:33:52 +0000 (21:33 +0000)
committerMarc Poulhiès <dkm@gcc.gnu.org>
Thu, 11 Sep 2025 09:10:46 +0000 (11:10 +0200)
commit017aad48e805579cd2104230d7caeb1bf04dbb80
tree851a94f6cdbcf09edaa7d6c0beac3e61958cbeb1
parente3b66ea7d8d23bec895fc7199c3f06d7518708c0
ada: Set Related_Expression on compiler-generated Valid_Scalars functions

When creating the local functions to implement the Valid_Scalars
attribute for array and record types, set a Related_Expression that
points to the original attribute reference (blah'Valid_Scalars).
This allows the Inspector to give a more user-friendly name
when these functions are called and they are known, for example,
to always return True.

gcc/ada/ChangeLog:

* exp_attr.adb
(Build_Array_VS_Func and Build_Record_VS_Func): Pass in the
Attr as the Related_Node parametr when calling
Make_Temporary for the Func_Id for the array and record
Valid_Scalars local functions.
gcc/ada/exp_attr.adb