summaryrefslogtreecommitdiff
path: root/gcc/ada/namet.ads
diff options
context:
space:
mode:
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2007-04-06 09:24:39 +0000
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2007-04-06 09:24:39 +0000
commitbdf2dac0859811fd382a7aeef641f1909a5af0a1 (patch)
tree8ae2d74d6461a8766909dc772a22d72f70b08188 /gcc/ada/namet.ads
parent398d21cdd1a880d272be90bb7ee192c6ea09d02c (diff)
downloadgcc-bdf2dac0859811fd382a7aeef641f1909a5af0a1.tar.gz
2007-04-06 Robert Dewar <dewar@adacore.com>
* namet.ads, namet.adb (wn): Improve this debugging routine. Calling it no longer destroys the contents of Name_Buffer or Name_Len and non-standard and invalid names are handled better. (Get_Decoded_Name_String): Improve performance by using Name_Has_No_Encodings flag in the name table. (Is_Valid_Name): New function to determine whether a Name_Id is valid. Used for debugging printouts. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@123586 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/namet.ads')
-rw-r--r--gcc/ada/namet.ads28
1 files changed, 22 insertions, 6 deletions
diff --git a/gcc/ada/namet.ads b/gcc/ada/namet.ads
index 4bf12e6a85c..a669485a4bc 100644
--- a/gcc/ada/namet.ads
+++ b/gcc/ada/namet.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 1992-2005 Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2006, 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- --
@@ -291,6 +291,10 @@ package Namet is
-- passed in Name_Buffer and Name_Len (which are not affected by the call).
-- Name_Buffer (it loads these as for Get_Name_String).
+ function Is_Valid_Name (Id : Name_Id) return Boolean;
+ -- True if Id is a valid name -- points to a valid entry in the
+ -- Name_Entries table.
+
procedure Reset_Name_Table;
-- This procedure is used when there are multiple source files to reset
-- the name table info entries associated with current entries in the
@@ -358,16 +362,22 @@ package Namet is
-- in encoded form (i.e. including Uhh, Whhh, Qx, _op as they appear in
-- the name table). If Id is Error_Name, or No_Name, no text is output.
- procedure wn (Id : Name_Id);
- pragma Export (Ada, wn);
- -- Like Write_Name, but includes new line at end. Intended for use
- -- from the debugger only.
-
procedure Write_Name_Decoded (Id : Name_Id);
-- Like Write_Name, except that the name written is the decoded name, as
-- described for Get_Decoded_Name_String, and the resulting value stored
-- in Name_Len and Name_Buffer is the decoded name.
+ procedure wn (Id : Name_Id);
+ pragma Export (Ada, wn);
+ -- This routine is intended for debugging use only (i.e. it is intended to
+ -- be called from the debugger). It writes the characters of the specified
+ -- name using the standard output procedures in package Output, followed by
+ -- a new line. The name is written in encoded form (i.e. including Uhh,
+ -- Whhh, Qx, _op as they appear in the name table). If Id is Error_Name,
+ -- No_Name, or invalid an appropriate string is written (<Error_Name>,
+ -- <No_Name>, <invalid name>). Unlike Write_Name, this call does not affect
+ -- the contents of Name_Buffer or Name_Len.
+
---------------------------
-- Table Data Structures --
---------------------------
@@ -404,6 +414,12 @@ private
Byte_Info : Byte;
-- Byte value associated with this name
+ Name_Has_No_Encodings : Boolean;
+ -- This flag is set True if the name entry is known not to contain any
+ -- special character encodings. This is used to speed up repeated calls
+ -- to Get_Decoded_Name_String. A value of False means that it is not
+ -- known whether the name contains any such encodings.
+
Hash_Link : Name_Id;
-- Link to next entry in names table for same hash code