]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
system.h (string, algorithm): Include only conditionally.
authorMichael Matz <matz@suse.de>
Fri, 22 Jan 2016 16:44:10 +0000 (16:44 +0000)
committerMichael Matz <matz@gcc.gnu.org>
Fri, 22 Jan 2016 16:44:10 +0000 (16:44 +0000)
* 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

gcc/ChangeLog
gcc/bb-reorder.c
gcc/common/config/aarch64/aarch64-common.c
gcc/config/aarch64/aarch64.c
gcc/final.c
gcc/genconditions.c
gcc/ipa-chkp.c
gcc/mem-stats.h
gcc/system.h

index 996be8771dfd0bfca4d22fcc23b117840755f141..4a5665f528e80968922959dfdfdeeb530a90ff16 100644 (file)
@@ -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
index 944a25f536e64851d1905c1013fee779034a8136..8cbde89b5e14582af21c9faa58ebedd3de685deb 100644 (file)
@@ -91,6 +91,7 @@
 */
 
 #include "config.h"
+#define INCLUDE_ALGORITHM /* stable_sort */
 #include "system.h"
 #include "coretypes.h"
 #include "backend.h"
index 005ab02313d2cc9e93a2b2c62d3f2f2a99ca0b38..69f5da70e3d796752040de80ab1594a260e613d1 100644 (file)
@@ -19,6 +19,7 @@
    <http://www.gnu.org/licenses/>.  */
 
 #include "config.h"
+#define INCLUDE_STRING
 #include "system.h"
 #include "coretypes.h"
 #include "tm.h"
index 03bc1b97c2bed85006938f924175e48ad41e780f..df3dec0a72b9d6b81d0b739a1343b430718aec12 100644 (file)
@@ -19,6 +19,7 @@
    <http://www.gnu.org/licenses/>.  */
 
 #include "config.h"
+#define INCLUDE_STRING
 #include "system.h"
 #include "coretypes.h"
 #include "backend.h"
index 7af6b612ec7d8e9aa29fe275315cc22e2b16b6ac..55cf509611f7bc61246c63a6e997bd7402dd8428 100644 (file)
@@ -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"
index ab07552a09aa8a28ca762edd940aa83557e02111..8abf1c243a96dcda35e7adf5e2653fecc18b7fe2 100644 (file)
@@ -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\
index 183e7ce161ea94ea179d4b5b1d6ff0874e0e1418..4a6b43e7a8a3452b909750a8fa6de7e5fae6a0a5 100644 (file)
@@ -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"
index 2c68ca752ebd5f712a64346dacd3196b6987676c..cdf2885ec2a64803170e5ce47da59908beeaf433 100644 (file)
@@ -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.  */
index ba2e96364f120d8c81984e68b3c6d78b899eb735..8151e0a7b2a35c0ac6da0c9dc0083e8098943c84 100644 (file)
@@ -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