1 From 1e5f1089dec3af328fd03125d6778f666d0bd4e4 Mon Sep 17 00:00:00 2001
2 From: edlinger <edlinger@138bc75d-0d04-0410-961f-82ee72b054a4>
3 Date: Thu, 25 Feb 2016 15:33:50 +0000
4 Subject: [PATCH 1/1] 2016-02-25 Bernd Edlinger <bernd.edlinger@hotmail.de>
6 Backported from mainline
7 2016-02-19 Jakub Jelinek <jakub@redhat.com>
8 Bernd Edlinger <bernd.edlinger@hotmail.de>
10 * Make-lang.in: Invoke gperf with -L C++.
11 * cfns.gperf: Remove prototypes for hash and libc_name_p
13 * cfns.h: Regenerated.
14 * except.c (nothrow_libfn_p): Adjust.
17 git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-5-branch@233720 138bc75d-0d04-0410-961f-82ee72b054a4
19 Signed-off-by: Samuel Martin <s.martin49@gmail.com>
21 gcc/cp/Make-lang.in | 2 +-
22 gcc/cp/cfns.gperf | 10 ++--------
23 gcc/cp/cfns.h | 41 ++++++++++++++---------------------------
24 gcc/cp/except.c | 3 ++-
25 5 files changed, 31 insertions(+), 37 deletions(-)
27 diff --git a/gcc/cp/Make-lang.in b/gcc/cp/Make-lang.in
28 index e98beb1..b09fb02 100644
29 --- a/gcc/cp/Make-lang.in
30 +++ b/gcc/cp/Make-lang.in
31 @@ -111,7 +111,7 @@ else
32 # deleting the $(srcdir)/cp/cfns.h file.
35 - gperf -o -C -E -k '1-6,$$' -j1 -D -N 'libc_name_p' -L ANSI-C \
36 + gperf -o -C -E -k '1-6,$$' -j1 -D -N 'libc_name_p' -L C++ \
37 $(srcdir)/cp/cfns.gperf --output-file $(srcdir)/cp/cfns.h
40 diff --git a/gcc/cp/cfns.gperf b/gcc/cp/cfns.gperf
41 index 68acd3d..214ecf6 100644
42 --- a/gcc/cp/cfns.gperf
43 +++ b/gcc/cp/cfns.gperf
46 +%define class-name libc_name
48 /* Copyright (C) 2000-2015 Free Software Foundation, Inc.
50 @@ -16,14 +18,6 @@ for more details.
51 You should have received a copy of the GNU General Public License
52 along with GCC; see the file COPYING3. If not see
53 <http://www.gnu.org/licenses/>. */
57 -static unsigned int hash (const char *, unsigned int);
61 -const char * libc_name_p (const char *, unsigned int);
64 # The standard C library functions, for feeding to gperf; the result is used
65 diff --git a/gcc/cp/cfns.h b/gcc/cp/cfns.h
66 index 1c6665d..596f413 100644
70 -/* ANSI-C code produced by gperf version 3.0.3 */
71 -/* Command-line: gperf -o -C -E -k '1-6,$' -j1 -D -N libc_name_p -L ANSI-C cfns.gperf */
72 +/* C++ code produced by gperf version 3.0.4 */
73 +/* Command-line: gperf -o -C -E -k '1-6,$' -j1 -D -N libc_name_p -L C++ --output-file cfns.h cfns.gperf */
75 #if !((' ' == 32) && ('!' == 33) && ('"' == 34) && ('#' == 35) \
76 && ('%' == 37) && ('&' == 38) && ('\'' == 39) && ('(' == 40) \
78 #error "gperf generated tables don't work with this execution character set. Please report a bug to <bug-gnu-gperf@gnu.org>."
84 /* Copyright (C) 2000-2015 Free Software Foundation, Inc.
86 @@ -47,25 +47,18 @@ for more details.
87 You should have received a copy of the GNU General Public License
88 along with GCC; see the file COPYING3. If not see
89 <http://www.gnu.org/licenses/>. */
93 -static unsigned int hash (const char *, unsigned int);
97 -const char * libc_name_p (const char *, unsigned int);
98 /* maximum key range = 391, duplicates = 0 */
108 -hash (register const char *str, register unsigned int len)
112 + static inline unsigned int hash (const char *str, unsigned int len);
114 + static const char *libc_name_p (const char *str, unsigned int len);
118 +libc_name::hash (register const char *str, register unsigned int len)
120 static const unsigned short asso_values[] =
122 @@ -122,14 +115,8 @@ hash (register const char *str, register unsigned int len)
123 return hval + asso_values[(unsigned char)str[len - 1]];
128 -#ifdef __GNUC_STDC_INLINE__
129 -__attribute__ ((__gnu_inline__))
133 -libc_name_p (register const char *str, register unsigned int len)
134 +libc_name::libc_name_p (register const char *str, register unsigned int len)
138 diff --git a/gcc/cp/except.c b/gcc/cp/except.c
139 index 3ff1ce6..2f2e396 100644
140 --- a/gcc/cp/except.c
141 +++ b/gcc/cp/except.c
142 @@ -1040,7 +1040,8 @@ nothrow_libfn_p (const_tree fn)
143 unless the system headers are playing rename tricks, and if
144 they are, we don't want to be confused by them. */
146 - return !!libc_name_p (IDENTIFIER_POINTER (id), IDENTIFIER_LENGTH (id));
147 + return !!libc_name::libc_name_p (IDENTIFIER_POINTER (id),
148 + IDENTIFIER_LENGTH (id));
151 /* Returns nonzero if an exception of type FROM will be caught by a