aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/exp_dbug.adb
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@gcc.gnu.org>2014-07-29 15:30:02 +0200
committerArnaud Charlet <charlet@gcc.gnu.org>2014-07-29 15:30:02 +0200
commitab01e614837a76c828d7168bd34570beb69d7afc (patch)
treea13d4e97d170aea1ae20a7e9f582a348dce4a2bd /gcc/ada/exp_dbug.adb
parenta8b346d2ebe5538cf9492d101322620bbd4498d9 (diff)
downloadgcc-ab01e614837a76c828d7168bd34570beb69d7afc.zip
gcc-ab01e614837a76c828d7168bd34570beb69d7afc.tar.gz
gcc-ab01e614837a76c828d7168bd34570beb69d7afc.tar.bz2
[multiple changes]
2014-07-29 Robert Dewar <dewar@adacore.com> * einfo.adb (Derived_Type_Link): New function (Set_Derived_Type_Link): New procedure. (Write_Field31_Name): Output Derived_Type_Link. * einfo.ads: New field Derived_Type_Link. * exp_ch6.adb (Expand_Call): Warn if change of representation needed on call. * sem_ch13.adb: Minor addition of ??? comment. (Rep_Item_Too_Late): Warn on case that is legal but could cause an expensive implicit conversion. * sem_ch3.adb (Build_Derived_Type): Set Derived_Type_Link if needed. 2014-07-29 Hristian Kirtchev <kirtchev@adacore.com> * exp_ch3.adb (Build_Init_Procedure): Renamed Local_DF_Id to DF_Id. Add new local variable DF_Call. Do not perform any elaboration-related checks on the call to the partial finalization routine within an init proc to avoid generating bogus elaboration warnings on expansion-related code. * sem_elab.adb (Check_A_Call): Move constant Access_Case to the top level of the routine. Ensure that Output_Calls takes into account flags -gnatel and -gnatwl when emitting warnings or info messages. (Check_Internal_Call_Continue): Update the call to Output_Calls. (Elab_Warning): Moved to the top level of routine Check_A_Call. (Emit): New routines. (Output_Calls): Add new formal parameter Check_Elab_Flag along with a comment on usage. Output all warnings or info messages only when the caller context demands it and the proper elaboration flag is set. 2014-07-29 Yannick Moy <moy@adacore.com> * sem_attr.adb (Analyze_Attribute/Attribute_Old): Check rule about Old appearing in potentially unevaluated expression everywhere, not only in Post. 2014-07-29 Arnaud Charlet <charlet@adacore.com> * sem_prag.adb: Update comment. * a-except.adb, a-except-2005.adb: Minor editing. 2014-07-29 Pierre-Marie Derodat <derodat@adacore.com> * exp_dbug.adb (Debug_Renaming_Declaration): Do not create renaming entities for renamings of non-packed objects and for exceptions. From-SVN: r213175
Diffstat (limited to 'gcc/ada/exp_dbug.adb')
-rw-r--r--gcc/ada/exp_dbug.adb36
1 files changed, 36 insertions, 0 deletions
diff --git a/gcc/ada/exp_dbug.adb b/gcc/ada/exp_dbug.adb
index e184cb6..5e0d614 100644
--- a/gcc/ada/exp_dbug.adb
+++ b/gcc/ada/exp_dbug.adb
@@ -306,6 +306,16 @@ package body Exp_Dbug is
Obj : Entity_Id;
Res : Node_Id;
+ Enable : Boolean := Nkind (N) = N_Package_Renaming_Declaration;
+ -- By default, we do not generate an encoding for renaming. This is
+ -- however done (in which case this is set to True) in a few cases:
+ -- - when a package is renamed,
+ -- - when the renaming involves a packed array,
+ -- - when the renaming involves a packed record.
+
+ procedure Enable_If_Packed_Array (N : Node_Id);
+ -- Enable encoding generation if N is a packed array
+
function Output_Subscript (N : Node_Id; S : String) return Boolean;
-- Outputs a single subscript value as ?nnn (subscript is compile time
-- known value with value nnn) or as ?e (subscript is local constant
@@ -314,6 +324,21 @@ package body Exp_Dbug is
-- output in one of these two forms. The result is prepended to the
-- name stored in Name_Buffer.
+ ----------------------------
+ -- Enable_If_Packed_Array --
+ ----------------------------
+
+ procedure Enable_If_Packed_Array (N : Node_Id) is
+ T : constant Entity_Id := Etype (N);
+ begin
+ Enable :=
+ (Enable
+ or else
+ (Ekind (T) in Array_Kind
+ and then
+ Present (Packed_Array_Impl_Type (T))));
+ end Enable_If_Packed_Array;
+
----------------------
-- Output_Subscript --
----------------------
@@ -372,6 +397,8 @@ package body Exp_Dbug is
exit;
when N_Selected_Component =>
+ Enable :=
+ Enable or else Is_Packed (Etype (Prefix (Ren)));
Prepend_String_To_Buffer
(Get_Name_String (Chars (Selector_Name (Ren))));
Prepend_String_To_Buffer ("XR");
@@ -382,6 +409,7 @@ package body Exp_Dbug is
X : Node_Id := Last (Expressions (Ren));
begin
+ Enable_If_Packed_Array (Prefix (Ren));
while Present (X) loop
if not Output_Subscript (X, "XS") then
Set_Materialize_Entity (Ent);
@@ -396,6 +424,7 @@ package body Exp_Dbug is
when N_Slice =>
+ Enable_If_Packed_Array (Prefix (Ren));
Typ := Etype (First_Index (Etype (Nam)));
if not Output_Subscript (Type_High_Bound (Typ), "XS") then
@@ -422,6 +451,13 @@ package body Exp_Dbug is
end case;
end loop;
+ -- If we found no reason here to emit an encoding, stop now.
+
+ if not Enable then
+ Set_Materialize_Entity (Ent);
+ return Empty;
+ end if;
+
Prepend_String_To_Buffer ("___XE");
-- Include the designation of the form of renaming