+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>
* sem_util.ads, sem_util.adb: Code cleanup for Is_Expression_Function
-- --
-- GNAT COMPILER COMPONENTS --
-- --
--- P R J . T R E E --
+-- P R J . T R E E --
-- --
-- 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 --
-- terms of the GNU General Public License as published by the Free Soft- --
function Case_Insensitive
(Node : Project_Node_Id;
- In_Tree : Project_Node_Tree_Ref) return Boolean is
+ In_Tree : Project_Node_Tree_Ref) return Boolean
+ is
begin
pragma Assert
(Present (Node)
function Directory_Of
(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
pragma Assert
(Present (Node)
function End_Of_Line_Comment
(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;
begin
function Follows_Empty_Line
(Node : Project_Node_Id;
- In_Tree : Project_Node_Tree_Ref) return Boolean is
+ In_Tree : Project_Node_Tree_Ref) return Boolean
+ is
begin
pragma Assert
(Present (Node)
----------------
procedure Initialize
- (Self : out Environment;
- Flags : Processing_Flags) is
+ (Self : out Environment;
+ Flags : Processing_Flags)
+ is
begin
-- Do not reset the external references, in case we are reloading a
-- project, since we want to preserve the current environment. But we
-- still need to ensure that the external references are properly
-- initialized.
- -- Prj.Ext.Reset (Tree.External);
Prj.Ext.Initialize (Self.External);
procedure Initialize_And_Copy
(Self : out Environment;
- Copy_From : Environment) is
+ Copy_From : Environment)
+ is
begin
Self.Flags := Copy_From.Flags;
Prj.Ext.Initialize (Self.External, Copy_From => Copy_From.External);
function Is_Extending_All
(Node : Project_Node_Id;
- In_Tree : Project_Node_Tree_Ref) return Boolean is
+ In_Tree : Project_Node_Tree_Ref) return Boolean
+ is
begin
pragma Assert
(Present (Node)
function Is_Not_Last_In_List
(Node : Project_Node_Id;
- In_Tree : Project_Node_Tree_Ref) return Boolean is
+ In_Tree : Project_Node_Tree_Ref) return Boolean
+ is
begin
pragma Assert
(Present (Node)
function Kind_Of
(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
pragma Assert (Present (Node));
return In_Tree.Project_Nodes.Table (Node).Kind;
function Location_Of
(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
pragma Assert (Present (Node));
return In_Tree.Project_Nodes.Table (Node).Location;
function Name_Of
(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
pragma Assert (Present (Node));
return In_Tree.Project_Nodes.Table (Node).Name;
function Next_Comment
(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
pragma Assert
(Present (Node)
Follows_Empty_Line => Empty_Line,
Is_Followed_By_Empty_Line => False);
- -- Otherwise, it is an end of line comment. If there is
- -- an end of line node specified, associate the comment with
+ -- Otherwise, it is an end of line comment. If there is an
+ -- end of line node specified, associate the comment with
-- this node.
elsif Present (End_Of_Line_Node) then
(Node : Project_Node_Id;
In_Tree : Project_Node_Tree_Ref;
To : Project_Node_Id)
-
is
Zone : constant Project_Node_Id := Comment_Zones_Of (Node, In_Tree);
begin
-- --
-- GNAT COMPILER COMPONENTS --
-- --
--- P R J . T R E E --
+-- P R J . T R E E --
-- --
-- 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 --
-- terms of the GNU General Public License as published by the Free Soft- --
end record;
procedure Initialize
- (Self : out Environment;
- Flags : Processing_Flags);
+ (Self : out Environment;
+ Flags : Processing_Flags);
-- Initialize a new environment
procedure Initialize_And_Copy
Check_Internal_Protected_Use (N, Nam);
- -- Freeze the subprogram name if not in a spec-expression. Note that we
- -- freeze procedure calls as well as function calls. Procedure calls 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
- -- Ada, but in the code that we generate in the expander, this rule
- -- needs extending because we can generate procedure calls that need
- -- freezing.
+ -- Freeze the subprogram name if not in a spec-expression. Note that
+ -- we freeze procedure calls as well as function calls. Procedure calls
+ -- 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 Ada, but in the code that we generate in the expander, this
+ -- rule needs extending because we can generate procedure calls that
+ -- need freezing.
-- In Ada 2012, expression functions may be called within pre/post
-- conditions of subsequent functions or expression functions. Such
-- calls do not freeze when they appear within generated bodies,
-- (including the body of another expression function) which would
- -- place the freeze node in the wrong scope. An expression function
+ -- place the freeze node in the wrong scope. An expression function
-- is frozen in the usual fashion, by the appearance of a real body,
-- or at the end of a declarative part.
(Present (Corresponding_Body (Decl))
and then
Nkind (Original_Node
- (Unit_Declaration_Node (Corresponding_Body (Decl))))
- = N_Expression_Function));
+ (Unit_Declaration_Node
+ (Corresponding_Body (Decl)))) =
+ N_Expression_Function));
end if;
end Is_Expression_Function;
-- --
-- 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 --
-- terms of the GNU General Public License as published by the Free Soft- --
procedure XOSCons is
use Ada.Strings;
- use ASCII;
Unit_Name : constant String := Argument (1);
Tmpl_Name : constant String := Unit_Name & "-tmplt";
Ada_Ofile, C_Ofile : Sfile;
Current_Line : in out Integer)
is
+
function Get_Value (Name : String) return Int_Value_Type;
-- Returns the value of the variable Name
Current_Line := Current_Line + 1;
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
(Line (1 .. Last), Res,
Tmpl_File, Ada_Ofile, C_Ofile, Current_Line);