[Ada] Disable name generation for External_Tag and Expanded_Name
In order to avoid exposing internal names of tagged types in the
binary code generated by the compiler this enhancement facilitates
initializes the External_Tag of a tagged type with an empty string
when pragma No_Tagged_Streams is applicable to the tagged type, and
facilitates initializes its Expanded_Name with an empty string when
pragma Discard_Names is applicable to the tagged type.
This enhancement can be verified by means of the following small
test:
package Library_Level_Test is
type Typ_01 is tagged null record; -- Case 1: No pragmas
type Typ_02 is tagged null record; -- Case 2: Discard_Names
pragma Discard_Names (Typ_02);
pragma No_Tagged_Streams;
type Typ_03 is tagged null record; -- Case 3: No_Tagged_Streams
type Typ_04 is tagged null record; -- Case 4: Both pragmas
pragma Discard_Names (Typ_04);
end;
Commands:
gcc -c -gnatD library_level_test.ads
grep "\.TYP_" library_level_test.ads.dg
Output:
"LIBRARY_LEVEL_TEST.TYP_01["00"]";
"LIBRARY_LEVEL_TEST.TYP_02["00"]";
"LIBRARY_LEVEL_TEST.TYP_03["00"]";
2018-05-22 Javier Miranda <miranda@adacore.com>
gcc/ada/
* exp_disp.adb (Make_DT): Initialize the External_Tag with an empty
string when pragma No_Tagged_Streams is applicable to the tagged type,
and initialize the Expanded_Name with an empty string when pragma
Discard_Names is applicable to the tagged type.
From-SVN: r260528