This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Remove assert.h includes
- From: "Joseph S. Myers" <joseph at codesourcery dot com>
- To: gcc-patches at gcc dot gnu dot org, java-patches at gcc dot gnu dot org
- Date: Tue, 30 Nov 2010 18:34:17 +0000 (UTC)
- Subject: Remove assert.h includes
When I cleaned up system header includes in random source files, I
missed some includes of assert.h because they were using "" instead of
<> includes. This patch removes such includes, changing code to use
gcc_assert as needed.
Bootstrapped with no regressions on x86_64-unknown-linux-gnu. Also
tested building cc1 for crosses to mcore-elf and spu-elf. OK to
commit?
2010-11-30 Joseph Myers <joseph@codesourcery.com>
* config/mcore/mcore.c Don't include assert.h.
(layout_mcore_frame, handle_structs_in_regs): Use gcc_assert.
* config/spu/spu.c: Don't include assert.h.
(spu_sms_res_mii): Use gcc_assert.
cp:
2010-11-30 Joseph Myers <joseph@codesourcery.com>
* rtti.c: Don't include assert.h.
java:
2010-11-30 Joseph Myers <joseph@codesourcery.com>
* jcf-parse.c: Don't include assert.h.
(java_parse_file): Use gcc_assert.
Index: gcc/java/jcf-parse.c
===================================================================
--- gcc/java/jcf-parse.c (revision 167293)
+++ gcc/java/jcf-parse.c (working copy)
@@ -39,7 +39,6 @@ The Free Software Foundation is independ
#include "parse.h"
#include "ggc.h"
#include "debug.h"
-#include "assert.h"
#include "cgraph.h"
#include "vecprim.h"
#include "bitmap.h"
@@ -1856,7 +1855,7 @@ java_parse_file (void)
const char *resource_filename;
/* Only one resource file may be compiled at a time. */
- assert (VEC_length (tree, all_translation_units) == 1);
+ gcc_assert (VEC_length (tree, all_translation_units) == 1);
resource_filename
= IDENTIFIER_POINTER
Index: gcc/cp/rtti.c
===================================================================
--- gcc/cp/rtti.c (revision 167293)
+++ gcc/cp/rtti.c (working copy)
@@ -29,7 +29,6 @@ along with GCC; see the file COPYING3.
#include "cp-tree.h"
#include "flags.h"
#include "output.h"
-#include "assert.h"
#include "convert.h"
#include "target.h"
#include "c-family/c-pragma.h"
Index: gcc/config/spu/spu.c
===================================================================
--- gcc/config/spu/spu.c (revision 167293)
+++ gcc/config/spu/spu.c (working copy)
@@ -47,7 +47,6 @@
#include "cfglayout.h"
#include "sched-int.h"
#include "params.h"
-#include "assert.h"
#include "machmode.h"
#include "gimple.h"
#include "tm-constrs.h"
@@ -6947,8 +6946,8 @@ spu_sms_res_mii (struct ddg *g)
rtx insn = g->nodes[i].insn;
int p = get_pipe (insn) + 2;
- assert (p >= 0);
- assert (p < 4);
+ gcc_assert (p >= 0);
+ gcc_assert (p < 4);
t[p]++;
if (dump_file && INSN_P (insn))
Index: gcc/config/mcore/mcore.c
===================================================================
--- gcc/config/mcore/mcore.c (revision 167293)
+++ gcc/config/mcore/mcore.c (working copy)
@@ -25,7 +25,6 @@
#include "rtl.h"
#include "tree.h"
#include "tm_p.h"
-#include "assert.h"
#include "mcore.h"
#include "regs.h"
#include "hard-reg-set.h"
@@ -1827,7 +1826,7 @@ layout_mcore_frame (struct mcore_frame *
infp->local_growth = growths;
all -= step;
- assert (all == 0);
+ gcc_assert (all == 0);
/* Finish off if we need to do so. */
if (outbounds)
@@ -1905,8 +1904,8 @@ layout_mcore_frame (struct mcore_frame *
/* Anything else that we've forgotten?, plus a few consistency checks. */
finish:
- assert (infp->reg_offset >= 0);
- assert (growths <= MAX_STACK_GROWS);
+ gcc_assert (infp->reg_offset >= 0);
+ gcc_assert (growths <= MAX_STACK_GROWS);
for (i = 0; i < growths; i++)
gcc_assert (!(infp->growth[i] % STACK_BYTES));
@@ -2773,7 +2772,7 @@ handle_structs_in_regs (enum machine_mod
}
/* We assume here that NPARM_REGS == 6. The assert checks this. */
- assert (ARRAY_SIZE (arg_regs) == 6);
+ gcc_assert (ARRAY_SIZE (arg_regs) == 6);
rtvec = gen_rtvec (nregs, arg_regs[0], arg_regs[1], arg_regs[2],
arg_regs[3], arg_regs[4], arg_regs[5]);
--
Joseph S. Myers
joseph@codesourcery.com