+2014-01-24 Robert Dewar <dewar@adacore.com>
+
+ * sinfo.ads, make.adb, prj-env.adb: Minor reformatting.
+
+2014-01-24 Vincent Celier <celier@adacore.com>
+
+ * prj.adb (Add_Aggregated_Project): Do not add a project in
+ the list if it is already there.
+
+2014-01-24 Yannick Moy <moy@adacore.com>
+
+ * lib-xref-spark_specific.adb (Enclosing_Subprogram_Or_Package):
+ Correct the search for a subrogram declaration to which a pragma is
+ attached.
+
+2014-01-24 Bob Duff <duff@adacore.com>
+
+ * gnat_ugn.texi: Document --decimal-grouping and
+ --based-grouping switches in gnatpp.
+
2014-01-24 Ed Schonberg <schonberg@adacore.com>
* sinfo.ads: Documentation update.
@noindent
These switches control the inclusion of missing end/exit labels, and
-the indentation level in @b{case} statements.
+the indentation level in @b{case} statements, etc.
@table @option
+@item --decimal-grouping=@var{n}
+@cindex @option{--decimal-grouping} @command{gnatpp}
+Put underscores in decimal literals (numeric literals without a base)
+every @var{n} characters. If a literal already has one or more
+underscores, it is not modified. For example, with
+@code{--decimal-grouping=3}, @code{1000000} will be changed to
+@code{1_000_000}.
+
+@item --based-grouping=@var{n}
+@cindex @option{--based-grouping} @command{gnatpp}
+Same as @code{--decimal-grouping}, but for based literals. For
+example, with @code{--based-grouping=4}, @code{16#0001FFFE#} will be
+changed to @code{16#0001_FFFE#}.
+
@item ^-e^/NO_MISSED_LABELS^
@cindex @option{^-e^/NO_MISSED_LABELS^} (@command{gnatpp})
Do not insert missing end/exit labels. An end label is the name of
when N_Pragma =>
-- The enclosing subprogram for a precondition, postcondition,
- -- or contract case should be the subprogram to which the
- -- pragma is attached, which can be found by following
- -- previous elements in the list to which the pragma belongs.
-
- if Get_Pragma_Id (Result) = Pragma_Precondition
- or else
- Get_Pragma_Id (Result) = Pragma_Postcondition
- or else
- Get_Pragma_Id (Result) = Pragma_Contract_Cases
- then
- if Is_List_Member (Result)
- and then Present (Prev (Result))
- then
- Result := Prev (Result);
- else
- Result := Parent (Result);
- end if;
-
- else
+ -- or contract case should be the declaration preceding the
+ -- pragma (skipping any other pragmas between this pragma and
+ -- this declaration.
+
+ while Nkind (Result) = N_Pragma
+ and then Is_List_Member (Result)
+ and then Present (Prev (Result))
+ loop
+ Result := Prev (Result);
+ end loop;
+
+ if Nkind (Result) = N_Pragma then
Result := Parent (Result);
end if;
if Main_Project /= No_Project then
- -- Put all the source directories in ADA_INCLUDE_PATH,
- -- and all the object directories in ADA_OBJECTS_PATH,
- -- except those of library projects.
+ -- Put all the source directories in ADA_INCLUDE_PATH, and all the
+ -- object directories in ADA_OBJECTS_PATH.
Prj.Env.Set_Ada_Paths
(Project => Main_Project,
In_Tree => Project_Tree,
- Including_Libraries => False,
+ Including_Libraries => True,
Include_Path => Use_Include_Path_File);
-- If switch -C was specified, create a binder mapping file
begin
if Recursive then
- -- If it is the first time we call this function for
- -- this project, compute the source path
+ -- If it is the first time we call this function for this project,
+ -- compute the source path
if Project.Ada_Include_Path = null then
Buffer := new String (1 .. Buffer_Initial);
----------------------------
procedure Add_Aggregated_Project
- (Project : Project_Id; Path : Path_Name_Type) is
+ (Project : Project_Id;
+ Path : Path_Name_Type)
+ is
+ Aggregated : Aggregated_Project_List;
+
begin
+ -- Check if the project is already in the aggregated project list. If it
+ -- is, do not add it again.
+
+ Aggregated := Project.Aggregated_Projects;
+ while Aggregated /= null loop
+ if Path = Aggregated.Path then
+ return;
+ else
+ Aggregated := Aggregated.Next;
+ end if;
+ end loop;
+
Project.Aggregated_Projects := new Aggregated_Project'
(Path => Path,
Project => No_Project,
-- form that meets additional requirements.
-- This light expansion does two transformations of the tree that cannot
- -- be postponed after semantic analysis:
+ -- be postponed till after semantic analysis:
-- 1. Replace object renamings by renamed object. This requires the
-- introduction of temporaries at the point of the renaming, which
-- The following flag fields appear in expression nodes:
- -- Do_Division_Check
- -- Do_Overflow_Check
- -- Do_Range_Check
+ -- Do_Division_Check
+ -- Do_Overflow_Check
+ -- Do_Range_Check
-- These three flags are always set by the front end during semantic
-- analysis, on expression nodes that may trigger the corresponding
- -- check. The front end then inserts or not the check during expansion.
- -- In particular, these flags should also be correctly set in ASIS mode
- -- and GNATprove mode.
+ -- check. The front end then inserts or not the check during expansion. In
+ -- particular, these flags should also be correctly set in ASIS mode and
+ -- GNATprove mode.
-- Note that this accounts for all nodes that trigger the corresponding
-- checks, except for range checks on subtype_indications, which may be
-- The following flag fields appear in various nodes:
- -- Do_Accessibility_Check
- -- Do_Discriminant_Check
- -- Do_Length_Check
- -- Do_Storage_Check
- -- Do_Tag_Check
+ -- Do_Accessibility_Check
+ -- Do_Discriminant_Check
+ -- Do_Length_Check
+ -- Do_Storage_Check
+ -- Do_Tag_Check
-- These flags are used in some specific cases by the front end, either
-- during semantic analysis or during expansion, and cannot be expected