Stewart Smith | aa697d0 | 2017-02-17 18:49:10 +1100 | [diff] [blame] | 1 | From ec1cc0263f156f70693a62cf17b254a0029f4852 Mon Sep 17 00:00:00 2001 |
| 2 | From: edlinger <edlinger@138bc75d-0d04-0410-961f-82ee72b054a4> |
| 3 | Date: Fri, 19 Feb 2016 22:13:29 +0000 |
| 4 | Subject: [PATCH] 2016-02-19 Jakub Jelinek <jakub@redhat.com> |
| 5 | Bernd Edlinger <bernd.edlinger@hotmail.de> |
| 6 | |
| 7 | * Make-lang.in: Invoke gperf with -L C++. |
| 8 | * cfns.gperf: Remove prototypes for hash and libc_name_p |
| 9 | inlines. |
| 10 | * cfns.h: Regenerated. |
| 11 | * except.c (nothrow_libfn_p): Adjust. |
| 12 | |
| 13 | |
| 14 | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@233572 138bc75d-0d04-0410-961f-82ee72b054a4 |
| 15 | --- |
| 16 | gcc/cp/ChangeLog | 9 +++++++++ |
| 17 | gcc/cp/Make-lang.in | 2 +- |
| 18 | gcc/cp/cfns.gperf | 10 ++-------- |
| 19 | gcc/cp/cfns.h | 41 ++++++++++++++--------------------------- |
| 20 | gcc/cp/except.c | 3 ++- |
| 21 | 5 files changed, 28 insertions(+), 37 deletions(-) |
| 22 | |
| 23 | diff --git a/gcc/cp/Make-lang.in b/gcc/cp/Make-lang.in |
| 24 | index 671ce12..2286c64 100644 |
| 25 | --- a/gcc/cp/Make-lang.in |
| 26 | +++ b/gcc/cp/Make-lang.in |
| 27 | @@ -112,7 +112,7 @@ else |
| 28 | # deleting the $(srcdir)/cp/cfns.h file. |
| 29 | $(srcdir)/cp/cfns.h: |
| 30 | endif |
| 31 | - gperf -o -C -E -k '1-6,$$' -j1 -D -N 'libc_name_p' -L ANSI-C \ |
| 32 | + gperf -o -C -E -k '1-6,$$' -j1 -D -N 'libc_name_p' -L C++ \ |
| 33 | $(srcdir)/cp/cfns.gperf --output-file $(srcdir)/cp/cfns.h |
| 34 | |
| 35 | # |
| 36 | diff --git a/gcc/cp/cfns.gperf b/gcc/cp/cfns.gperf |
| 37 | index 2784edc..8d7f015 100644 |
| 38 | --- a/gcc/cp/cfns.gperf |
| 39 | +++ b/gcc/cp/cfns.gperf |
| 40 | @@ -1,3 +1,5 @@ |
| 41 | +%language=C++ |
| 42 | +%define class-name libc_name |
| 43 | %{ |
| 44 | /* Copyright (C) 2000-2016 Free Software Foundation, Inc. |
| 45 | |
| 46 | @@ -16,14 +18,6 @@ for more details. |
| 47 | You should have received a copy of the GNU General Public License |
| 48 | along with GCC; see the file COPYING3. If not see |
| 49 | <http://www.gnu.org/licenses/>. */ |
| 50 | -#ifdef __GNUC__ |
| 51 | -__inline |
| 52 | -#endif |
| 53 | -static unsigned int hash (const char *, unsigned int); |
| 54 | -#ifdef __GNUC__ |
| 55 | -__inline |
| 56 | -#endif |
| 57 | -const char * libc_name_p (const char *, unsigned int); |
| 58 | %} |
| 59 | %% |
| 60 | # The standard C library functions, for feeding to gperf; the result is used |
| 61 | diff --git a/gcc/cp/cfns.h b/gcc/cp/cfns.h |
| 62 | index d8e02c9..9a37249 100644 |
| 63 | --- a/gcc/cp/cfns.h |
| 64 | +++ b/gcc/cp/cfns.h |
| 65 | @@ -1,5 +1,5 @@ |
| 66 | -/* ANSI-C code produced by gperf version 3.0.3 */ |
| 67 | -/* Command-line: gperf -o -C -E -k '1-6,$' -j1 -D -N libc_name_p -L ANSI-C cfns.gperf */ |
| 68 | +/* C++ code produced by gperf version 3.0.4 */ |
| 69 | +/* Command-line: gperf -o -C -E -k '1-6,$' -j1 -D -N libc_name_p -L C++ --output-file cfns.h cfns.gperf */ |
| 70 | |
| 71 | #if !((' ' == 32) && ('!' == 33) && ('"' == 34) && ('#' == 35) \ |
| 72 | && ('%' == 37) && ('&' == 38) && ('\'' == 39) && ('(' == 40) \ |
| 73 | @@ -28,7 +28,7 @@ |
| 74 | #error "gperf generated tables don't work with this execution character set. Please report a bug to <bug-gnu-gperf@gnu.org>." |
| 75 | #endif |
| 76 | |
| 77 | -#line 1 "cfns.gperf" |
| 78 | +#line 3 "cfns.gperf" |
| 79 | |
| 80 | /* Copyright (C) 2000-2016 Free Software Foundation, Inc. |
| 81 | |
| 82 | @@ -47,25 +47,18 @@ for more details. |
| 83 | You should have received a copy of the GNU General Public License |
| 84 | along with GCC; see the file COPYING3. If not see |
| 85 | <http://www.gnu.org/licenses/>. */ |
| 86 | -#ifdef __GNUC__ |
| 87 | -__inline |
| 88 | -#endif |
| 89 | -static unsigned int hash (const char *, unsigned int); |
| 90 | -#ifdef __GNUC__ |
| 91 | -__inline |
| 92 | -#endif |
| 93 | -const char * libc_name_p (const char *, unsigned int); |
| 94 | /* maximum key range = 391, duplicates = 0 */ |
| 95 | |
| 96 | -#ifdef __GNUC__ |
| 97 | -__inline |
| 98 | -#else |
| 99 | -#ifdef __cplusplus |
| 100 | -inline |
| 101 | -#endif |
| 102 | -#endif |
| 103 | -static unsigned int |
| 104 | -hash (register const char *str, register unsigned int len) |
| 105 | +class libc_name |
| 106 | +{ |
| 107 | +private: |
| 108 | + static inline unsigned int hash (const char *str, unsigned int len); |
| 109 | +public: |
| 110 | + static const char *libc_name_p (const char *str, unsigned int len); |
| 111 | +}; |
| 112 | + |
| 113 | +inline unsigned int |
| 114 | +libc_name::hash (register const char *str, register unsigned int len) |
| 115 | { |
| 116 | static const unsigned short asso_values[] = |
| 117 | { |
| 118 | @@ -122,14 +115,8 @@ hash (register const char *str, register unsigned int len) |
| 119 | return hval + asso_values[(unsigned char)str[len - 1]]; |
| 120 | } |
| 121 | |
| 122 | -#ifdef __GNUC__ |
| 123 | -__inline |
| 124 | -#ifdef __GNUC_STDC_INLINE__ |
| 125 | -__attribute__ ((__gnu_inline__)) |
| 126 | -#endif |
| 127 | -#endif |
| 128 | const char * |
| 129 | -libc_name_p (register const char *str, register unsigned int len) |
| 130 | +libc_name::libc_name_p (register const char *str, register unsigned int len) |
| 131 | { |
| 132 | enum |
| 133 | { |
| 134 | diff --git a/gcc/cp/except.c b/gcc/cp/except.c |
| 135 | index c73a16b..5336710 100644 |
| 136 | --- a/gcc/cp/except.c |
| 137 | +++ b/gcc/cp/except.c |
| 138 | @@ -1040,7 +1040,8 @@ nothrow_libfn_p (const_tree fn) |
| 139 | unless the system headers are playing rename tricks, and if |
| 140 | they are, we don't want to be confused by them. */ |
| 141 | id = DECL_NAME (fn); |
| 142 | - return !!libc_name_p (IDENTIFIER_POINTER (id), IDENTIFIER_LENGTH (id)); |
| 143 | + return !!libc_name::libc_name_p (IDENTIFIER_POINTER (id), |
| 144 | + IDENTIFIER_LENGTH (id)); |
| 145 | } |
| 146 | |
| 147 | /* Returns nonzero if an exception of type FROM will be caught by a |
| 148 | -- |
| 149 | 2.9.3 |
| 150 | |