aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorMichael Matz <matz@suse.de>2016-01-22 16:44:10 +0000
committerMichael Matz <matz@gcc.gnu.org>2016-01-22 16:44:10 +0000
commit017360184d9eabff8d1479b3ed09bd1a5b11ff11 (patch)
tree93cc6b7235cf5430477fce1662a210a0904b17e9 /gcc
parent6041f70ae3c9822a41046a7826c1d33818d346bd (diff)
downloadgcc-017360184d9eabff8d1479b3ed09bd1a5b11ff11.zip
gcc-017360184d9eabff8d1479b3ed09bd1a5b11ff11.tar.gz
gcc-017360184d9eabff8d1479b3ed09bd1a5b11ff11.tar.bz2
system.h (string, algorithm): Include only conditionally.
* 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. From-SVN: r232736
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog14
-rw-r--r--gcc/bb-reorder.c1
-rw-r--r--gcc/common/config/aarch64/aarch64-common.c1
-rw-r--r--gcc/config/aarch64/aarch64.c1
-rw-r--r--gcc/final.c1
-rw-r--r--gcc/genconditions.c1
-rw-r--r--gcc/ipa-chkp.c1
-rw-r--r--gcc/mem-stats.h4
-rw-r--r--gcc/system.h5
9 files changed, 28 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 996be87..4a5665f 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 944a25f..8cbde89 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 005ab02..69f5da7 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 03bc1b9..df3dec0 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 7af6b612..55cf509 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 ab07552..8abf1c2 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 183e7ce..4a6b43e 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 2c68ca7..cdf2885 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 ba2e963..8151e0a 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