]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
[multiple changes]
authorArnaud Charlet <charlet@gcc.gnu.org>
Tue, 2 Aug 2011 14:39:06 +0000 (16:39 +0200)
committerArnaud Charlet <charlet@gcc.gnu.org>
Tue, 2 Aug 2011 14:39:06 +0000 (16:39 +0200)
2011-08-02  Javier Miranda  <miranda@adacore.com>

* exp_disp.adb (Make_DT): Generate call to Check_TSD in Ada 2005 mode.

2011-08-02  Robert Dewar  <dewar@adacore.com>

* s-imenne.ads: Minor reformatting.

2011-08-02  Robert Dewar  <dewar@adacore.com>

* a-stunau.ads: Add pragma Suppress_Initialization for Big_String
* freeze.adb (Warn_Overlay): Don't warn if initialization suppressed
* s-stalib.ads: Add pragma Suppress_Initialization for Big_String

2011-08-02  Robert Dewar  <dewar@adacore.com>

* einfo.ads (Materialize_Entity): Document this is only for renamings
* exp_ch3.adb (Expand_N_Object_Declaration): Make sure we generate
required debug information in the case where we transform the object
declaration into a renaming declaration.
* exp_ch4.adb (Expand_Concatenate): Generate debug info for result
object
* exp_dbug.ads (Debug_Renaming_Declaration): Document setting of
Materialize_Entity.

From-SVN: r177162

gcc/ada/ChangeLog
gcc/ada/a-stunau.ads
gcc/ada/einfo.ads
gcc/ada/exp_ch3.adb
gcc/ada/exp_ch4.adb
gcc/ada/exp_dbug.ads
gcc/ada/exp_disp.adb
gcc/ada/freeze.adb
gcc/ada/s-imenne.ads
gcc/ada/s-stalib.ads

index 9f6b629264f09143baf6cf20a97de4b1679d66da..61efaa8bdb0ab9836f34e2e96ce9531ebfe8b165 100644 (file)
@@ -1,3 +1,28 @@
+2011-08-02  Javier Miranda  <miranda@adacore.com>
+
+       * exp_disp.adb (Make_DT): Generate call to Check_TSD in Ada 2005 mode.
+
+2011-08-02  Robert Dewar  <dewar@adacore.com>
+
+       * s-imenne.ads: Minor reformatting.
+
+2011-08-02  Robert Dewar  <dewar@adacore.com>
+
+       * a-stunau.ads: Add pragma Suppress_Initialization for Big_String
+       * freeze.adb (Warn_Overlay): Don't warn if initialization suppressed
+       * s-stalib.ads: Add pragma Suppress_Initialization for Big_String
+
+2011-08-02  Robert Dewar  <dewar@adacore.com>
+
+       * einfo.ads (Materialize_Entity): Document this is only for renamings
+       * exp_ch3.adb (Expand_N_Object_Declaration): Make sure we generate
+       required debug information in the case where we transform the object
+       declaration into a renaming declaration.
+       * exp_ch4.adb (Expand_Concatenate): Generate debug info for result
+       object
+       * exp_dbug.ads (Debug_Renaming_Declaration): Document setting of
+       Materialize_Entity.
+
 2011-08-02  Robert Dewar  <dewar@adacore.com>
 
        * einfo.ads, einfo.adb (Suppress_Initialization): Replaces
index 8cff44f715178f25e207c89320367ce3a42278cd..fa82740b7de6da9c617f9224a42438de695e2902 100644 (file)
@@ -6,7 +6,7 @@
 --                                                                          --
 --                                 S p e c                                  --
 --                                                                          --
---          Copyright (C) 1992-2009, Free Software Foundation, Inc.         --
+--          Copyright (C) 1992-2010, Free Software Foundation, Inc.         --
 --                                                                          --
 -- GNAT is free software;  you can  redistribute it  and/or modify it under --
 -- terms of the  GNU General Public License as published  by the Free Soft- --
@@ -38,7 +38,18 @@ package Ada.Strings.Unbounded.Aux is
    pragma Preelaborate;
 
    subtype Big_String is String (1 .. Positive'Last);
+   pragma Suppress_Initialization (Big_String);
+   --  Type used to obtain string access to given address. Initialization is
+   --  suppressed, since we never want to have variables of this type, and
+   --  we never want to attempt initialiazation of virtual variables of this
+   --  type (e.g. when pragma Normalize_Scalars is used).
+
    type Big_String_Access is access all Big_String;
+   for Big_String_Access'Storage_Size use 0;
+   --  We use this access type to pass a pointer to an area of storage to be
+   --  accessed as a string. Of course when this pointer is used, it is the
+   --  responsibility of the accessor to ensure proper bounds. The storage
+   --  size clause ensures we do not allocate variables of this type.
 
    procedure Get_String
      (U : Unbounded_String;
index e070e5ea4f17c91ab13c66ca35e54c32e39cc648..ae8921269d92a7ebde91fa3f284c6e119fdbf0f2 100644 (file)
@@ -2943,11 +2943,10 @@ package Einfo is
 --       used to reference tasks implementing such interface.
 
 --    Materialize_Entity (Flag168)
---       Present in all entities. Set only for constant or renamed entities
---       which should be materialized for debugging purposes. In the case of
---       a constant, a memory location should be allocated containing the
---       value. In the case of a renaming, a memory location containing the
---       renamed address should be allocated.
+--       Present in all entities. Set only for renamed obects which should be
+--       materialized for debugging purposes. This means that a memory location
+--       containing the renamed address should be allocated. This is needed so
+--       that the debugger can find the entity.
 
 --    Mechanism (Uint8) (returned as Mechanism_Type)
 --       Present in functions and non-generic formal parameters. Indicates
index eb1c6dc81486b6120b766521cd271a253e33deb6..561b138cc711e8f02e1c55343ee600ca64dc3816 100644 (file)
@@ -34,6 +34,7 @@ with Exp_Ch6;  use Exp_Ch6;
 with Exp_Ch7;  use Exp_Ch7;
 with Exp_Ch9;  use Exp_Ch9;
 with Exp_Ch11; use Exp_Ch11;
+with Exp_Dbug; use Exp_Dbug;
 with Exp_Disp; use Exp_Disp;
 with Exp_Dist; use Exp_Dist;
 with Exp_Smem; use Exp_Smem;
@@ -5215,6 +5216,26 @@ package body Exp_Ch3 is
 
             Set_Renamed_Object (Defining_Identifier (N), Expr_Q);
             Set_Analyzed (N);
+
+            --  We do need to deal with debug issues for this renaming
+
+            --  First, if entity comes from source, then mark it as needing
+            --  debug information, even though it is defined by a generated
+            --  renaming that does not come from source.
+
+            if Comes_From_Source (Defining_Identifier (N)) then
+               Set_Needs_Debug_Info (Defining_Identifier (N));
+            end if;
+
+            --  Now call the routine to generate debug info for the renaming
+
+            declare
+               Decl : constant Node_Id := Debug_Renaming_Declaration (N);
+            begin
+               if Present (Decl) then
+                  Insert_Action (N, Decl);
+               end if;
+            end;
          end if;
       end if;
 
index 85e9d572ba49438b317cc28b5c93fdaeb356d10f..e92e1062a8ebf3d221b5b5f3887a248b725b1bec 100644 (file)
@@ -2875,10 +2875,12 @@ package body Exp_Ch4 is
 
       --  Now we construct an array object with appropriate bounds. We mark
       --  the target as internal to prevent useless initialization when
-      --  Initialize_Scalars is enabled.
+      --  Initialize_Scalars is enabled. Also since this is the actual result
+      --  entity, we make sure we have debug information for the result.
 
       Ent := Make_Temporary (Loc, 'S');
       Set_Is_Internal (Ent);
+      Set_Needs_Debug_Info (Ent);
 
       --  If the bound is statically known to be out of range, we do not want
       --  to abort, we want a warning and a runtime constraint error. Note that
index 5dcbd91488e14861b9f59f2781efa9b0e7373887..ac722d7876f2fee581668d5aa48e052c673503b4 100644 (file)
@@ -1082,7 +1082,8 @@ package Exp_Dbug is
    function Debug_Renaming_Declaration (N : Node_Id) return Node_Id;
    --  The argument N is a renaming declaration. The result is a variable
    --  declaration as described in the above paragraphs. If N is not a special
-   --  debug declaration, then Empty is returned.
+   --  debug declaration, then Empty is returned. This function also takes care
+   --  of setting Materialize_Entity on the renamed entity where required.
 
    ---------------------------
    -- Packed Array Encoding --
index 9a7b3308f9106eb6ba704d8d9ccf6d509ff2064d..541abe7b6aa53b8c4ef0e4a9c24e5dcba1d473e2 100644 (file)
@@ -5995,10 +5995,17 @@ package body Exp_Disp is
 
       --     Check_TSD (TSD'Unrestricted_Access);
 
-      --  Seems wrong to restrict this BI to Ada 2012 ???
+      --  This check is a consequence of AI05-0113-1/06, so it officially
+      --  applies to Ada 2005 (and Ada 2012). It might be argued that it is
+      --  a desirable check to add in Ada 95 mode, but we hesitate to make
+      --  this change, as it would be incompatible, and could conceivably
+      --  cause a problem in existing Aa 95 code.
+
+      --  We check for No_Run_Time_Mode here, because we do not want to pick
+      --  up the RE_Check_TSD entity and call it in No_Run_Time mode.
 
       if not No_Run_Time_Mode
-        and then Ada_Version >= Ada_2012
+        and then Ada_Version >= Ada_2005
         and then RTE_Available (RE_Check_TSD)
       then
          Append_To (Elab_Code,
index f1699db8a992cbc33aa5b6cad709a1462a3a2372..c9d47bd8a069ff931dc1aa0cd3609dab73872193 100644 (file)
@@ -5874,15 +5874,16 @@ package body Freeze is
       --  tested for because predefined String types are initialized by inline
       --  code rather than by an init_proc). Note that we do not give the
       --  warning for Initialize_Scalars, since we suppressed initialization
-      --  in this case.
+      --  in this case. Also, do not warn if Suppress_Initialization is set.
 
       if Present (Expr)
         and then not Is_Imported (Ent)
+        and then not Initialization_Suppressed (Typ)
         and then (Has_Non_Null_Base_Init_Proc (Typ)
-                    or else Is_Access_Type (Typ)
-                    or else (Normalize_Scalars
-                              and then (Is_Scalar_Type (Typ)
-                                         or else Is_String_Type (Typ))))
+                   or else Is_Access_Type (Typ)
+                   or else (Normalize_Scalars
+                             and then (Is_Scalar_Type (Typ)
+                                        or else Is_String_Type (Typ))))
       then
          if Nkind (Expr) = N_Attribute_Reference
            and then Is_Entity_Name (Prefix (Expr))
index a76883d6f4d302c127495d9b3777b6c7501b96b2..7d0c1141dfaadcee13a603b111fe9c13b8d9cdb5 100644 (file)
@@ -6,7 +6,7 @@
 --                                                                          --
 --                                 S p e c                                  --
 --                                                                          --
---          Copyright (C) 2000-2009, Free Software Foundation, Inc.         --
+--          Copyright (C) 2000-2010, Free Software Foundation, Inc.         --
 --                                                                          --
 -- GNAT is free software;  you can  redistribute it  and/or modify it under --
 -- terms of the  GNU General Public License as published  by the Free Soft- --
@@ -70,8 +70,8 @@ package System.Img_Enum_New is
       P       : out Natural;
       Names   : String;
       Indexes : System.Address);
-   --  Identical to Set_Image_Enumeration_8 except that it handles types
-   --  using array (0 .. Num) of Natural_16 for the Indexes table.
+   --  Identical to Set_Image_Enumeration_8 except that it handles types using
+   --  array (0 .. Num) of Natural_16 for the Indexes table.
 
    procedure Image_Enumeration_32
      (Pos     : Natural;
@@ -79,7 +79,7 @@ package System.Img_Enum_New is
       P       : out Natural;
       Names   : String;
       Indexes : System.Address);
-   --  Identical to Set_Image_Enumeration_8 except that it handles types
-   --  using array (0 .. Num) of Natural_32 for the Indexes table.
+   --  Identical to Set_Image_Enumeration_8 except that it handles types using
+   --  array (0 .. Num) of Natural_32 for the Indexes table.
 
 end System.Img_Enum_New;
index 6b3d8645c63be0a042eabd1d8c4df1487d262d2a..4f1b90a6ed6a564521d0916679df599d3cb34560 100644 (file)
@@ -57,9 +57,19 @@ package System.Standard_Library is
    pragma Preelaborate_05;
    pragma Warnings (On);
 
-   type Big_String_Ptr is access all String (Positive);
+   subtype Big_String is String (1 .. Positive'Last);
+   pragma Suppress_Initialization (Big_String);
+   --  Type used to obtain string access to given address. Initialization is
+   --  suppressed, since we never want to have variables of this type, and
+   --  we never want to attempt initialiazation of virtual variables of this
+   --  type (e.g. when pragma Normalize_Scalars is used).
+
+   type Big_String_Ptr is access all Big_String;
    for Big_String_Ptr'Storage_Size use 0;
-   --  A non-fat pointer type for null terminated strings
+   --  We use this access type to pass a pointer to an area of storage to be
+   --  accessed as a string. Of course when this pointer is used, it is the
+   --  responsibility of the accessor to ensure proper bounds. The storage
+   --  size clause ensures we do not allocate variables of this type.
 
    function To_Ptr is
      new Ada.Unchecked_Conversion (System.Address, Big_String_Ptr);