aboutsummaryrefslogtreecommitdiff
path: root/gcc/gcc.c
diff options
context:
space:
mode:
authorSteve Baird <baird@adacore.com>2021-04-29 11:44:29 -0700
committerPierre-Marie de Rodat <derodat@adacore.com>2021-07-05 13:09:16 +0000
commit77630ba95a5b0220fdbb460727cf12e45a0c1115 (patch)
tree38c37a7e60a99d7bc1ef8f123e1a6a146acc71aa /gcc/gcc.c
parent6cf7cc8ccf3a7f34c1772f8da11a1c127fee3363 (diff)
downloadgcc-77630ba95a5b0220fdbb460727cf12e45a0c1115.zip
gcc-77630ba95a5b0220fdbb460727cf12e45a0c1115.tar.gz
gcc-77630ba95a5b0220fdbb460727cf12e45a0c1115.tar.bz2
[Ada] Fix some "current instance" bugs
gcc/ada/ * exp_ch3.adb (Build_Record_Init_Proc.Build_Assignment): When building the assignment statement corresponding to the default expression for a component, we make a copy of the expression. When making that copy (and if we have seen a component that requires late initialization), pass a Map parameter into the call to New_Copy_Tree to redirect references to the type to instead refer to the _Init formal parameter of the init proc. This includes hoisting the declaration of Has_Late_Init_Comp out one level so that it becomes available to Build_Assignment. (Find_Current_Instance): Return True for other kinds of current instance references, instead of just access-valued attribute references such as T'Access. * sem_util.adb (Is_Aliased_View): Return True for the _Init formal parameter of an init procedure. The changes in exp_ch3.adb can have the effect of replacing a "T'Access" attribute reference in an init procedure with an "_Init'Access" attribute reference. We want such an attribute reference to be legal. However, we do not simply mark the formal parameter as being aliased because that might impact callers. (Is_Object_Image): Return True if Is_Current_Instance returns True for the prefix of an Image (or related attribute) attribute reference.
Diffstat (limited to 'gcc/gcc.c')
0 files changed, 0 insertions, 0 deletions