[Ada] Enhance output of discriminants with -gnatR in JSON mode
This arranges for the Discriminant_Number of discriminants to be output
by -gnatR in JSON mode. This number is referenced in symbolic expressions
present for offsets and sizes, so its definition is also required for the
sake of completeness.
2018-05-29 Eric Botcazou <ebotcazou@adacore.com>
gcc/ada/
* repinfo.ads (JSON format): Document new pair for components.
* repinfo.adb (Derived_Discriminant): New function.
(List_Structural_Record_Layout): Add Outer_Ent parameter and pass it
in recursive calls. If the record type is the parent of an extension,
find and list the derived discriminant from the extension, if any.
(List_Component_Layout): List the Discriminant_Number in JSON mode.
(List_Record_Info): Adjust call to List_Structural_Record_Layout.
From-SVN: r260869