summaryrefslogtreecommitdiff
path: root/gcc/ada/exp_ch13.adb
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/ada/exp_ch13.adb')
-rw-r--r--gcc/ada/exp_ch13.adb64
1 files changed, 35 insertions, 29 deletions
diff --git a/gcc/ada/exp_ch13.adb b/gcc/ada/exp_ch13.adb
index fd40084fbc1..258a60cd036 100644
--- a/gcc/ada/exp_ch13.adb
+++ b/gcc/ada/exp_ch13.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2005, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2006, 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- --
@@ -81,15 +81,14 @@ package body Exp_Ch13 is
when Attribute_Address =>
- -- If there is an initialization which did not come from
- -- the source program, then it is an artifact of our
- -- expansion, and we suppress it. The case we are most
- -- concerned about here is the initialization of a packed
- -- array to all false, which seems inappropriate for a
- -- variable to which an address clause is applied. The
- -- expression may itself have been rewritten if the type is a
- -- packed array, so we need to examine whether the original
- -- node is in the source.
+ -- If there is an initialization which did not come from the
+ -- source program, then it is an artifact of our expansion, and we
+ -- suppress it. The case we are most concerned about here is the
+ -- initialization of a packed array to all false, which seems
+ -- inappropriate for variable to which an address clause is
+ -- applied. The expression may itself have been rewritten if the
+ -- type is packed array, so we need to examine whether the
+ -- original node is in the source.
declare
Decl : constant Node_Id := Declaration_Node (Ent);
@@ -139,7 +138,6 @@ package body Exp_Ch13 is
-- assignment statement to initialze this value.
elsif Is_Access_Type (Ent) then
-
V := Make_Defining_Identifier (Loc,
New_External_Name (Chars (Ent), 'V'));
@@ -246,13 +244,14 @@ package body Exp_Ch13 is
Delete : Boolean := False;
begin
- -- For object, with address clause, check alignment is OK
+ -- Processing for objects with address clauses
- if Is_Object (E) then
- Apply_Alignment_Check (E, N);
+ if Is_Object (E) and then Present (Address_Clause (E)) then
+ Apply_Address_Clause_Check (E, N);
+ return;
- -- Only other items requiring any front end action are
- -- types and subprograms.
+ -- Only other items requiring any front end action are types and
+ -- subprograms.
elsif not Is_Type (E) and then not Is_Subprogram (E) then
return;
@@ -268,12 +267,12 @@ package body Exp_Ch13 is
return;
end if;
- -- If we are freezing entities defined in protected types, they
- -- belong in the enclosing scope, given that the original type
- -- has been expanded away. The same is true for entities in task types,
- -- in particular the parameter records of entries (Entities in bodies
- -- are all frozen within the body). If we are in the task body, this
- -- is a proper scope.
+ -- If we are freezing entities defined in protected types, they belong
+ -- in the enclosing scope, given that the original type has been
+ -- expanded away. The same is true for entities in task types, in
+ -- particular the parameter records of entries (Entities in bodies are
+ -- all frozen within the body). If we are in the task body, this is a
+ -- proper scope.
if Ekind (E_Scope) = E_Protected_Type
or else (Ekind (E_Scope) = E_Task_Type
@@ -349,19 +348,26 @@ package body Exp_Ch13 is
elsif Is_Subprogram (E) then
Freeze_Subprogram (N);
+
+ -- Ada 2005 (AI-251): Remove the freezing node associated with the
+ -- entities internally used by the frontend to register primitives
+ -- covering abstract interfaces. The call to Freeze_Subprogram has
+ -- already expanded the code that fills the corresponding entry in
+ -- its secondary dispatch table and therefore the code generator
+ -- has nothing else to do with this freezing node.
+
+ Delete := Present (Abstract_Interface_Alias (E));
end if;
- -- Analyze actions generated by freezing. The init_proc contains
- -- source expressions that may raise constraint_error, and the
- -- assignment procedure for complex types needs checks on individual
- -- component assignments, but all other freezing actions should be
- -- compiled with all checks off.
+ -- Analyze actions generated by freezing. The init_proc contains source
+ -- expressions that may raise Constraint_Error, and the assignment
+ -- procedure for complex types needs checks on individual component
+ -- assignments, but all other freezing actions should be compiled with
+ -- all checks off.
if Present (Actions (N)) then
Decl := First (Actions (N));
-
while Present (Decl) loop
-
if Nkind (Decl) = N_Subprogram_Body
and then (Is_Init_Proc (Defining_Entity (Decl))
or else