Commit 2fabf41e by Arnaud Charlet

[multiple changes]

2013-04-23  Robert Dewar  <dewar@adacore.com>

	* sem_util.adb, sem_res.adb, prj-tree.adb, prj-tree.ads: Minor
	reformatting.

2013-04-23  Pascal Obry  <obry@adacore.com>

	* xoscons.adb: Remove unused use clause, minor code clean-up.

From-SVN: r198182
parent dd4e47ab
2013-04-23 Robert Dewar <dewar@adacore.com>
* sem_util.adb, sem_res.adb, prj-tree.adb, prj-tree.ads: Minor
reformatting.
2013-04-23 Pascal Obry <obry@adacore.com>
* xoscons.adb: Remove unused use clause, minor code clean-up.
2013-04-23 Ed Schonberg <schonberg@adacore.com> 2013-04-23 Ed Schonberg <schonberg@adacore.com>
* sem_util.ads, sem_util.adb: Code cleanup for Is_Expression_Function * sem_util.ads, sem_util.adb: Code cleanup for Is_Expression_Function
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- B o d y -- -- B o d y --
-- -- -- --
-- Copyright (C) 2001-2011, Free Software Foundation, Inc. -- -- Copyright (C) 2001-2013, 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- --
...@@ -279,7 +279,8 @@ package body Prj.Tree is ...@@ -279,7 +279,8 @@ package body Prj.Tree is
function Case_Insensitive function Case_Insensitive
(Node : Project_Node_Id; (Node : Project_Node_Id;
In_Tree : Project_Node_Tree_Ref) return Boolean is In_Tree : Project_Node_Tree_Ref) return Boolean
is
begin begin
pragma Assert pragma Assert
(Present (Node) (Present (Node)
...@@ -524,7 +525,8 @@ package body Prj.Tree is ...@@ -524,7 +525,8 @@ package body Prj.Tree is
function Directory_Of function Directory_Of
(Node : Project_Node_Id; (Node : Project_Node_Id;
In_Tree : Project_Node_Tree_Ref) return Path_Name_Type is In_Tree : Project_Node_Tree_Ref) return Path_Name_Type
is
begin begin
pragma Assert pragma Assert
(Present (Node) (Present (Node)
...@@ -539,7 +541,8 @@ package body Prj.Tree is ...@@ -539,7 +541,8 @@ package body Prj.Tree is
function End_Of_Line_Comment function End_Of_Line_Comment
(Node : Project_Node_Id; (Node : Project_Node_Id;
In_Tree : Project_Node_Tree_Ref) return Name_Id is In_Tree : Project_Node_Tree_Ref) return Name_Id
is
Zone : Project_Node_Id := Empty_Node; Zone : Project_Node_Id := Empty_Node;
begin begin
...@@ -960,7 +963,8 @@ package body Prj.Tree is ...@@ -960,7 +963,8 @@ package body Prj.Tree is
function Follows_Empty_Line function Follows_Empty_Line
(Node : Project_Node_Id; (Node : Project_Node_Id;
In_Tree : Project_Node_Tree_Ref) return Boolean is In_Tree : Project_Node_Tree_Ref) return Boolean
is
begin begin
pragma Assert pragma Assert
(Present (Node) (Present (Node)
...@@ -1006,13 +1010,13 @@ package body Prj.Tree is ...@@ -1006,13 +1010,13 @@ package body Prj.Tree is
procedure Initialize procedure Initialize
(Self : out Environment; (Self : out Environment;
Flags : Processing_Flags) is Flags : Processing_Flags)
is
begin begin
-- Do not reset the external references, in case we are reloading a -- Do not reset the external references, in case we are reloading a
-- project, since we want to preserve the current environment. But we -- project, since we want to preserve the current environment. But we
-- still need to ensure that the external references are properly -- still need to ensure that the external references are properly
-- initialized. -- initialized.
-- Prj.Ext.Reset (Tree.External);
Prj.Ext.Initialize (Self.External); Prj.Ext.Initialize (Self.External);
...@@ -1025,7 +1029,8 @@ package body Prj.Tree is ...@@ -1025,7 +1029,8 @@ package body Prj.Tree is
procedure Initialize_And_Copy procedure Initialize_And_Copy
(Self : out Environment; (Self : out Environment;
Copy_From : Environment) is Copy_From : Environment)
is
begin begin
Self.Flags := Copy_From.Flags; Self.Flags := Copy_From.Flags;
Prj.Ext.Initialize (Self.External, Copy_From => Copy_From.External); Prj.Ext.Initialize (Self.External, Copy_From => Copy_From.External);
...@@ -1079,7 +1084,8 @@ package body Prj.Tree is ...@@ -1079,7 +1084,8 @@ package body Prj.Tree is
function Is_Extending_All function Is_Extending_All
(Node : Project_Node_Id; (Node : Project_Node_Id;
In_Tree : Project_Node_Tree_Ref) return Boolean is In_Tree : Project_Node_Tree_Ref) return Boolean
is
begin begin
pragma Assert pragma Assert
(Present (Node) (Present (Node)
...@@ -1096,7 +1102,8 @@ package body Prj.Tree is ...@@ -1096,7 +1102,8 @@ package body Prj.Tree is
function Is_Not_Last_In_List function Is_Not_Last_In_List
(Node : Project_Node_Id; (Node : Project_Node_Id;
In_Tree : Project_Node_Tree_Ref) return Boolean is In_Tree : Project_Node_Tree_Ref) return Boolean
is
begin begin
pragma Assert pragma Assert
(Present (Node) (Present (Node)
...@@ -1155,7 +1162,8 @@ package body Prj.Tree is ...@@ -1155,7 +1162,8 @@ package body Prj.Tree is
function Kind_Of function Kind_Of
(Node : Project_Node_Id; (Node : Project_Node_Id;
In_Tree : Project_Node_Tree_Ref) return Project_Node_Kind is In_Tree : Project_Node_Tree_Ref) return Project_Node_Kind
is
begin begin
pragma Assert (Present (Node)); pragma Assert (Present (Node));
return In_Tree.Project_Nodes.Table (Node).Kind; return In_Tree.Project_Nodes.Table (Node).Kind;
...@@ -1167,7 +1175,8 @@ package body Prj.Tree is ...@@ -1167,7 +1175,8 @@ package body Prj.Tree is
function Location_Of function Location_Of
(Node : Project_Node_Id; (Node : Project_Node_Id;
In_Tree : Project_Node_Tree_Ref) return Source_Ptr is In_Tree : Project_Node_Tree_Ref) return Source_Ptr
is
begin begin
pragma Assert (Present (Node)); pragma Assert (Present (Node));
return In_Tree.Project_Nodes.Table (Node).Location; return In_Tree.Project_Nodes.Table (Node).Location;
...@@ -1179,7 +1188,8 @@ package body Prj.Tree is ...@@ -1179,7 +1188,8 @@ package body Prj.Tree is
function Name_Of function Name_Of
(Node : Project_Node_Id; (Node : Project_Node_Id;
In_Tree : Project_Node_Tree_Ref) return Name_Id is In_Tree : Project_Node_Tree_Ref) return Name_Id
is
begin begin
pragma Assert (Present (Node)); pragma Assert (Present (Node));
return In_Tree.Project_Nodes.Table (Node).Name; return In_Tree.Project_Nodes.Table (Node).Name;
...@@ -1207,7 +1217,8 @@ package body Prj.Tree is ...@@ -1207,7 +1217,8 @@ package body Prj.Tree is
function Next_Comment function Next_Comment
(Node : Project_Node_Id; (Node : Project_Node_Id;
In_Tree : Project_Node_Tree_Ref) return Project_Node_Id is In_Tree : Project_Node_Tree_Ref) return Project_Node_Id
is
begin begin
pragma Assert pragma Assert
(Present (Node) (Present (Node)
...@@ -1648,8 +1659,8 @@ package body Prj.Tree is ...@@ -1648,8 +1659,8 @@ package body Prj.Tree is
Follows_Empty_Line => Empty_Line, Follows_Empty_Line => Empty_Line,
Is_Followed_By_Empty_Line => False); Is_Followed_By_Empty_Line => False);
-- Otherwise, it is an end of line comment. If there is -- Otherwise, it is an end of line comment. If there is an
-- an end of line node specified, associate the comment with -- end of line node specified, associate the comment with
-- this node. -- this node.
elsif Present (End_Of_Line_Node) then elsif Present (End_Of_Line_Node) then
...@@ -2038,7 +2049,6 @@ package body Prj.Tree is ...@@ -2038,7 +2049,6 @@ package body Prj.Tree is
(Node : Project_Node_Id; (Node : Project_Node_Id;
In_Tree : Project_Node_Tree_Ref; In_Tree : Project_Node_Tree_Ref;
To : Project_Node_Id) To : Project_Node_Id)
is is
Zone : constant Project_Node_Id := Comment_Zones_Of (Node, In_Tree); Zone : constant Project_Node_Id := Comment_Zones_Of (Node, In_Tree);
begin begin
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- S p e c -- -- S p e c --
-- -- -- --
-- Copyright (C) 2001-2011, Free Software Foundation, Inc. -- -- Copyright (C) 2001-2013, 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- --
......
...@@ -5376,13 +5376,13 @@ package body Sem_Res is ...@@ -5376,13 +5376,13 @@ package body Sem_Res is
Check_Internal_Protected_Use (N, Nam); Check_Internal_Protected_Use (N, Nam);
-- Freeze the subprogram name if not in a spec-expression. Note that we -- Freeze the subprogram name if not in a spec-expression. Note that
-- freeze procedure calls as well as function calls. Procedure calls are -- we freeze procedure calls as well as function calls. Procedure calls
-- not frozen according to the rules (RM 13.14(14)) because it is -- are not frozen according to the rules (RM 13.14(14)) because it is
-- impossible to have a procedure call to a non-frozen procedure in pure -- impossible to have a procedure call to a non-frozen procedure in
-- Ada, but in the code that we generate in the expander, this rule -- pure Ada, but in the code that we generate in the expander, this
-- needs extending because we can generate procedure calls that need -- rule needs extending because we can generate procedure calls that
-- freezing. -- need freezing.
-- In Ada 2012, expression functions may be called within pre/post -- In Ada 2012, expression functions may be called within pre/post
-- conditions of subsequent functions or expression functions. Such -- conditions of subsequent functions or expression functions. Such
......
...@@ -8137,8 +8137,9 @@ package body Sem_Util is ...@@ -8137,8 +8137,9 @@ package body Sem_Util is
(Present (Corresponding_Body (Decl)) (Present (Corresponding_Body (Decl))
and then and then
Nkind (Original_Node Nkind (Original_Node
(Unit_Declaration_Node (Corresponding_Body (Decl)))) (Unit_Declaration_Node
= N_Expression_Function)); (Corresponding_Body (Decl)))) =
N_Expression_Function));
end if; end if;
end Is_Expression_Function; end Is_Expression_Function;
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- B o d y -- -- B o d y --
-- -- -- --
-- Copyright (C) 2008-2012, Free Software Foundation, Inc. -- -- Copyright (C) 2008-2013, 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- --
...@@ -55,7 +55,6 @@ with XUtil; use XUtil; ...@@ -55,7 +55,6 @@ with XUtil; use XUtil;
procedure XOSCons is procedure XOSCons is
use Ada.Strings; use Ada.Strings;
use ASCII;
Unit_Name : constant String := Argument (1); Unit_Name : constant String := Argument (1);
Tmpl_Name : constant String := Unit_Name & "-tmplt"; Tmpl_Name : constant String := Unit_Name & "-tmplt";
...@@ -442,6 +441,7 @@ procedure XOSCons is ...@@ -442,6 +441,7 @@ procedure XOSCons is
Ada_Ofile, C_Ofile : Sfile; Ada_Ofile, C_Ofile : Sfile;
Current_Line : in out Integer) Current_Line : in out Integer)
is is
function Get_Value (Name : String) return Int_Value_Type; function Get_Value (Name : String) return Int_Value_Type;
-- Returns the value of the variable Name -- Returns the value of the variable Name
...@@ -516,7 +516,7 @@ procedure XOSCons is ...@@ -516,7 +516,7 @@ procedure XOSCons is
Current_Line := Current_Line + 1; Current_Line := Current_Line + 1;
exit when Line (1 .. Last) = "@END_IF"; exit when Line (1 .. Last) = "@END_IF";
if Line (1 .. 4) = "@IF " then if Last > 4 and then Line (1 .. 4) = "@IF " then
Parse_Cond Parse_Cond
(Line (1 .. Last), Res, (Line (1 .. Last), Res,
Tmpl_File, Ada_Ofile, C_Ofile, Current_Line); Tmpl_File, Ada_Ofile, C_Ofile, Current_Line);
......
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