[multiple changes]
2009-04-10 Vincent Celier <celier@adacore.com> * prj-nmsc.adb (Check_Naming_Schemes): Initialize local variable Casing to avoid gcc warning. 2009-04-10 Robert Dewar <dewar@adacore.com> * g-comlin.adb: Add ??? comment 2009-04-10 Ed Schonberg <schonberg@adacore.com> * sem_warn.adb (Check_Unused_Withs): Do not emit message about unreferenced entities for a package with no visible declarations. 2009-04-10 Robert Dewar <dewar@adacore.com> * exp_ch9.adb: Minor reformatting From-SVN: r145886
This commit is contained in:
parent
be21e9d8c7
commit
2844b33046
|
@ -1,3 +1,21 @@
|
||||||
|
2009-04-10 Vincent Celier <celier@adacore.com>
|
||||||
|
|
||||||
|
* prj-nmsc.adb (Check_Naming_Schemes): Initialize local variable Casing
|
||||||
|
to avoid gcc warning.
|
||||||
|
|
||||||
|
2009-04-10 Robert Dewar <dewar@adacore.com>
|
||||||
|
|
||||||
|
* g-comlin.adb: Add ??? comment
|
||||||
|
|
||||||
|
2009-04-10 Ed Schonberg <schonberg@adacore.com>
|
||||||
|
|
||||||
|
* sem_warn.adb (Check_Unused_Withs): Do not emit message about
|
||||||
|
unreferenced entities for a package with no visible declarations.
|
||||||
|
|
||||||
|
2009-04-10 Robert Dewar <dewar@adacore.com>
|
||||||
|
|
||||||
|
* exp_ch9.adb: Minor reformatting
|
||||||
|
|
||||||
2009-04-10 Thomas Quinot <quinot@adacore.com>
|
2009-04-10 Thomas Quinot <quinot@adacore.com>
|
||||||
|
|
||||||
* sem_prag.adb: Minor reformatting
|
* sem_prag.adb: Minor reformatting
|
||||||
|
|
|
@ -738,22 +738,25 @@ package body Exp_Ch9 is
|
||||||
-- At the end of the statement sequence, Complete_Rendezvous is called.
|
-- At the end of the statement sequence, Complete_Rendezvous is called.
|
||||||
-- A label skipping the Complete_Rendezvous, and all other accept
|
-- A label skipping the Complete_Rendezvous, and all other accept
|
||||||
-- processing, has already been added for the expansion of requeue
|
-- processing, has already been added for the expansion of requeue
|
||||||
-- statements.
|
-- statements. The Sloc is copied from the last statement since it
|
||||||
|
-- is really part of this last statement.
|
||||||
|
|
||||||
Call := Build_Runtime_Call (Sloc (Last (Statements (Stats))),
|
Call :=
|
||||||
RE_Complete_Rendezvous);
|
Build_Runtime_Call
|
||||||
|
(Sloc (Last (Statements (Stats))), RE_Complete_Rendezvous);
|
||||||
Insert_Before (Last (Statements (Stats)), Call);
|
Insert_Before (Last (Statements (Stats)), Call);
|
||||||
Analyze (Call);
|
Analyze (Call);
|
||||||
|
|
||||||
-- If exception handlers are present, then append Complete_Rendezvous
|
-- If exception handlers are present, then append Complete_Rendezvous
|
||||||
-- calls to the handlers, and construct the required outer block.
|
-- calls to the handlers, and construct the required outer block. As
|
||||||
|
-- above, the Sloc is copied from the last statement in the sequence.
|
||||||
|
|
||||||
if Present (Exception_Handlers (Stats)) then
|
if Present (Exception_Handlers (Stats)) then
|
||||||
Hand := First (Exception_Handlers (Stats));
|
Hand := First (Exception_Handlers (Stats));
|
||||||
|
|
||||||
while Present (Hand) loop
|
while Present (Hand) loop
|
||||||
Call := Build_Runtime_Call (Sloc (Last (Statements (Hand))),
|
Call :=
|
||||||
RE_Complete_Rendezvous);
|
Build_Runtime_Call
|
||||||
|
(Sloc (Last (Statements (Hand))), RE_Complete_Rendezvous);
|
||||||
Append (Call, Statements (Hand));
|
Append (Call, Statements (Hand));
|
||||||
Analyze (Call);
|
Analyze (Call);
|
||||||
Next (Hand);
|
Next (Hand);
|
||||||
|
@ -11996,11 +11999,11 @@ package body Exp_Ch9 is
|
||||||
-- side effects.
|
-- side effects.
|
||||||
|
|
||||||
Append_To (Args,
|
Append_To (Args,
|
||||||
New_Copy_Tree (
|
New_Copy_Tree
|
||||||
Expression (First (
|
(Expression (First
|
||||||
Pragma_Argument_Associations (
|
(Pragma_Argument_Associations
|
||||||
Find_Task_Or_Protected_Pragma
|
(Find_Task_Or_Protected_Pragma
|
||||||
(Tdef, Name_Task_Name))))));
|
(Tdef, Name_Task_Name))))));
|
||||||
|
|
||||||
else
|
else
|
||||||
Append_To (Args, Make_Identifier (Loc, Name_uTask_Name));
|
Append_To (Args, Make_Identifier (Loc, Name_uTask_Name));
|
||||||
|
|
|
@ -92,8 +92,9 @@ package body GNAT.Command_Line is
|
||||||
Index_In_Switches : out Integer;
|
Index_In_Switches : out Integer;
|
||||||
Switch_Length : out Integer;
|
Switch_Length : out Integer;
|
||||||
Param : out Switch_Parameter_Type);
|
Param : out Switch_Parameter_Type);
|
||||||
-- return the Longest switch from Switches that matches at least
|
-- Return the Longest switch from Switches that at least partially
|
||||||
-- partially Arg. Index_In_Switches is set to 0 if none matches
|
-- partially Arg. Index_In_Switches is set to 0 if none matches.
|
||||||
|
-- What are other parameters??? in particular Param is not always set???
|
||||||
|
|
||||||
procedure Unchecked_Free is new Ada.Unchecked_Deallocation
|
procedure Unchecked_Free is new Ada.Unchecked_Deallocation
|
||||||
(Argument_List, Argument_List_Access);
|
(Argument_List, Argument_List_Access);
|
||||||
|
|
|
@ -3280,7 +3280,7 @@ package body Prj.Nmsc is
|
||||||
-- value in the language config.
|
-- value in the language config.
|
||||||
|
|
||||||
declare
|
declare
|
||||||
Dot_Repl : constant Variable_Value :=
|
Dot_Repl : constant Variable_Value :=
|
||||||
Util.Value_Of
|
Util.Value_Of
|
||||||
(Name_Dot_Replacement,
|
(Name_Dot_Replacement,
|
||||||
Naming.Decl.Attributes, In_Tree);
|
Naming.Decl.Attributes, In_Tree);
|
||||||
|
@ -3291,17 +3291,21 @@ package body Prj.Nmsc is
|
||||||
(Name_Casing,
|
(Name_Casing,
|
||||||
Naming.Decl.Attributes,
|
Naming.Decl.Attributes,
|
||||||
In_Tree);
|
In_Tree);
|
||||||
Casing : Casing_Type;
|
|
||||||
Casing_Defined : Boolean := False;
|
Casing : Casing_Type := All_Lower_Case;
|
||||||
|
-- Casing type (junk initialization to stop bad gcc warning)
|
||||||
|
|
||||||
|
Casing_Defined : Boolean := False;
|
||||||
|
|
||||||
Sep_Suffix : constant Variable_Value :=
|
Sep_Suffix : constant Variable_Value :=
|
||||||
Prj.Util.Value_Of
|
Prj.Util.Value_Of
|
||||||
(Variable_Name => Name_Separate_Suffix,
|
(Variable_Name => Name_Separate_Suffix,
|
||||||
In_Variables => Naming.Decl.Attributes,
|
In_Variables => Naming.Decl.Attributes,
|
||||||
In_Tree => In_Tree);
|
In_Tree => In_Tree);
|
||||||
Separate_Suffix : File_Name_Type := No_File;
|
|
||||||
|
|
||||||
Lang_Id : Language_Index;
|
Separate_Suffix : File_Name_Type := No_File;
|
||||||
|
Lang_Id : Language_Index;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
-- Check attribute Dot_Replacement
|
-- Check attribute Dot_Replacement
|
||||||
|
|
||||||
|
|
|
@ -1887,6 +1887,11 @@ package body Sem_Warn is
|
||||||
-- warn that the context clause could be moved to the body, because
|
-- warn that the context clause could be moved to the body, because
|
||||||
-- the renaming may be intended to re-export the unit.
|
-- the renaming may be intended to re-export the unit.
|
||||||
|
|
||||||
|
function Has_Visible_Entities (P : Entity_Id) return Boolean;
|
||||||
|
-- If a package has no declared entities, inhibit warning because
|
||||||
|
-- there is nothing to be referenced. The package may be in the
|
||||||
|
-- context just in order to carry a linker pragma for example.
|
||||||
|
|
||||||
-------------------------
|
-------------------------
|
||||||
-- Check_Inner_Package --
|
-- Check_Inner_Package --
|
||||||
-------------------------
|
-------------------------
|
||||||
|
@ -2011,6 +2016,47 @@ package body Sem_Warn is
|
||||||
return Empty;
|
return Empty;
|
||||||
end Find_Package_Renaming;
|
end Find_Package_Renaming;
|
||||||
|
|
||||||
|
--------------------------
|
||||||
|
-- Has_Visible_Entities --
|
||||||
|
--------------------------
|
||||||
|
|
||||||
|
function Has_Visible_Entities (P : Entity_Id) return Boolean is
|
||||||
|
E : Entity_Id;
|
||||||
|
|
||||||
|
begin
|
||||||
|
|
||||||
|
-- If unit in context is not a package, it is a subprogram that
|
||||||
|
-- is not called or a generic unit that is not instantiated
|
||||||
|
-- in the current unit, and warning is appropriate.
|
||||||
|
|
||||||
|
if Ekind (P) /= E_Package then
|
||||||
|
return True;
|
||||||
|
end if;
|
||||||
|
|
||||||
|
-- If unit comes from a limited_with clause, look for declaration
|
||||||
|
-- of shadow entities.
|
||||||
|
|
||||||
|
if Present (Limited_View (P)) then
|
||||||
|
E := First_Entity (Limited_View (P));
|
||||||
|
else
|
||||||
|
E := First_Entity (P);
|
||||||
|
end if;
|
||||||
|
|
||||||
|
while Present (E)
|
||||||
|
and then E /= First_Private_Entity (P)
|
||||||
|
loop
|
||||||
|
if Comes_From_Source (E)
|
||||||
|
or else Present (Limited_View (P))
|
||||||
|
then
|
||||||
|
return True;
|
||||||
|
end if;
|
||||||
|
|
||||||
|
Next_Entity (E);
|
||||||
|
end loop;
|
||||||
|
|
||||||
|
return False;
|
||||||
|
end Has_Visible_Entities;
|
||||||
|
|
||||||
-- Start of processing for Check_One_Unit
|
-- Start of processing for Check_One_Unit
|
||||||
|
|
||||||
begin
|
begin
|
||||||
|
@ -2066,7 +2112,7 @@ package body Sem_Warn is
|
||||||
|
|
||||||
-- Otherwise simple unreferenced message
|
-- Otherwise simple unreferenced message
|
||||||
|
|
||||||
else
|
elsif Has_Visible_Entities (Entity (Name (Item))) then
|
||||||
Error_Msg_N
|
Error_Msg_N
|
||||||
("?unit& is not referenced!", Name (Item));
|
("?unit& is not referenced!", Name (Item));
|
||||||
end if;
|
end if;
|
||||||
|
|
Loading…
Reference in New Issue