summaryrefslogtreecommitdiff
path: root/gcc/ada
diff options
context:
space:
mode:
authorebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4>2016-11-27 20:23:31 +0000
committerebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4>2016-11-27 20:23:31 +0000
commit43bce4a5d6382c8271e1e37524c96d647f13b150 (patch)
tree7d8820ac3267c7ff735a709a968441ef0b84ea90 /gcc/ada
parente006e2db1bb804e8c74d13f2a65ab3b4f865c712 (diff)
downloadgcc-43bce4a5d6382c8271e1e37524c96d647f13b150.tar.gz
PR ada/78531
* namet.h (Max_Line_Length): Define. (struct Bounded_String): Declare Chars with exact size. (namet__get_decoded_name_string): Delete. (Get_Decoded_Name_String): Likewise. (casing__set_all_upper_case): Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@242901 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada')
-rw-r--r--gcc/ada/ChangeLog9
-rw-r--r--gcc/ada/namet.h36
2 files changed, 16 insertions, 29 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index ae124deb1f1..d89b9674556 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,3 +1,12 @@
+2016-11-27 Eric Botcazou <ebotcazou@adacore.com>
+
+ PR ada/78531
+ * namet.h (Max_Line_Length): Define.
+ (struct Bounded_String): Declare Chars with exact size.
+ (namet__get_decoded_name_string): Delete.
+ (Get_Decoded_Name_String): Likewise.
+ (casing__set_all_upper_case): Likewise.
+
2016-11-22 Uros Bizjak <ubizjak@gmail.com>
* gcc-interface/Make-lang.in (check-acats): Fix detection
diff --git a/gcc/ada/namet.h b/gcc/ada/namet.h
index 32d110b2d27..a016f93b93d 100644
--- a/gcc/ada/namet.h
+++ b/gcc/ada/namet.h
@@ -6,7 +6,7 @@
* *
* C Header File *
* *
- * Copyright (C) 1992-2015, Free Software Foundation, Inc. *
+ * Copyright (C) 1992-2016, 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- *
@@ -25,7 +25,7 @@
/* This is the C file that corresponds to the Ada package specification
Namet. It was created manually from files namet.ads and namet.adb.
- Some subprograms from Sinput are also made accessible here. */
+ Subprograms from Exp_Dbug and Sinput are also made accessible here. */
#ifdef __cplusplus
extern "C" {
@@ -52,14 +52,15 @@ extern struct Name_Entry *Names_Ptr;
#define Name_Chars_Ptr namet__name_chars__table
extern char *Name_Chars_Ptr;
-/* The global name buffer. */
+/* This is Hostparm.Max_Line_Length. */
+#define Max_Line_Length (32767 - 1)
+
+/* The global name buffer. */
struct Bounded_String
{
Nat Max_Length;
Nat Length;
- char Chars[1];
- /* The 1 here is wrong, but it doesn't matter, because all the code either
- goes by Length, or NUL-terminates the string before processing it. */
+ char Chars[4 * Max_Line_Length]; /* Exact value for overflow detection. */
};
#define Global_Name_Buffer namet__global_name_buffer
@@ -81,32 +82,9 @@ Get_Name_String (Name_Id Id)
return Name_Chars_Ptr + Names_Ptr[Id - First_Name_Id].Name_Chars_Index + 1;
}
-/* Get_Decoded_Name_String returns a null terminated C string in the same
- manner as Get_Name_String, except that it is decoded (i.e. upper half or
- wide characters are put back in their external form, and character literals
- are also returned in their external form (with surrounding apostrophes) */
-
-extern void namet__get_decoded_name_string (Name_Id);
-
-static char *Get_Decoded_Name_String (Name_Id);
-
-INLINE char *
-Get_Decoded_Name_String (Name_Id Id)
-{
- namet__get_decoded_name_string (Id);
- Name_Buffer[Name_Len] = 0;
- return Name_Buffer;
-}
-
#define Name_Equals namet__name_equals
extern Boolean Name_Equals (Name_Id, Name_Id);
-/* Like Get_Decoded_Name_String, but the result has all qualification and
- package body entity suffixes stripped, and also all letters are upper
- cased. This is used for building the enumeration literal table. */
-
-extern void casing__set_all_upper_case (void);
-
/* The following routines and variables are not part of Namet, but we
include the header here since it seems the best place for it. */