Commit 70f4ad20 by Arnaud Charlet

[multiple changes]

2012-06-12  Gary Dismukes  <dismukes@adacore.com>

	* projects.texi: Remove comments.

2012-06-12  Thomas Quinot  <quinot@adacore.com>

	* back_end.adb (Scan_Back_End_Switches): Treat -fdump-scos as
	synonym of -gnateS.
	(gnat_post_options): Disable gimple-based SCO generator.
	* gnat_ugn.texi: Document that -gnateS is an obsolete synonym
	of -fdump-scos.

2012-06-12  Ed Schonberg  <schonberg@adacore.com>

	* sem_ch6.adb (Different_Generic_Profile): new predicate for
	Find_Corresponding_Spec, to handle a rare case of accidental
	overloading in an instance, when the profile of a subprogram body
	that depends on a formal type becomes compatible with that of
	a homonym whose profile in the generic mentions the actual type.

2012-06-12  Thomas Quinot  <quinot@adacore.com>

	* gnat1drv.adb: Minor reformatting.

From-SVN: r188435
parent 15a5de99
2012-06-12 Gary Dismukes <dismukes@adacore.com>
* projects.texi: Remove comments.
2012-06-12 Thomas Quinot <quinot@adacore.com>
* back_end.adb (Scan_Back_End_Switches): Treat -fdump-scos as
synonym of -gnateS.
(gnat_post_options): Disable gimple-based SCO generator.
* gnat_ugn.texi: Document that -gnateS is an obsolete synonym
of -fdump-scos.
2012-06-12 Ed Schonberg <schonberg@adacore.com>
* sem_ch6.adb (Different_Generic_Profile): new predicate for
Find_Corresponding_Spec, to handle a rare case of accidental
overloading in an instance, when the profile of a subprogram body
that depends on a formal type becomes compatible with that of
a homonym whose profile in the generic mentions the actual type.
2012-06-12 Thomas Quinot <quinot@adacore.com>
* gnat1drv.adb: Minor reformatting.
2012-06-12 Ed Schonberg <schonberg@adacore.com> 2012-06-12 Ed Schonberg <schonberg@adacore.com>
* sem_util.adb (Build_Explicit_Dereference): If the expression * sem_util.adb (Build_Explicit_Dereference): If the expression
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- B o d y -- -- B o d y --
-- -- -- --
-- Copyright (C) 1992-2011, Free Software Foundation, Inc. -- -- Copyright (C) 1992-2012, 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- --
...@@ -219,23 +219,30 @@ package body Back_End is ...@@ -219,23 +219,30 @@ package body Back_End is
elsif Switch_Chars (First .. Last) = "quiet" then elsif Switch_Chars (First .. Last) = "quiet" then
null; null;
-- Store any other GCC switches -- Store any other GCC switches. Also do special processing for some
-- specific switches that the Ada front-end knows about.
else else
Store_Compilation_Switch (Switch_Chars); Store_Compilation_Switch (Switch_Chars);
-- Special check, the back end switch -fno-inline also sets the -- Back end switch -fno-inline also sets the Suppress_All_Inlining
-- front end flag to entirely inhibit all inlining. -- front end flag to entirely inhibit all inlining.
if Switch_Chars (First .. Last) = "fno-inline" then if Switch_Chars (First .. Last) = "fno-inline" then
Opt.Suppress_All_Inlining := True; Opt.Suppress_All_Inlining := True;
-- Another special check, the switch -fpreserve-control-flow -- Back end switch -fpreserve-control-flow also sets the front end
-- which is also a back end switch sets the front end flag -- flag that inhibits improper control flow transformations.
-- that inhibits improper control flow transformations.
elsif Switch_Chars (First .. Last) = "fpreserve-control-flow" then elsif Switch_Chars (First .. Last) = "fpreserve-control-flow" then
Opt.Suppress_Control_Flow_Optimizations := True; Opt.Suppress_Control_Flow_Optimizations := True;
-- Back end switcg -fdump-scos, which exists primarily for C, is
-- also accepted for Ada as a synonym of -gnateS.
elsif Switch_Chars (First .. Last) = "fdump-scos" then
Opt.Generate_SCO := True;
end if; end if;
end if; end if;
end Scan_Back_End_Switches; end Scan_Back_End_Switches;
......
...@@ -118,9 +118,7 @@ procedure Gnat1drv is ...@@ -118,9 +118,7 @@ procedure Gnat1drv is
-- Debug flag -gnatd.I is a synonym for Generate_SCIL and requires code -- Debug flag -gnatd.I is a synonym for Generate_SCIL and requires code
-- generation. -- generation.
if Debug_Flag_Dot_II if Debug_Flag_Dot_II and then Operating_Mode = Generate_Code then
and then Operating_Mode = Generate_Code
then
Generate_SCIL := True; Generate_SCIL := True;
end if; end if;
......
...@@ -4045,6 +4045,13 @@ Makes the compiler output callgraph information for the program, on a ...@@ -4045,6 +4045,13 @@ Makes the compiler output callgraph information for the program, on a
per-file basis. The information is generated in the VCG format. It can per-file basis. The information is generated in the VCG format. It can
be decorated with stack-usage per-node information. be decorated with stack-usage per-node information.
@item -fdump-scos
@cindex @option{-fdump-scos} (@command{gcc})
Generate SCO (Source Coverage Obligation) information in the ALI file.
This information is used by advanced coverage tools. See unit @file{SCOs}
in the compiler sources for details in files @file{scos.ads} and
@file{scos.adb}.
@item ^-g^/DEBUG^ @item ^-g^/DEBUG^
@cindex @option{^-g^/DEBUG^} (@command{gcc}) @cindex @option{^-g^/DEBUG^} (@command{gcc})
Generate debugging information. This information is stored in the object Generate debugging information. This information is stored in the object
...@@ -4201,12 +4208,10 @@ example a Pure unit cannot WITH a Preelaborate unit. If this switch is used, ...@@ -4201,12 +4208,10 @@ example a Pure unit cannot WITH a Preelaborate unit. If this switch is used,
these errors become warnings (which can be ignored, or suppressed in the usual these errors become warnings (which can be ignored, or suppressed in the usual
manner). This can be useful in some specialized circumstances such as the manner). This can be useful in some specialized circumstances such as the
temporary use of special test software. temporary use of special test software.
@item -gnateS @item -gnateS
@cindex @option{-gnateS} (@command{gcc}) @cindex @option{-gnateS} (@command{gcc})
Generate SCO (Source Coverage Obligation) information in the ALI Synonym of @option{-fdump-scos}, kept for backards compatibility.
file. This information is used by advanced coverage tools. See
unit @file{SCOs} in the compiler sources for details in files
@file{scos.ads} and @file{scos.adb}.
@item -gnatE @item -gnatE
@cindex @option{-gnatE} (@command{gcc}) @cindex @option{-gnatE} (@command{gcc})
......
...@@ -2265,19 +2265,11 @@ them independently. An aggregate project does not have these ...@@ -2265,19 +2265,11 @@ them independently. An aggregate project does not have these
limitations and can aggregate two project trees that have common limitations and can aggregate two project trees that have common
sources. sources.
@smallexample This scenario is particularly useful in environments like VxWorks 653
Aggregate projects can group projects with duplicate file names
@end smallexample
This scenario is particularly useful in environment like VxWorks 653
where the applications running in the multiple partitions can be built where the applications running in the multiple partitions can be built
in parallel through a single gprbuild command. This also works nicely in parallel through a single gprbuild command. This also works nicely
with Annex E. with Annex E.
@smallexample
Aggregate projects can be used to build multiple partitions
@end smallexample
@c --------------------------------------------- @c ---------------------------------------------
@node Define a build environment @node Define a build environment
@subsection Define a build environment @subsection Define a build environment
......
...@@ -7416,6 +7416,8 @@ package body Sem_Ch6 is ...@@ -7416,6 +7416,8 @@ package body Sem_Ch6 is
-- The following is too permissive. A more precise test should -- The following is too permissive. A more precise test should
-- check that the generic actual is an ancestor subtype of the -- check that the generic actual is an ancestor subtype of the
-- other ???. -- other ???.
-- See code in Find_Corresponding_Spec that applies an additional
-- filter to handle accidental amiguities in instances.
return not Is_Generic_Actual_Type (T1) return not Is_Generic_Actual_Type (T1)
or else not Is_Generic_Actual_Type (T2) or else not Is_Generic_Actual_Type (T2)
...@@ -8148,6 +8150,46 @@ package body Sem_Ch6 is ...@@ -8148,6 +8150,46 @@ package body Sem_Ch6 is
E : Entity_Id; E : Entity_Id;
function Different_Generic_Profile (E : Entity_Id) return Boolean;
-- Even if fully conformant, a body may depend on a generic actual when
-- the spec does not, or vice versa, in which case they were distinct
-- entities in the generic.
-------------------------------
-- Different_Generic_Profile --
-------------------------------
function Different_Generic_Profile (E : Entity_Id) return Boolean is
F1, F2 : Entity_Id;
begin
if Ekind (E) = E_Function
and then Is_Generic_Actual_Type (Etype (E))
/= Is_Generic_Actual_Type (Etype (Designator))
then
return True;
end if;
F1 := First_Formal (Designator);
F2 := First_Formal (E);
while Present (F1) loop
if
Is_Generic_Actual_Type (Etype (F1))
/= Is_Generic_Actual_Type (Etype (F2))
then
return True;
end if;
Next_Formal (F1);
Next_Formal (F2);
end loop;
return False;
end Different_Generic_Profile;
-- Start of processing for Find_Corresponding_Spec
begin begin
E := Current_Entity (Designator); E := Current_Entity (Designator);
while Present (E) loop while Present (E) loop
...@@ -8163,13 +8205,12 @@ package body Sem_Ch6 is ...@@ -8163,13 +8205,12 @@ package body Sem_Ch6 is
and then Type_Conformant (E, Designator)) and then Type_Conformant (E, Designator))
then then
-- Within an instantiation, we know that spec and body are -- Within an instantiation, we know that spec and body are
-- subtype conformant, because they were subtype conformant -- subtype conformant, because they were subtype conformant in
-- in the generic. We choose the subtype-conformant entity -- the generic. We choose the subtype-conformant entity here as
-- here as well, to resolve spurious ambiguities in the -- well, to resolve spurious ambiguities in the instance that
-- instance that were not present in the generic (i.e. when -- were not present in the generic (i.e. when two different
-- two different types are given the same actual). If we are -- types are given the same actual). If we are looking for a
-- looking for a spec to match a body, full conformance is -- spec to match a body, full conformance is expected.
-- expected.
if In_Instance then if In_Instance then
Set_Convention (Designator, Convention (E)); Set_Convention (Designator, Convention (E));
...@@ -8188,6 +8229,9 @@ package body Sem_Ch6 is ...@@ -8188,6 +8229,9 @@ package body Sem_Ch6 is
elsif not Subtype_Conformant (Designator, E) then elsif not Subtype_Conformant (Designator, E) then
goto Next_Entity; goto Next_Entity;
elsif Different_Generic_Profile (E) then
goto Next_Entity;
end if; end if;
end if; end if;
...@@ -8218,12 +8262,12 @@ package body Sem_Ch6 is ...@@ -8218,12 +8262,12 @@ package body Sem_Ch6 is
return E; return E;
-- If E is an internal function with a controlling result -- If E is an internal function with a controlling result that
-- that was created for an operation inherited by a null -- was created for an operation inherited by a null extension,
-- extension, it may be overridden by a body without a previous -- it may be overridden by a body without a previous spec (one
-- spec (one more reason why these should be shunned). In that -- more reason why these should be shunned). In that case
-- case remove the generated body if present, because the -- remove the generated body if present, because the current
-- current one is the explicit overriding. -- one is the explicit overriding.
elsif Ekind (E) = E_Function elsif Ekind (E) = E_Function
and then Ada_Version >= Ada_2005 and then Ada_Version >= Ada_2005
...@@ -8329,9 +8373,9 @@ package body Sem_Ch6 is ...@@ -8329,9 +8373,9 @@ package body Sem_Ch6 is
renames Fully_Conformant_Expressions; renames Fully_Conformant_Expressions;
function FCL (L1, L2 : List_Id) return Boolean; function FCL (L1, L2 : List_Id) return Boolean;
-- Compare elements of two lists for conformance. Elements have to -- Compare elements of two lists for conformance. Elements have to be
-- be conformant, and actuals inserted as default parameters do not -- conformant, and actuals inserted as default parameters do not match
-- match explicit actuals with the same value. -- explicit actuals with the same value.
function FCO (Op_Node, Call_Node : Node_Id) return Boolean; function FCO (Op_Node, Call_Node : Node_Id) return Boolean;
-- Compare an operator node with a function call -- Compare an operator node with a function call
...@@ -8356,8 +8400,8 @@ package body Sem_Ch6 is ...@@ -8356,8 +8400,8 @@ package body Sem_Ch6 is
N2 := First (L2); N2 := First (L2);
end if; end if;
-- Compare two lists, skipping rewrite insertions (we want to -- Compare two lists, skipping rewrite insertions (we want to compare
-- compare the original trees, not the expanded versions!) -- the original trees, not the expanded versions!)
loop loop
if Is_Rewrite_Insertion (N1) then if Is_Rewrite_Insertion (N1) then
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment