aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@gcc.gnu.org>2011-09-01 15:21:23 +0200
committerArnaud Charlet <charlet@gcc.gnu.org>2011-09-01 15:21:23 +0200
commitd1c5f4243e66f7d2c70dcebf88a4d91f2e019bcc (patch)
treef4b74c551490e0f742dfde5aa5c529016fd19b35 /gcc/ada
parent1bb6e262cf96060be3098d2089c1fe059e73dedd (diff)
downloadgcc-d1c5f4243e66f7d2c70dcebf88a4d91f2e019bcc.zip
gcc-d1c5f4243e66f7d2c70dcebf88a4d91f2e019bcc.tar.gz
gcc-d1c5f4243e66f7d2c70dcebf88a4d91f2e019bcc.tar.bz2
[multiple changes]
2011-09-01 Robert Dewar <dewar@adacore.com> * prj-proc.adb, exp_ch6.adb, prj-env.adb: Minor reformatting. 2011-09-01 Bob Duff <duff@adacore.com> * sem_aggr.adb (Resolve_Aggregate): Need to treat "in instance body" the same as "in inlined body", because visibility shouldn't apply there. 2011-09-01 Eric Botcazou <ebotcazou@adacore.com> * inline.adb (Add_Inlined_Body): Refine previous change. From-SVN: r178412
Diffstat (limited to 'gcc/ada')
-rw-r--r--gcc/ada/ChangeLog14
-rw-r--r--gcc/ada/exp_ch6.adb1
-rw-r--r--gcc/ada/inline.adb7
-rw-r--r--gcc/ada/prj-env.adb10
-rw-r--r--gcc/ada/prj-proc.adb18
-rw-r--r--gcc/ada/sem_aggr.adb2
6 files changed, 36 insertions, 16 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index 83cf332..7e70cf7 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,3 +1,17 @@
+2011-09-01 Robert Dewar <dewar@adacore.com>
+
+ * prj-proc.adb, exp_ch6.adb, prj-env.adb: Minor reformatting.
+
+2011-09-01 Bob Duff <duff@adacore.com>
+
+ * sem_aggr.adb (Resolve_Aggregate): Need to treat "in instance
+ body" the same as "in inlined body", because visibility shouldn't
+ apply there.
+
+2011-09-01 Eric Botcazou <ebotcazou@adacore.com>
+
+ * inline.adb (Add_Inlined_Body): Refine previous change.
+
2011-09-01 Gary Dismukes <dismukes@adacore.com>
* exp_ch6.ads (Needs_BIP_Alloc_Form): New utility function.
diff --git a/gcc/ada/exp_ch6.adb b/gcc/ada/exp_ch6.adb
index eb74c12..b156a4f 100644
--- a/gcc/ada/exp_ch6.adb
+++ b/gcc/ada/exp_ch6.adb
@@ -7845,7 +7845,6 @@ package body Exp_Ch6 is
function Needs_BIP_Alloc_Form (Func_Id : Entity_Id) return Boolean is
pragma Assert (Is_Build_In_Place_Function (Func_Id));
Func_Typ : constant Entity_Id := Underlying_Type (Etype (Func_Id));
-
begin
return not Is_Constrained (Func_Typ) or else Is_Tagged_Type (Func_Typ);
end Needs_BIP_Alloc_Form;
diff --git a/gcc/ada/inline.adb b/gcc/ada/inline.adb
index 53369ea..98bbbf0 100644
--- a/gcc/ada/inline.adb
+++ b/gcc/ada/inline.adb
@@ -342,11 +342,12 @@ package body Inline is
null;
-- Do not inline the package if the subprogram is an init. proc
- -- because in that case the body appears in the same unit that
- -- declares the type, which will be compiled in any case.
+ -- or other internally generated subprogram, because in that
+ -- case the subprogram body appears in the same unit that
+ -- declares the type, and that body is visible to the back end.
elsif not Is_Inlined (Pack)
- and then not Is_Init_Proc (E)
+ and then Comes_From_Source (E)
then
Set_Is_Inlined (Pack);
Inlined_Bodies.Increment_Last;
diff --git a/gcc/ada/prj-env.adb b/gcc/ada/prj-env.adb
index 68965ab..6dcee66 100644
--- a/gcc/ada/prj-env.adb
+++ b/gcc/ada/prj-env.adb
@@ -836,19 +836,18 @@ package body Prj.Env is
or else Source.Unit /= No_Unit_Index)
then
if Source.Unit /= No_Unit_Index then
+
-- Put the encoded unit name in the name buffer
declare
Uname : constant String :=
- Get_Name_String (Source.Unit.Name);
+ Get_Name_String (Source.Unit.Name);
begin
Name_Len := 0;
-
for J in Uname'Range loop
if Uname (J) in Upper_Half_Character then
Store_Encoded_Character (Get_Char_Code (Uname (J)));
-
else
Add_Char_To_Name_Buffer (Uname (J));
end if;
@@ -879,8 +878,7 @@ package body Prj.Env is
end case;
if Suffix /= No_File then
- Add_Str_To_Name_Buffer
- (Get_Name_String (Suffix));
+ Add_Str_To_Name_Buffer (Get_Name_String (Suffix));
end if;
end if;
@@ -907,6 +905,8 @@ package body Prj.Env is
procedure For_Every_Imported_Project is new
For_Every_Project_Imported (State => Integer, Action => Process);
+ -- Local variables
+
Dummy : Integer := 0;
-- Start of processing for Create_Mapping_File
diff --git a/gcc/ada/prj-proc.adb b/gcc/ada/prj-proc.adb
index 251b86d..b5869b2 100644
--- a/gcc/ada/prj-proc.adb
+++ b/gcc/ada/prj-proc.adb
@@ -2765,6 +2765,7 @@ package body Prj.Proc is
Project := Processed_Projects.Get (Name);
if Project /= No_Project then
+
-- Make sure that, when a project is extended, the project id
-- of the project extending it is recorded in its data, even
-- when it has already been processed as an imported project.
@@ -2777,13 +2778,16 @@ package body Prj.Proc is
return;
end if;
- Project := new Project_Data'
- (Empty_Project
- (Project_Qualifier_Of
+ Project :=
+ new Project_Data'
+ (Empty_Project
+ (Project_Qualifier_Of
(From_Project_Node, From_Project_Node_Tree)));
- In_Tree.Projects := new Project_List_Element'
- (Project => Project,
- Next => In_Tree.Projects);
+
+ In_Tree.Projects :=
+ new Project_List_Element'
+ (Project => Project,
+ Next => In_Tree.Projects);
Processed_Projects.Set (Name, Project);
@@ -2833,10 +2837,12 @@ package body Prj.Proc is
and then In_Tree.Is_Root_Tree
then
Initialize_And_Copy (Child_Env, Copy_From => Env);
+
else
-- No need to initialize Child_Env, since it will not be
-- used anyway by Process_Declarative_Items (only the root
-- aggregate can modify it, and it is never read anyway).
+
null;
end if;
diff --git a/gcc/ada/sem_aggr.adb b/gcc/ada/sem_aggr.adb
index d4ea223..cdfaede 100644
--- a/gcc/ada/sem_aggr.adb
+++ b/gcc/ada/sem_aggr.adb
@@ -1229,7 +1229,7 @@ package body Sem_Aggr is
elsif Is_Private_Type (Typ)
and then Present (Full_View (Typ))
- and then In_Inlined_Body
+ and then (In_Inlined_Body or else In_Instance_Body)
and then Is_Composite_Type (Full_View (Typ))
then
Resolve (N, Full_View (Typ));