+2011-08-04 Arnaud Charlet <charlet@adacore.com>
+
+ * debug.adb: Update comment.
+
+2011-08-04 Robert Dewar <dewar@adacore.com>
+
+ * par_sco.adb, exp_util.adb, make.adb, a-tags.adb, sem_prag.adb,
+ sem_util.adb, sem_attr.adb, exp_ch4.adb, g-comlin.adb, g-comlin.ads,
+ exp_ch6.adb: Minor reformatting.
+
+2011-08-04 Gary Dismukes <dismukes@adacore.com>
+
+ * gnat_ugn.texi: Add sentence about the case of compile-time-detected
+ checks for -gnateE.
+
+2011-08-04 Ed Schonberg <schonberg@adacore.com>
+
+ * gnat_rm.texi: update Ravenscar desription to reflect Ada2012 RM.
+
+2011-08-04 Thomas Quinot <quinot@adacore.com>
+
+ * sinfo.ads: Minor reformatting.
+
+2011-08-04 Emmanuel Briot <briot@adacore.com>
+
+ * makeutl.adb, makeutl.ads, prj-nmsc.adb (Complete_Mains): report error
+ even if there is no location.
+
2011-08-04 Ed Schonberg <schonberg@adacore.com>
* sem_res.adb, sem_ch4.adb: move check for restriction
Dup_Ext_Tag : constant String := "duplicated external tag """;
- -- Start of processing for Check_TSD
-
begin
-- Verify that the external tag of this TSD is not registered in the
-- runtime hash table.
T := External_Tag_HTable.Get (To_Address (TSD.External_Tag));
if T /= null then
+
-- Avoid concatenation, as it is not allowed in no run time mode
declare
-- especially in the predefined library units.
-- dQ Eliminate check for duplicate external tags. This check was added
- -- for GNAT 6.4.1, and causes some backward compatibility problems.
+ -- as per AI 0113, and causes some backward compatibility problems.
-- It is never legitimate to have duplicate external tags, so the
-- check is certainly valid, but this debug switch can be useful for
-- enabling previous behavior of ignoring this problem.
------------------------------
procedure Process_Transient_Object (Decl : Node_Id) is
- Ins_Nod : constant Node_Id := Parent (N);
+ Ins_Nod : constant Node_Id := Parent (N);
-- To avoid the insertion of generated code in the list of Actions,
-- Insert_Action must look at the parent field of the EWA.
Defining_Identifier => Ptr_Id,
Type_Definition =>
Make_Access_To_Object_Definition (Loc,
- All_Present =>
+ All_Present =>
Ekind (Obj_Typ) = E_General_Access_Type,
- Subtype_Indication =>
- New_Reference_To (Desig_Typ, Loc)));
+ Subtype_Indication => New_Reference_To (Desig_Typ, Loc)));
Insert_Action (Ins_Nod, Ptr_Decl);
Analyze (Ptr_Decl);
else
Expr :=
Make_Attribute_Reference (Loc,
- Prefix =>
- New_Reference_To (Obj_Id, Loc),
+ Prefix => New_Reference_To (Obj_Id, Loc),
Attribute_Name => Name_Unrestricted_Access);
end if;
declare
Flag_Id : constant Entity_Id :=
Return_Flag_Or_Transient_Decl (Ret_Obj_Id);
+
begin
-- Generate:
-- Fnn := True;
elsif Ekind (Obj_Id) = E_Variable
and then
(Is_Simple_Protected_Type (Obj_Typ)
- or else Has_Simple_Protected_Object (Obj_Typ))
+ or else Has_Simple_Protected_Object (Obj_Typ))
then
return True;
end if;
Success : out Boolean)
is
procedure Add_Simple_Switch
- (Simple : String;
- Sepa : String;
- Param : String;
- Index : Integer);
+ (Simple : String;
+ Sepa : String;
+ Param : String;
+ Index : Integer);
-- Add a new switch that has had all its aliases expanded, and switches
-- ungrouped. We know there are no more aliases in Switches.
-----------------------
procedure Add_Simple_Switch
- (Simple : String;
- Sepa : String;
- Param : String;
- Index : Integer)
+ (Simple : String;
+ Sepa : String;
+ Param : String;
+ Index : Integer)
is
Sep : Character;
-- format (trailing ':', '?', etc for defining a switch with parameters).
--
-- Switch should also start with the leading '-' (or any other characters).
- -- If this character is not '-', you will need to call
- -- Initialize_Option_Scan to set the proper character for the parser.
+ -- If this character is not '-', you need to call Initialize_Option_Scan to
+ -- set the proper character for the parser.
--
-- The switches defined in the command_line_configuration object are used
-- when ungrouping switches with more that one character after the prefix.
-- "-from:", the separator defaults to a space. But if your application
-- uses unusual separators not supported by GNAT.Command_Line (for instance
-- it requires ":"), you can specify this separator here.
+ --
-- For instance,
-- Add_Switch(Cmd, "-from", "bar", ':')
+ --
-- results in
-- -from:bar
+ --
-- rather than the default
-- -from bar
--
plus the following set of restrictions:
@table @code
-@item Max_Entry_Queue_Length = 1
+@item Max_Entry_Queue_Length => 1
Defines the maximum number of calls that are queued on a (protected) entry.
Note that this restrictions is checked at run time. Violation of this
restriction results in the raising of Program_Error exception at the point of
the call. For the Profile (Ravenscar) the value of Max_Entry_Queue_Length is
always 1 and hence no task can be queued on a protected entry.
-@item Max_Protected_Entries = 1
+@item Max_Protected_Entries => 1
[RM D.7] Specifies the maximum number of entries per protected type. The
bounds of every entry family of a protected unit shall be static, or shall be
defined by a discriminant of a subtype whose corresponding bound is static.
For the Profile (Ravenscar) the value of Max_Protected_Entries is always 1.
-@item Max_Task_Entries = 0
+@item Max_Task_Entries => 0
[RM D.7] Specifies the maximum number of entries
per task. The bounds of every entry family
of a task unit shall be static, or shall be
[RM D.7] There are no abort_statements, and there are
no calls to Task_Identification.Abort_Task.
-@item No_Asynchronous_Control
-There are no semantic dependences on the package
-Asynchronous_Task_Control.
-
-@item No_Calendar
-There are no semantic dependencies on the package Ada.Calendar.
-
@item No_Dynamic_Attachment
There is no call to any of the operations defined in package Ada.Interrupts
(Is_Reserved, Is_Attached, Current_Handler, Attach_Handler, Exchange_Handler,
[RM D.7] There are no allocators for task types
or types containing task subcomponents.
-@item No_Task_Attributes_Package
-There are no semantic dependencies on the Ada.Task_Attributes package.
-
@item No_Task_Hierarchy
[RM D.7] All (non-environment) tasks depend
directly on the environment task of the partition.
@item No_Task_Termination
Tasks which terminate are erroneous.
+@item Simple_Barriers
+Entry barrier condition expressions shall be either static
+boolean expressions or boolean objects which are declared in
+the protected type which contains the entry.
+
@item No_Unchecked_Conversion
There are no semantic dependencies on the Ada.Unchecked_Conversion package.
@item No_Unchecked_Deallocation
There are no semantic dependencies on the Ada.Unchecked_Deallocation package.
-@item Simple_Barriers
-Entry barrier condition expressions shall be either static
-boolean expressions or boolean objects which are declared in
-the protected type which contains the entry.
@end table
+@noindent
+
+The Ravenscar profile also includes the following restrictions that specify
+that there are no semantic dependences on the corresponding predefined
+packages:
+
+@table
+@item No_Dependence => Ada.Asynchronous_Task_Control
+@item No_Dependence => Ada.Calendar
+@item No_Dependence => Ada.Execution_Time.Group_Budget
+@item No_Dependence => Ada.Execution_Time.Timers
+@item No_Dependence => Ada.Task_Attributes
+@item No_Dependence => System.Multiprocessors.Dispatching_Domains
+@end table
@noindent
+
This set of configuration pragmas and restrictions correspond to the
definition of the ``Ravenscar Profile'' for limited tasking, devised and
published by the @cite{International Real-Time Ada Workshop}, 1997,
@item
@emph{AI-0216 No_Task_Hierarchy forbids local tasks (0000-00-00)}
-@cindex AI-0216 (Ada 2012 feature)
+@cindex AI05-0216 (Ada 2012 feature)
@noindent
It is clearly the intention that @code{No_Task_Hierarchy} is intended to
@item -gnateE
@cindex @option{-gnateE} (@command{gcc})
-Generate extra information in exception messages, in particular display
+Generate extra information in exception messages. In particular, display
extra column information and the value and range associated with index and
range check failures, and extra column information for access checks.
+In cases where the compiler is able to determine at compile time that
+a check will fail, it gives a warning, and the extra information is not
+produced at run time.
@item -gnatef
@cindex @option{-gnatef} (@command{gcc})
if Operating_Mode = Check_Semantics then
declare
- File_Name : String := Get_Name_String (Source_File);
+ File_Name : String := Get_Name_String (Source_File);
OK : Boolean := False;
begin
with Osint; use Osint;
with Output; use Output;
with Opt; use Opt;
+with Prj.Err;
with Prj.Ext;
with Prj.Util; use Prj.Util;
with Sinput.P;
--------------------
procedure Complete_Mains
- (Root_Project : Project_Id;
+ (Flags : Processing_Flags;
+ Root_Project : Project_Id;
Project_Tree : Project_Tree_Ref)
is
procedure Do_Complete (Project : Project_Id; Tree : Project_Tree_Ref);
Source : Prj.Source_Id := No_Source;
Suffix : File_Name_Type;
Iter : Source_Iterator;
+ Is_Absolute : Boolean := False;
begin
if Base_Name (Main) /= Main then
if Is_Absolute_Path (Main) then
Main_Id := Create_Name (Base_Name (Main));
+ Is_Absolute := True;
else
Fail_Program
(Tree,
end if;
if File.Tree = null then
- File.Tree := Project_Tree;
+ File.Tree := Tree;
end if;
if File.Source = null then
+ if Current_Verbosity = High then
+ Debug_Output
+ ("Search for main """ & Main
+ & """ in "
+ & Get_Name_String (Debug_Name (File.Tree))
+ & ", project", Project.Name);
+ end if;
-- First, look for the main as specified.
+ -- We need to search for the base name though, and
+ -- if needed check later that we found the correct
+ -- file.
Source := Find_Source
(In_Tree => File.Tree,
Project => File.Project,
- Base_Name => File.File,
+ Base_Name => Main_Id,
Index => File.Index);
if Source = No_Source then
Project := Project.Extends;
end loop;
end;
+
+ else
+ if Is_Absolute then
+ if File_Name_Type (Source.Path.Display_Name) /=
+ File.File
+ then
+ Debug_Output
+ ("Found a non-matching file",
+ Name_Id (Source.Path.Display_Name));
+ Source := No_Source;
+ end if;
+ end if;
end if;
if Source /= No_Source then
+
Debug_Output ("Found main in project",
Source.Project.Name);
Names.Table (J).File := Source.File;
Error_Msg_File_1 := Main_Id;
Error_Msg_Name_1 := Root_Project.Name;
- Errutil.Error_Msg
- ("{ is not a source of project %%",
- File.Location);
+ Prj.Err.Error_Msg
+ (Flags,
+ "{ is not a source of project %%",
+ File.Location, Project);
end if;
end if;
end;
begin
Complete_All (Root_Project, Project_Tree);
+
+ if Mains.Count_Of_Mains_With_No_Tree > 0 then
+ for J in Names.First .. Names.Last loop
+ Fail_Program
+ (Project_Tree, '"' & Get_Name_String (Names.Table (J).File)
+ & """ is not a source of any project");
+ end loop;
+ end if;
end Complete_Mains;
------------
-- project from all the aggregated projects).
procedure Complete_Mains
- (Root_Project : Project_Id;
+ (Flags : Processing_Flags;
+ Root_Project : Project_Id;
Project_Tree : Project_Tree_Ref);
-- If some main units were already added from the command line, check
-- that they all belong to the root project, and that they are full
Loc := Sloc (Parent (Parent (N)));
if T = 'P' then
+
-- Record sloc of pragma (pragmas don't nest)
pragma Assert (Pragma_Sloc = No_Location);
Display_File_Name : File_Name_Type;
begin
- Debug_Increase_Indent ("Looking for sources");
+ Debug_Increase_Indent ("Looking for sources of", Project.Project.Name);
-- Loop through subdirectories
-- Check in postcondition of function
Prag := N;
- while not Nkind_In (Prag, N_Pragma, N_Function_Specification,
- N_Subprogram_Body)
+ while not Nkind_In (Prag, N_Pragma,
+ N_Function_Specification,
+ N_Subprogram_Body)
loop
Prag := Parent (Prag);
end loop;
-- cause insertion of actions that would escape the attempt to
-- suppress the check code.
- -- Note that the Sloc for the IF statement corresponds to the
+ -- Note that the Sloc for the if statement corresponds to the
-- argument condition, not the pragma itself. The reason for this
-- is that we may generate a warning if the condition is False at
-- compile time, and we do not want to delete this warning when we
- -- delete the IF statement.
+ -- delete the if statement.
Expr := Get_Pragma_Arg (Arg2);
----------------
procedure Wrong_Type (Expr : Node_Id; Expected_Type : Entity_Id) is
- Found_Type : constant Entity_Id := First_Subtype (Etype (Expr));
- Expec_Type : constant Entity_Id := First_Subtype (Expected_Type);
+ Found_Type : constant Entity_Id := First_Subtype (Etype (Expr));
+ Expec_Type : constant Entity_Id := First_Subtype (Expected_Type);
Matching_Field : Entity_Id;
-- Entity to give a more precise suggestion on how to write a one-
-- Corresponding_Body (Node5-Sem)
-- This field is set in subprogram declarations, package declarations,
- -- entry declarations of protected types, and in generic units. It
- -- points to the defining entity for the corresponding body (NOT the
- -- node for the body itself).
+ -- entry declarations of protected types, and in generic units. It points
+ -- to the defining entity for the corresponding body (NOT the node for
+ -- the body itself).
-- Corresponding_Formal_Spec (Node3-Sem)
-- This field is set in subprogram renaming declarations, where it points