summaryrefslogtreecommitdiff
path: root/gcc/ada/exp_ch13.adb
diff options
context:
space:
mode:
authorRobert Dewar <dewar@adacore.com>2006-10-31 19:10:11 +0100
committerArnaud Charlet <charlet@gcc.gnu.org>2006-10-31 19:10:11 +0100
commit9b0986f8589f13684a6899875f8c73f42aab775a (patch)
tree1ab2574211b34dd8c350e9a371fcdd68bd7f7965 /gcc/ada/exp_ch13.adb
parent60573ca25ab315e4825a035ef67d59a23e645b52 (diff)
downloadgcc-9b0986f8589f13684a6899875f8c73f42aab775a.tar.gz
sem_util.ads, [...] (Enter_Name): Exclude -gnatwh warning messages for entities in packages which are not used.
2006-10-31 Robert Dewar <dewar@adacore.com> Hristian Kirtchev <kirtchev@adacore.com> Ed Schonberg <schonberg@adacore.com> * sem_util.ads, sem_util.adb (Enter_Name): Exclude -gnatwh warning messages for entities in packages which are not used. (Collect_Synchronized_Interfaces): New procedure. (Overrides_Synchronized_Primitive): New function. (Denotes_Discriminant): Extend predicate to apply to task types. Add missing continuation marks in error msgs (Unqualify): New function for removing zero or more levels of qualification from an expression. There are numerous places where this ought to be used, but we currently only deal properly with zero or one level. (In_Instance); The analysis of the actuals in the instantiation of a child unit is not within an instantiation, even though the parent instance is on the scope stack. (Safe_To_Capture_Value): Exclude the case of variables that are renamings. (Check_Obsolescent): Removed (Is_Aliased_View): A reference to an enclosing instance in an aggregate is an aliased view, even when rewritten as a reference to the target object in an assignment. (Get_Subprogram_Entity): New function (Known_To_Be_Assigned): New function (Type_Access_Level): Compute properly the access level of a return subtype that is an anonymous access type. (Explain_Limited_Type): Correct use of "\" for continuation messages. (Is_Transfer): The new extended_return_statement causes a transfer of control. (Has_Preelaborable_Initialization): New function (Has_Null_Exclusion): New function. Given a node N, determine whether it has a null exclusion depending on its Nkind. Change Is_Lvalue to May_Be_Lvalue (May_Be_Lvalue): Extensive additional code to deal with subprogram arguments (IN parameters are not Lvalues, IN OUT parameters are). (Safe_To_Capture_Value): Extend functionality so it can be used for the current value condition case. (Has_Compatible_Alignment): New function (Is_Dependent_Component_Of_Mutable_Object): Revise the tests for mutable objects to handle the Ada 2005 case, where aliasedness no longer implies that the object is constrained. In particular, for dereferenced names, the designated object must be assumed to be unconstrained. (Kill_Current_Values): Properly deal with the case where we encounter a loop in the scope chain. (Safe_To_Capture_Value): Do not let a loop stop us from capturing a value. (Compile_Time_Constraint_Error): Improve error message in error case * exp_ch13.adb (Expand_N_Freeze_Entity): Remove the freezing node associated with entities of abstract interface primitives. Call Apply_Address_Clause_Check instead of Apply_Alignment_Check From-SVN: r118312
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