mirror of git://gcc.gnu.org/git/gcc.git
[multiple changes]
2012-03-30 Hristian Kirtchev <kirtchev@adacore.com> * exp_util.adb (Is_Secondary_Stack_BIP_Func_Call): Handle a case where a build-in-place call appears as Prefix'Reference'Reference. 2012-03-30 Yannick Moy <moy@adacore.com> * lib-xref-alfa.adb: Minor refactoring to remove internal package. 2012-03-30 Hristian Kirtchev <kirtchev@adacore.com> * sem_ch5.adb (Analyze_Iteration_Scheme): Preanalyze the subtype definition of a loop when the context is a quantified expression. 2012-03-30 Vincent Celier <celier@adacore.com> * prj.ads: Minor comment update. From-SVN: r186005
This commit is contained in:
parent
ce5c2061b4
commit
e0adfeb41a
|
@ -1,3 +1,21 @@
|
||||||
|
2012-03-30 Hristian Kirtchev <kirtchev@adacore.com>
|
||||||
|
|
||||||
|
* exp_util.adb (Is_Secondary_Stack_BIP_Func_Call): Handle a case where
|
||||||
|
a build-in-place call appears as Prefix'Reference'Reference.
|
||||||
|
|
||||||
|
2012-03-30 Yannick Moy <moy@adacore.com>
|
||||||
|
|
||||||
|
* lib-xref-alfa.adb: Minor refactoring to remove internal package.
|
||||||
|
|
||||||
|
2012-03-30 Hristian Kirtchev <kirtchev@adacore.com>
|
||||||
|
|
||||||
|
* sem_ch5.adb (Analyze_Iteration_Scheme): Preanalyze the subtype
|
||||||
|
definition of a loop when the context is a quantified expression.
|
||||||
|
|
||||||
|
2012-03-30 Vincent Celier <celier@adacore.com>
|
||||||
|
|
||||||
|
* prj.ads: Minor comment update.
|
||||||
|
|
||||||
2012-03-30 Yannick Moy <moy@adacore.com>
|
2012-03-30 Yannick Moy <moy@adacore.com>
|
||||||
|
|
||||||
* lib-xref-alfa.adb, alloc.ads, lib-xref.ads: Minor addition of
|
* lib-xref-alfa.adb, alloc.ads, lib-xref.ads: Minor addition of
|
||||||
|
|
|
@ -4889,11 +4889,13 @@ package body Exp_Util is
|
||||||
Call : Node_Id := Expr;
|
Call : Node_Id := Expr;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
-- Build-in-place calls usually appear in 'reference format
|
-- Build-in-place calls usually appear in 'reference format. Note that
|
||||||
|
-- the accessibility check machinery may add an extra 'reference due to
|
||||||
|
-- side effect removal.
|
||||||
|
|
||||||
if Nkind (Call) = N_Reference then
|
while Nkind (Call) = N_Reference loop
|
||||||
Call := Prefix (Call);
|
Call := Prefix (Call);
|
||||||
end if;
|
end loop;
|
||||||
|
|
||||||
if Nkind_In (Call, N_Qualified_Expression,
|
if Nkind_In (Call, N_Qualified_Expression,
|
||||||
N_Unchecked_Type_Conversion)
|
N_Unchecked_Type_Conversion)
|
||||||
|
|
|
@ -336,57 +336,30 @@ package body Alfa is
|
||||||
|
|
||||||
package Sorting is new GNAT.Heap_Sort_G (Move, Lt);
|
package Sorting is new GNAT.Heap_Sort_G (Move, Lt);
|
||||||
|
|
||||||
-- Internal package to build a correspondance between entities and scope
|
|
||||||
-- numbers used in Alfa cross references.
|
|
||||||
|
|
||||||
package Scopes is
|
|
||||||
No_Scope : constant Nat := 0;
|
|
||||||
|
|
||||||
function Get_Scope_Num (N : Entity_Id) return Nat;
|
function Get_Scope_Num (N : Entity_Id) return Nat;
|
||||||
-- Return the scope number associated to entity N
|
-- Return the scope number associated to entity N
|
||||||
|
|
||||||
procedure Set_Scope_Num (N : Entity_Id; Num : Nat);
|
procedure Set_Scope_Num (N : Entity_Id; Num : Nat);
|
||||||
-- Associate entity N to scope number Num
|
-- Associate entity N to scope number Num
|
||||||
end Scopes;
|
|
||||||
|
|
||||||
------------
|
No_Scope : constant Nat := 0;
|
||||||
-- Scopes --
|
-- Initial scope counter
|
||||||
------------
|
|
||||||
|
|
||||||
package body Scopes is
|
type Scope_Rec is record
|
||||||
type Scope is record
|
|
||||||
Num : Nat;
|
Num : Nat;
|
||||||
Entity : Entity_Id;
|
Entity : Entity_Id;
|
||||||
end record;
|
end record;
|
||||||
|
-- Type used to relate an entity and a scope number
|
||||||
|
|
||||||
package Scopes is new GNAT.HTable.Simple_HTable
|
package Scopes is new GNAT.HTable.Simple_HTable
|
||||||
(Header_Num => Entity_Hashed_Range,
|
(Header_Num => Entity_Hashed_Range,
|
||||||
Element => Scope,
|
Element => Scope_Rec,
|
||||||
No_Element => (Num => No_Scope, Entity => Empty),
|
No_Element => (Num => No_Scope, Entity => Empty),
|
||||||
Key => Entity_Id,
|
Key => Entity_Id,
|
||||||
Hash => Entity_Hash,
|
Hash => Entity_Hash,
|
||||||
Equal => "=");
|
Equal => "=");
|
||||||
|
-- Package used to build a correspondance between entities and scope
|
||||||
-------------------
|
-- numbers used in Alfa cross references.
|
||||||
-- Get_Scope_Num --
|
|
||||||
-------------------
|
|
||||||
|
|
||||||
function Get_Scope_Num (N : Entity_Id) return Nat is
|
|
||||||
begin
|
|
||||||
return Scopes.Get (N).Num;
|
|
||||||
end Get_Scope_Num;
|
|
||||||
|
|
||||||
-------------------
|
|
||||||
-- Set_Scope_Num --
|
|
||||||
-------------------
|
|
||||||
|
|
||||||
procedure Set_Scope_Num (N : Entity_Id; Num : Nat) is
|
|
||||||
begin
|
|
||||||
Scopes.Set (K => N, E => Scope'(Num => Num, Entity => N));
|
|
||||||
end Set_Scope_Num;
|
|
||||||
end Scopes;
|
|
||||||
|
|
||||||
use Scopes;
|
|
||||||
|
|
||||||
Nrefs : Nat := Xrefs.Last;
|
Nrefs : Nat := Xrefs.Last;
|
||||||
-- Number of references in table. This value may get reset (reduced)
|
-- Number of references in table. This value may get reset (reduced)
|
||||||
|
@ -426,6 +399,15 @@ package body Alfa is
|
||||||
end case;
|
end case;
|
||||||
end Get_Entity_Type;
|
end Get_Entity_Type;
|
||||||
|
|
||||||
|
-------------------
|
||||||
|
-- Get_Scope_Num --
|
||||||
|
-------------------
|
||||||
|
|
||||||
|
function Get_Scope_Num (N : Entity_Id) return Nat is
|
||||||
|
begin
|
||||||
|
return Scopes.Get (N).Num;
|
||||||
|
end Get_Scope_Num;
|
||||||
|
|
||||||
-----------------------
|
-----------------------
|
||||||
-- Is_Alfa_Reference --
|
-- Is_Alfa_Reference --
|
||||||
-----------------------
|
-----------------------
|
||||||
|
@ -638,6 +620,15 @@ package body Alfa is
|
||||||
Rnums (Nat (To)) := Rnums (Nat (From));
|
Rnums (Nat (To)) := Rnums (Nat (From));
|
||||||
end Move;
|
end Move;
|
||||||
|
|
||||||
|
-------------------
|
||||||
|
-- Set_Scope_Num --
|
||||||
|
-------------------
|
||||||
|
|
||||||
|
procedure Set_Scope_Num (N : Entity_Id; Num : Nat) is
|
||||||
|
begin
|
||||||
|
Scopes.Set (K => N, E => Scope_Rec'(Num => Num, Entity => N));
|
||||||
|
end Set_Scope_Num;
|
||||||
|
|
||||||
------------------------
|
------------------------
|
||||||
-- Update_Scope_Range --
|
-- Update_Scope_Range --
|
||||||
------------------------
|
------------------------
|
||||||
|
|
|
@ -298,9 +298,26 @@ package Prj is
|
||||||
-- Type for the kind of language. All languages are file based, except Ada
|
-- Type for the kind of language. All languages are file based, except Ada
|
||||||
-- which is unit based.
|
-- which is unit based.
|
||||||
|
|
||||||
type Dependency_File_Kind is (None, Makefile, ALI_File, ALI_Closure);
|
-- Type of dependency to be checked
|
||||||
-- Type of dependency to be checked: no dependency file, Makefile fragment
|
|
||||||
-- or ALI file (for Ada). Please comment ALI_Closure ???
|
type Dependency_File_Kind is
|
||||||
|
(None,
|
||||||
|
-- There is no dependency file, the source must always be recompiled
|
||||||
|
|
||||||
|
Makefile,
|
||||||
|
-- The dependency file is a Makefile fragment indicating all the files
|
||||||
|
-- the source depends on. If the object file or the dependency file is
|
||||||
|
-- more recent than any of these files, the source must be recompiled.
|
||||||
|
|
||||||
|
ALI_File,
|
||||||
|
-- The dependency file is an ALI file and the source must be recompiled
|
||||||
|
-- if the object or ALI file is more recent than any of the sources
|
||||||
|
-- listed in the D lines.
|
||||||
|
|
||||||
|
ALI_Closure);
|
||||||
|
-- The dependency file is an ALI file and the source must be recompiled
|
||||||
|
-- if the object or ALI file is more recent than any source in the full
|
||||||
|
-- closure.
|
||||||
|
|
||||||
Makefile_Dependency_Suffix : constant String := ".d";
|
Makefile_Dependency_Suffix : constant String := ".d";
|
||||||
ALI_Dependency_Suffix : constant String := ".ali";
|
ALI_Dependency_Suffix : constant String := ".ali";
|
||||||
|
@ -472,6 +489,11 @@ package Prj is
|
||||||
-- are used to specify the object file. The object file name is appended
|
-- are used to specify the object file. The object file name is appended
|
||||||
-- to the last switch in the list. Example: ("-o", "").
|
-- to the last switch in the list. Example: ("-o", "").
|
||||||
|
|
||||||
|
Object_Path_Switches : Name_List_Index := No_Name_List;
|
||||||
|
-- List of switches to specify to the compiler the path name of a
|
||||||
|
-- temporary file containing the list of object directories in the
|
||||||
|
-- correct order.
|
||||||
|
|
||||||
Compilation_PIC_Option : Name_List_Index := No_Name_List;
|
Compilation_PIC_Option : Name_List_Index := No_Name_List;
|
||||||
-- The option(s) to compile a source in Position Independent Code for
|
-- The option(s) to compile a source in Position Independent Code for
|
||||||
-- shared libraries. Specified in the configuration. When not specified,
|
-- shared libraries. Specified in the configuration. When not specified,
|
||||||
|
@ -602,6 +624,7 @@ package Prj is
|
||||||
Source_File_Switches => No_Name_List,
|
Source_File_Switches => No_Name_List,
|
||||||
Object_File_Suffix => No_Name,
|
Object_File_Suffix => No_Name,
|
||||||
Object_File_Switches => No_Name_List,
|
Object_File_Switches => No_Name_List,
|
||||||
|
Object_Path_Switches => No_Name_List,
|
||||||
Compilation_PIC_Option => No_Name_List,
|
Compilation_PIC_Option => No_Name_List,
|
||||||
Object_Generated => True,
|
Object_Generated => True,
|
||||||
Objects_Linked => True,
|
Objects_Linked => True,
|
||||||
|
@ -1233,6 +1256,10 @@ package Prj is
|
||||||
-- The path name of the exec directory of this project file. Default is
|
-- The path name of the exec directory of this project file. Default is
|
||||||
-- equal to Object_Directory.
|
-- equal to Object_Directory.
|
||||||
|
|
||||||
|
Object_Path_File : Path_Name_Type := No_Path;
|
||||||
|
-- Store the name of the temporary file that contains the list of object
|
||||||
|
-- directories, when attribute Object_Path_Switches is declared.
|
||||||
|
|
||||||
-------------
|
-------------
|
||||||
-- Library --
|
-- Library --
|
||||||
-------------
|
-------------
|
||||||
|
|
|
@ -1972,11 +1972,14 @@ package body Sem_Ch5 is
|
||||||
N);
|
N);
|
||||||
end if;
|
end if;
|
||||||
|
|
||||||
-- Now analyze the subtype definition. If it is a range, create
|
-- Analyze the subtype definition and create temporaries for
|
||||||
-- temporaries for bounds.
|
-- the bounds. Do not evaluate the range when preanalyzing a
|
||||||
|
-- quantified expression because bounds expressed as function
|
||||||
|
-- calls with side effects will be erroneously replicated.
|
||||||
|
|
||||||
if Nkind (DS) = N_Range
|
if Nkind (DS) = N_Range
|
||||||
and then Expander_Active
|
and then Expander_Active
|
||||||
|
and then Nkind (Parent (N)) /= N_Quantified_Expression
|
||||||
then
|
then
|
||||||
Process_Bounds (DS);
|
Process_Bounds (DS);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue