diff options
author | matz <matz@138bc75d-0d04-0410-961f-82ee72b054a4> | 2016-01-22 16:44:10 +0000 |
---|---|---|
committer | matz <matz@138bc75d-0d04-0410-961f-82ee72b054a4> | 2016-01-22 16:44:10 +0000 |
commit | e1b9f8603a7f1ea27d159940eade3226ec2475b0 (patch) | |
tree | 93cc6b7235cf5430477fce1662a210a0904b17e9 /gcc | |
parent | a44dd069f34153291b7c13b649fe3da21d9b5df8 (diff) | |
download | gcc-e1b9f8603a7f1ea27d159940eade3226ec2475b0.tar.gz |
* system.h (string, algorithm): Include only conditionally.
(new): Include always under C++.
* bb-reorder.c (toplevel): Define INCLUDE_ALGORITHM.
* final.c (toplevel): Ditto.
* ipa-chkp.c (toplevel): Define INCLUDE_STRING.
* genconditions.c (write_header): Make gencondmd.c define
INCLUDE_STRING.
* mem-stats.h (mem_usage::print_dash_line): Don't use std::string.
* config/aarch64/aarch64.c (toplevel): Define INCLUDE_STRING.
* common/config/aarch64/aarch64-common.c (toplevel): Ditto.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@232736 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 14 | ||||
-rw-r--r-- | gcc/bb-reorder.c | 1 | ||||
-rw-r--r-- | gcc/common/config/aarch64/aarch64-common.c | 1 | ||||
-rw-r--r-- | gcc/config/aarch64/aarch64.c | 1 | ||||
-rw-r--r-- | gcc/final.c | 1 | ||||
-rw-r--r-- | gcc/genconditions.c | 1 | ||||
-rw-r--r-- | gcc/ipa-chkp.c | 1 | ||||
-rw-r--r-- | gcc/mem-stats.h | 4 | ||||
-rw-r--r-- | gcc/system.h | 5 |
9 files changed, 28 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 996be8771df..4a5665f528e 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,17 @@ +2016-01-22 Michael Matz <matz@suse.de> + + * system.h (string, algorithm): Include only conditionally. + (new): Include always under C++. + * bb-reorder.c (toplevel): Define INCLUDE_ALGORITHM. + * final.c (toplevel): Ditto. + * ipa-chkp.c (toplevel): Define INCLUDE_STRING. + * genconditions.c (write_header): Make gencondmd.c define + INCLUDE_STRING. + * mem-stats.h (mem_usage::print_dash_line): Don't use std::string. + + * config/aarch64/aarch64.c (toplevel): Define INCLUDE_STRING. + * common/config/aarch64/aarch64-common.c (toplevel): Ditto. + 2016-01-22 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.target/powerpc/pr63354.c: Restrict to Linux targets with diff --git a/gcc/bb-reorder.c b/gcc/bb-reorder.c index 944a25f536e..8cbde89b5e1 100644 --- a/gcc/bb-reorder.c +++ b/gcc/bb-reorder.c @@ -91,6 +91,7 @@ */ #include "config.h" +#define INCLUDE_ALGORITHM /* stable_sort */ #include "system.h" #include "coretypes.h" #include "backend.h" diff --git a/gcc/common/config/aarch64/aarch64-common.c b/gcc/common/config/aarch64/aarch64-common.c index 005ab02313d..69f5da70e3d 100644 --- a/gcc/common/config/aarch64/aarch64-common.c +++ b/gcc/common/config/aarch64/aarch64-common.c @@ -19,6 +19,7 @@ <http://www.gnu.org/licenses/>. */ #include "config.h" +#define INCLUDE_STRING #include "system.h" #include "coretypes.h" #include "tm.h" diff --git a/gcc/config/aarch64/aarch64.c b/gcc/config/aarch64/aarch64.c index 03bc1b97c2b..df3dec0a72b 100644 --- a/gcc/config/aarch64/aarch64.c +++ b/gcc/config/aarch64/aarch64.c @@ -19,6 +19,7 @@ <http://www.gnu.org/licenses/>. */ #include "config.h" +#define INCLUDE_STRING #include "system.h" #include "coretypes.h" #include "backend.h" diff --git a/gcc/final.c b/gcc/final.c index 7af6b612ec7..55cf509611f 100644 --- a/gcc/final.c +++ b/gcc/final.c @@ -43,6 +43,7 @@ along with GCC; see the file COPYING3. If not see function_epilogue. Those instructions never exist as rtl. */ #include "config.h" +#define INCLUDE_ALGORITHM /* reverse */ #include "system.h" #include "coretypes.h" #include "backend.h" diff --git a/gcc/genconditions.c b/gcc/genconditions.c index ab07552a09a..8abf1c243a9 100644 --- a/gcc/genconditions.c +++ b/gcc/genconditions.c @@ -51,6 +51,7 @@ write_header (void) machine description file. */\n\ \n\ #include \"bconfig.h\"\n\ +#define INCLUDE_STRING\n\ #include \"system.h\"\n\ \n\ /* It is necessary, but not entirely safe, to include the headers below\n\ diff --git a/gcc/ipa-chkp.c b/gcc/ipa-chkp.c index 183e7ce161e..4a6b43e7a8a 100644 --- a/gcc/ipa-chkp.c +++ b/gcc/ipa-chkp.c @@ -19,6 +19,7 @@ along with GCC; see the file COPYING3. If not see <http://www.gnu.org/licenses/>. */ #include "config.h" +#define INCLUDE_STRING #include "system.h" #include "coretypes.h" #include "backend.h" diff --git a/gcc/mem-stats.h b/gcc/mem-stats.h index 2c68ca752eb..cdf2885ec2a 100644 --- a/gcc/mem-stats.h +++ b/gcc/mem-stats.h @@ -200,7 +200,9 @@ struct mem_usage static inline void print_dash_line (size_t count = 140) { - fprintf (stderr, "%s\n", std::string (count, '-').c_str ()); + while (count--) + fputc ('-', stderr); + fputc ('\n', stderr); } /* Dump header with NAME. */ diff --git a/gcc/system.h b/gcc/system.h index ba2e96364f1..8151e0a7b2a 100644 --- a/gcc/system.h +++ b/gcc/system.h @@ -198,8 +198,10 @@ extern int fprintf_unlocked (FILE *, const char *, ...); the ctype macros through safe-ctype.h */ #ifdef __cplusplus +#ifdef INCLUDE_STRING # include <string> #endif +#endif /* There are an extraordinary number of issues with <ctype.h>. The last straw is that it varies with the locale. Use libiberty's @@ -215,8 +217,11 @@ extern int errno; #endif #ifdef __cplusplus +#ifdef INCLUDE_ALGORITHM # include <algorithm> +#endif # include <cstring> +# include <new> # include <utility> #endif |