Commit 07233820 by Arnaud Charlet

nlists.adb (Prepend_Debug): Remove parameters and nest within Prepend.

	* nlists.adb (Prepend_Debug): Remove parameters and nest within
	Prepend.
	(Remove_Next_Debug): Same fix

	* nlists.ads: Correct bad comments for Prev and Prev_Non_Pragma (we do
	maintain back pointers now, though we did not used to, and comments
	were out of date).
	(Prepend): Remove pragma Inline.
	(Remove_Next): Same cleanup

From-SVN: r91891
parent 6a2b39bd
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- S p e c -- -- S p e c --
-- -- -- --
-- Copyright (C) 1992-2003 Free Software Foundation, Inc. -- -- Copyright (C) 1992-2004 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- --
...@@ -89,8 +89,7 @@ package Nlists is ...@@ -89,8 +89,7 @@ package Nlists is
Node2 : Node_Id; Node2 : Node_Id;
Node3 : Node_Id; Node3 : Node_Id;
Node4 : Node_Id; Node4 : Node_Id;
Node5 : Node_Id) Node5 : Node_Id) return List_Id;
return List_Id;
-- Build a new list initially containing the five given nodes -- Build a new list initially containing the five given nodes
function New_List function New_List
...@@ -99,9 +98,8 @@ package Nlists is ...@@ -99,9 +98,8 @@ package Nlists is
Node3 : Node_Id; Node3 : Node_Id;
Node4 : Node_Id; Node4 : Node_Id;
Node5 : Node_Id; Node5 : Node_Id;
Node6 : Node_Id) Node6 : Node_Id) return List_Id;
return List_Id; -- Build a new list initially containing the six given nodes
-- Build a new list initially containing the five given nodes
function New_Copy_List (List : List_Id) return List_Id; function New_Copy_List (List : List_Id) return List_Id;
-- Creates a new list containing copies (made with Atree.New_Copy) of every -- Creates a new list containing copies (made with Atree.New_Copy) of every
...@@ -174,11 +172,10 @@ package Nlists is ...@@ -174,11 +172,10 @@ package Nlists is
function Prev (Node : Node_Id) return Node_Id; function Prev (Node : Node_Id) return Node_Id;
pragma Inline (Prev); pragma Inline (Prev);
-- This function returns the previous node on a node list list, or Empty if -- This function returns the previous node on a node list list, or Empty
-- Node is the first element of the node list. The argument must be a -- if Node is the first element of the node list. The argument must be
-- member of a node list. Note that the implementation does not maintain -- a member of a node list. Note: the implementation does maintain back
-- back pointers, so this function potentially requires traversal of the -- pointers, so this function executes quickly in constant time.
-- entire list, or more accurately of the part of the list preceding Node.
function Pick (List : List_Id; Index : Pos) return Node_Id; function Pick (List : List_Id; Index : Pos) return Node_Id;
-- Given a list, picks out the Index'th entry (1 = first entry). The -- Given a list, picks out the Index'th entry (1 = first entry). The
...@@ -193,8 +190,9 @@ package Nlists is ...@@ -193,8 +190,9 @@ package Nlists is
-- This function returns the previous node on a node list, skipping any -- This function returns the previous node on a node list, skipping any
-- pragmas. If Node is the first element of the list, or if the only -- pragmas. If Node is the first element of the list, or if the only
-- elements preceding it are pragmas, then Empty is returned. The -- elements preceding it are pragmas, then Empty is returned. The
-- argument must be a member of a node list. Like Prev, this function -- argument must be a member of a node list. Note: the implementation
-- may require expensive traversal of the head section of the list. -- does maintain back pointers, so this function executes quickly in
-- constant time.
procedure Prev_Non_Pragma (Node : in out Node_Id); procedure Prev_Non_Pragma (Node : in out Node_Id);
pragma Inline (Prev_Non_Pragma); pragma Inline (Prev_Non_Pragma);
...@@ -261,7 +259,6 @@ package Nlists is ...@@ -261,7 +259,6 @@ package Nlists is
-- List is reset to be the empty node list. -- List is reset to be the empty node list.
procedure Prepend (Node : Node_Id; To : List_Id); procedure Prepend (Node : Node_Id; To : List_Id);
pragma Inline (Prepend);
-- Prepends Node at the start of node list To. Node must be a non-empty -- Prepends Node at the start of node list To. Node must be a non-empty
-- node that is not already a member of a node list, and To must be a -- node that is not already a member of a node list, and To must be a
-- node list. An attempt to prepend an error node is ignored without -- node list. An attempt to prepend an error node is ignored without
...@@ -281,7 +278,6 @@ package Nlists is ...@@ -281,7 +278,6 @@ package Nlists is
-- is empty, then Empty is returned. -- is empty, then Empty is returned.
function Remove_Next (Node : Node_Id) return Node_Id; function Remove_Next (Node : Node_Id) return Node_Id;
pragma Inline (Remove_Next);
-- Removes the item immediately following the given node, and returns it -- Removes the item immediately following the given node, and returns it
-- as the result. If Node is the last element of the list, then Empty is -- as the result. If Node is the last element of the list, then Empty is
-- returned. Node must be a member of a list. Unlike Remove, Remove_Next -- returned. Node must be a member of a list. Unlike Remove, Remove_Next
......
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