[Ada] Fix crash on extension of private type with -gnatRj
This fixes a crash (or an assertion failure) during the processing done
for -gnatRj on the declaration of an extension of a private type.
Generally speaking, extension declarations are delicate in this context
because the front-end does not duplicate the structure of the parent
type, so the processing required to output the structural layout needs
to go up to the declaration of the parent type, which may or may not be
available or usable.
The change also makes the processing more robust by falling back to the
flat layout if the declaration of the parent type cannot be processed.
2019-07-08 Eric Botcazou <ebotcazou@adacore.com>
gcc/ada/
* repinfo.adb (List_Record_Info): Declare Incomplete_Layout and
Not_In_Extended_Main local exceptions.
(List_Structural_Record_Layout): For an extension, raise the
former if the parent subtype has not been built and the latter
if it is not declared in the main source unit. Fall back to the
flat layout if either exception has been raised.
From-SVN: r273206