mirror of git://gcc.gnu.org/git/gcc.git
[multiple changes]
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
This commit is contained in:
parent
5b1e6aca6a
commit
e526d0c765
|
|
@ -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>
|
2011-08-02 Robert Dewar <dewar@adacore.com>
|
||||||
|
|
||||||
* einfo.ads, einfo.adb (Suppress_Initialization): Replaces
|
* einfo.ads, einfo.adb (Suppress_Initialization): Replaces
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@
|
||||||
-- --
|
-- --
|
||||||
-- S p e c --
|
-- 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 --
|
-- 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- --
|
-- 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;
|
pragma Preelaborate;
|
||||||
|
|
||||||
subtype Big_String is String (1 .. Positive'Last);
|
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;
|
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
|
procedure Get_String
|
||||||
(U : Unbounded_String;
|
(U : Unbounded_String;
|
||||||
|
|
|
||||||
|
|
@ -2943,11 +2943,10 @@ package Einfo is
|
||||||
-- used to reference tasks implementing such interface.
|
-- used to reference tasks implementing such interface.
|
||||||
|
|
||||||
-- Materialize_Entity (Flag168)
|
-- Materialize_Entity (Flag168)
|
||||||
-- Present in all entities. Set only for constant or renamed entities
|
-- Present in all entities. Set only for renamed obects which should be
|
||||||
-- which should be materialized for debugging purposes. In the case of
|
-- materialized for debugging purposes. This means that a memory location
|
||||||
-- a constant, a memory location should be allocated containing the
|
-- containing the renamed address should be allocated. This is needed so
|
||||||
-- value. In the case of a renaming, a memory location containing the
|
-- that the debugger can find the entity.
|
||||||
-- renamed address should be allocated.
|
|
||||||
|
|
||||||
-- Mechanism (Uint8) (returned as Mechanism_Type)
|
-- Mechanism (Uint8) (returned as Mechanism_Type)
|
||||||
-- Present in functions and non-generic formal parameters. Indicates
|
-- Present in functions and non-generic formal parameters. Indicates
|
||||||
|
|
|
||||||
|
|
@ -34,6 +34,7 @@ with Exp_Ch6; use Exp_Ch6;
|
||||||
with Exp_Ch7; use Exp_Ch7;
|
with Exp_Ch7; use Exp_Ch7;
|
||||||
with Exp_Ch9; use Exp_Ch9;
|
with Exp_Ch9; use Exp_Ch9;
|
||||||
with Exp_Ch11; use Exp_Ch11;
|
with Exp_Ch11; use Exp_Ch11;
|
||||||
|
with Exp_Dbug; use Exp_Dbug;
|
||||||
with Exp_Disp; use Exp_Disp;
|
with Exp_Disp; use Exp_Disp;
|
||||||
with Exp_Dist; use Exp_Dist;
|
with Exp_Dist; use Exp_Dist;
|
||||||
with Exp_Smem; use Exp_Smem;
|
with Exp_Smem; use Exp_Smem;
|
||||||
|
|
@ -5215,6 +5216,26 @@ package body Exp_Ch3 is
|
||||||
|
|
||||||
Set_Renamed_Object (Defining_Identifier (N), Expr_Q);
|
Set_Renamed_Object (Defining_Identifier (N), Expr_Q);
|
||||||
Set_Analyzed (N);
|
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;
|
||||||
end if;
|
end if;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2875,10 +2875,12 @@ package body Exp_Ch4 is
|
||||||
|
|
||||||
-- Now we construct an array object with appropriate bounds. We mark
|
-- Now we construct an array object with appropriate bounds. We mark
|
||||||
-- the target as internal to prevent useless initialization when
|
-- 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');
|
Ent := Make_Temporary (Loc, 'S');
|
||||||
Set_Is_Internal (Ent);
|
Set_Is_Internal (Ent);
|
||||||
|
Set_Needs_Debug_Info (Ent);
|
||||||
|
|
||||||
-- If the bound is statically known to be out of range, we do not want
|
-- 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
|
-- to abort, we want a warning and a runtime constraint error. Note that
|
||||||
|
|
|
||||||
|
|
@ -1082,7 +1082,8 @@ package Exp_Dbug is
|
||||||
function Debug_Renaming_Declaration (N : Node_Id) return Node_Id;
|
function Debug_Renaming_Declaration (N : Node_Id) return Node_Id;
|
||||||
-- The argument N is a renaming declaration. The result is a variable
|
-- 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
|
-- 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 --
|
-- Packed Array Encoding --
|
||||||
|
|
|
||||||
|
|
@ -5995,10 +5995,17 @@ package body Exp_Disp is
|
||||||
|
|
||||||
-- Check_TSD (TSD'Unrestricted_Access);
|
-- 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
|
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)
|
and then RTE_Available (RE_Check_TSD)
|
||||||
then
|
then
|
||||||
Append_To (Elab_Code,
|
Append_To (Elab_Code,
|
||||||
|
|
|
||||||
|
|
@ -5874,15 +5874,16 @@ package body Freeze is
|
||||||
-- tested for because predefined String types are initialized by inline
|
-- tested for because predefined String types are initialized by inline
|
||||||
-- code rather than by an init_proc). Note that we do not give the
|
-- code rather than by an init_proc). Note that we do not give the
|
||||||
-- warning for Initialize_Scalars, since we suppressed initialization
|
-- 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)
|
if Present (Expr)
|
||||||
and then not Is_Imported (Ent)
|
and then not Is_Imported (Ent)
|
||||||
|
and then not Initialization_Suppressed (Typ)
|
||||||
and then (Has_Non_Null_Base_Init_Proc (Typ)
|
and then (Has_Non_Null_Base_Init_Proc (Typ)
|
||||||
or else Is_Access_Type (Typ)
|
or else Is_Access_Type (Typ)
|
||||||
or else (Normalize_Scalars
|
or else (Normalize_Scalars
|
||||||
and then (Is_Scalar_Type (Typ)
|
and then (Is_Scalar_Type (Typ)
|
||||||
or else Is_String_Type (Typ))))
|
or else Is_String_Type (Typ))))
|
||||||
then
|
then
|
||||||
if Nkind (Expr) = N_Attribute_Reference
|
if Nkind (Expr) = N_Attribute_Reference
|
||||||
and then Is_Entity_Name (Prefix (Expr))
|
and then Is_Entity_Name (Prefix (Expr))
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@
|
||||||
-- --
|
-- --
|
||||||
-- S p e c --
|
-- 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 --
|
-- 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- --
|
-- 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;
|
P : out Natural;
|
||||||
Names : String;
|
Names : String;
|
||||||
Indexes : System.Address);
|
Indexes : System.Address);
|
||||||
-- Identical to Set_Image_Enumeration_8 except that it handles types
|
-- Identical to Set_Image_Enumeration_8 except that it handles types using
|
||||||
-- using array (0 .. Num) of Natural_16 for the Indexes table.
|
-- array (0 .. Num) of Natural_16 for the Indexes table.
|
||||||
|
|
||||||
procedure Image_Enumeration_32
|
procedure Image_Enumeration_32
|
||||||
(Pos : Natural;
|
(Pos : Natural;
|
||||||
|
|
@ -79,7 +79,7 @@ package System.Img_Enum_New is
|
||||||
P : out Natural;
|
P : out Natural;
|
||||||
Names : String;
|
Names : String;
|
||||||
Indexes : System.Address);
|
Indexes : System.Address);
|
||||||
-- Identical to Set_Image_Enumeration_8 except that it handles types
|
-- Identical to Set_Image_Enumeration_8 except that it handles types using
|
||||||
-- using array (0 .. Num) of Natural_32 for the Indexes table.
|
-- array (0 .. Num) of Natural_32 for the Indexes table.
|
||||||
|
|
||||||
end System.Img_Enum_New;
|
end System.Img_Enum_New;
|
||||||
|
|
|
||||||
|
|
@ -57,9 +57,19 @@ package System.Standard_Library is
|
||||||
pragma Preelaborate_05;
|
pragma Preelaborate_05;
|
||||||
pragma Warnings (On);
|
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;
|
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
|
function To_Ptr is
|
||||||
new Ada.Unchecked_Conversion (System.Address, Big_String_Ptr);
|
new Ada.Unchecked_Conversion (System.Address, Big_String_Ptr);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue