aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp
diff options
context:
space:
mode:
authorJoseph Myers <joseph@codesourcery.com>2010-05-27 21:16:07 +0100
committerJoseph Myers <jsm28@gcc.gnu.org>2010-05-27 21:16:07 +0100
commit1da2ed5f19bc5844735b9f5719e5717d744ad54c (patch)
tree7e6bdfc2594989da541ce8acef151a526222f9a7 /gcc/cp
parentfe08ec120475d4da4837d0cb5b13d2e6d38fa56f (diff)
downloadgcc-1da2ed5f19bc5844735b9f5719e5717d744ad54c.zip
gcc-1da2ed5f19bc5844735b9f5719e5717d744ad54c.tar.gz
gcc-1da2ed5f19bc5844735b9f5719e5717d744ad54c.tar.bz2
diagnostic-core.h: New.
* diagnostic-core.h: New. Contents moved from diagnostic.h and toplev.h. * diagnostic.c: Don't include toplev.h. (progname): Define. Moved from toplev.c. (seen_error): New function. * diagnostic.h: Include diagnostic-core.h. (diagnostic_t, emit_diagnostic): Don't declare here. * toplev.c (progname): Move to toplev.c. (emit_debug_global_declarations, compile_file, finalize, do_compile, toplev_main): Use seen_error. * toplev.h: Include diagnostic-core.h. (trim_filename, GCC_DIAG_STYLE, ATTRIBUTE_GCC_DIAG, internal_error, warning, warning_at, error, error_n, error_at, fatal_error, pedwarn, permerror, sorry, inform, inform_n, verbatim, fnotice, progname): Move to diagnostic-core.h. * builtins.c: Include diagnostic-core.h instead of diagnostic.h. (expand_builtin_expect): Use seen_error. * c-decl.c: Include diagnostic-core.h instead of diagnostic.h. (c_make_fname_decl, c_write_global_declarations): Use seen_error. * c-format.c: Include diagnostic-core.h instead of diagnostic.h. * c-gimplify.c: Include diagnostic-core.h instead of diagnostic.h. * c-lang.c: Include diagnostic-core.h instead of diagnostic.h. * c-lex.c (c_lex_with_flags, interpret_float): Don't increment errorcount for errors. * c-opts.c (c_common_finish): Use seen_error. * cgraph.c: Include diagnostic-core.h instead of diagnostic.h. * cgraphunit.c (verify_cgraph_node, verify_cgraph, cgraph_output_pending_asms, cgraph_optimize): Use seen_error. * coverage.c: Include diagnostic-core.h instead of diagnostic.h. (get_coverage_counts): Use seen_error. * dwarf2out.c (dwarf2out_finish): Use seen_error. * gimplify.c (gimplify_var_or_parm_decl, gimple_push_cleanup, gimplify_body): Use seen_error. * ipa-inline.c (cgraph_early_inlining): Use seen_error. * ipa-pure-const.c (gate_pure_const): Use seen_error. * ipa-reference.c (gate_reference): Use seen_error. * jump.c: Include diagnostic-core.h instead of diagnostic.h. * lambda-code.c: Include diagnostic-core.h instead of diagnostic.h. * lto-cgraph.c: Include diagnostic-core.h instead of diagnostic.h. * lto-compress.c: Include diagnostic-core.h instead of diagnostic.h. * lto-section-in.c: Include diagnostic-core.h instead of diagnostic.h. * lto-streamer-out.c: Include diagnostic-core.h instead of diagnostic.h. * lto-streamer.c: Include diagnostic-core.h instead of diagnostic.h. (gate_lto_out): Use seen_error. * matrix-reorg.c: Include diagnostic-core.h instead of diagnostic.h. * omega.c: Include diagnostic-core.h instead of diagnostic.h. * omp-low.c: Include diagnostic-core.h instead of diagnostic.h. (gate_expand_omp, lower_omp_1): Use seen_error. * passes.c: Include diagnostic-core.h instead of diagnostic.h. (rest_of_decl_compilation, rest_of_type_compilation, gate_rest_of_compilation, ipa_write_summaries): Use seen_error. * tree-cfg.c (label_to_block_fn): Use seen_error. * tree-inline.c (optimize_inline_calls): Use seen_error. * tree-mudflap.c (mudflap_finish_file): Use seen_error. * tree-optimize.c (gate_all_optimizations, gate_all_early_local_passes, gate_all_early_optimizations): Use seen_error. * tree-ssa-structalias.c (gate_ipa_pta): Use seen_error. * varpool.c: Include diagnostic-core.h instead of diagnostic.h. (varpool_remove_unreferenced_decls, varpool_assemble_pending_decls): Use seen_error. * Makefile.in (DIAGNOSTIC_CORE_H): Define. (TOPLEV_H, DIAGNOSTIC_H): Update. (c-decl.o, c-lang.o, c-format.o, lto-compress.o, lto-cgraph.o, lto-streamer-out.o, lto-section-in.o, lto-streamer.o, c-gimplify.o, omp-low.o, omega.o, diagnostic.o, passes.o, builtins.o, jump.o, cgraph.o, varpool.o, matrix-reorg.o, coverage.o, lambda-code.o): Update dependencies. cp: * call.c: Include diagnostic-core.h instead of diagnostic.h. * cp-lang.c: Don't include diagnostic.h * name-lookup.c: Include diagnostic-core.h instead of diagnostic.h. (cp_emit_debug_info_for_using): Use seen_error. * optimize.c: Include diagnostic-core.h instead of diagnostic.h. * parser.c: Include diagnostic-core.h instead of diagnostic.h. * pt.c (iterative_hash_template_arg): Use seen_error. * repo.c: Include diagnostic-core.h instead of diagnostic.h. * typeck2.c: Include diagnostic-core.h instead of diagnostic.h. * Make-lang.in (cp/cp-lang.o, cp/typeck2.o, cp/call.o, cp/repo.o, cp/optimize.o, cp/parser.o, cp/name-lookup.o): Update dependencies. lto: * lto.c: Include diagnostic-core.h instead of diagnostic.h. (read_cgraph_and_symbols, lto_main): Use seen_error. * Make-lang.in (lto/lto.o): Update dependencies. objc: * objc-act.c: Include diagnostic-core.h instead of diagnostic.h. * Make-lang.in (objc/objc-act.o): Update dependencies. From-SVN: r159947
Diffstat (limited to 'gcc/cp')
-rw-r--r--gcc/cp/ChangeLog16
-rw-r--r--gcc/cp/Make-lang.in16
-rw-r--r--gcc/cp/call.c4
-rw-r--r--gcc/cp/cp-lang.c4
-rw-r--r--gcc/cp/name-lookup.c4
-rw-r--r--gcc/cp/optimize.c6
-rw-r--r--gcc/cp/parser.c2
-rw-r--r--gcc/cp/pt.c2
-rw-r--r--gcc/cp/repo.c6
-rw-r--r--gcc/cp/typeck2.c4
10 files changed, 40 insertions, 24 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index f359b21..80d86c8 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,19 @@
+2010-05-27 Joseph Myers <joseph@codesourcery.com>
+
+ * call.c: Include diagnostic-core.h instead of diagnostic.h.
+ * cp-lang.c: Don't include diagnostic.h
+ * name-lookup.c: Include diagnostic-core.h instead of
+ diagnostic.h.
+ (cp_emit_debug_info_for_using): Use seen_error.
+ * optimize.c: Include diagnostic-core.h instead of diagnostic.h.
+ * parser.c: Include diagnostic-core.h instead of diagnostic.h.
+ * pt.c (iterative_hash_template_arg): Use seen_error.
+ * repo.c: Include diagnostic-core.h instead of diagnostic.h.
+ * typeck2.c: Include diagnostic-core.h instead of diagnostic.h.
+ * Make-lang.in (cp/cp-lang.o, cp/typeck2.o, cp/call.o, cp/repo.o,
+ cp/optimize.o, cp/parser.o, cp/name-lookup.o): Update
+ dependencies.
+
2010-05-25 Dodji Seketeli <dodji@redhat.com>
PR c++/44188
diff --git a/gcc/cp/Make-lang.in b/gcc/cp/Make-lang.in
index 7a85212..222988d 100644
--- a/gcc/cp/Make-lang.in
+++ b/gcc/cp/Make-lang.in
@@ -251,7 +251,7 @@ cp/lex.o: cp/lex.c $(CXX_TREE_H) $(TM_H) $(FLAGS_H) \
$(C_PRAGMA_H) toplev.h output.h input.h cp/operators.def $(TM_P_H)
cp/cp-lang.o: cp/cp-lang.c $(CXX_TREE_H) $(TM_H) toplev.h debug.h langhooks.h \
$(LANGHOOKS_DEF_H) $(C_COMMON_H) gtype-cp.h gt-cp-cp-lang.h \
- $(DIAGNOSTIC_H) cp/cp-objcp-common.h $(EXPR_H) $(EXCEPT_H)
+ cp/cp-objcp-common.h $(EXPR_H) $(EXCEPT_H)
cp/decl.o: cp/decl.c $(CXX_TREE_H) $(TM_H) $(FLAGS_H) cp/decl.h \
output.h $(EXCEPT_H) toplev.h $(HASHTAB_H) $(RTL_H) \
cp/operators.def $(TM_P_H) $(TREE_INLINE_H) $(DIAGNOSTIC_H) $(C_PRAGMA_H) \
@@ -266,7 +266,7 @@ cp/cp-objcp-common.o : cp/cp-objcp-common.c $(CONFIG_H) $(SYSTEM_H) \
langhooks.h $(LANGHOOKS_DEF_H) $(DIAGNOSTIC_H) debug.h \
$(CXX_PRETTY_PRINT_H) cp/cp-objcp-common.h gt-cp-cp-objcp-common.h
cp/typeck2.o: cp/typeck2.c $(CXX_TREE_H) $(TM_H) $(FLAGS_H) toplev.h output.h \
- $(TM_P_H) $(DIAGNOSTIC_H) gt-cp-typeck2.h $(REAL_H) intl.h
+ $(TM_P_H) $(DIAGNOSTIC_CORE_H) gt-cp-typeck2.h $(REAL_H) intl.h
cp/typeck.o: cp/typeck.c $(CXX_TREE_H) $(TM_H) $(FLAGS_H) \
toplev.h $(DIAGNOSTIC_H) convert.h $(C_COMMON_H) $(TARGET_H) \
output.h toplev.h
@@ -274,7 +274,7 @@ cp/class.o: cp/class.c $(CXX_TREE_H) $(TM_H) $(FLAGS_H) toplev.h \
$(TARGET_H) convert.h $(CGRAPH_H) $(TREE_DUMP_H) gt-cp-class.h \
$(SPLAY_TREE_H)
cp/call.o: cp/call.c $(CXX_TREE_H) $(TM_H) $(FLAGS_H) toplev.h \
- $(DIAGNOSTIC_H) intl.h gt-cp-call.h convert.h $(TARGET_H) langhooks.h
+ $(DIAGNOSTIC_CORE_H) intl.h gt-cp-call.h convert.h $(TARGET_H) langhooks.h
cp/friend.o: cp/friend.c $(CXX_TREE_H) $(TM_H) $(FLAGS_H) toplev.h
cp/init.o: cp/init.c $(CXX_TREE_H) $(TM_H) $(FLAGS_H) \
toplev.h $(EXCEPT_H) $(TARGET_H)
@@ -300,7 +300,7 @@ cp/pt.o: cp/pt.c $(CXX_TREE_H) $(TM_H) cp/decl.h cp/cp-objcp-common.h \
cp/error.o: cp/error.c $(CXX_TREE_H) $(TM_H) toplev.h $(DIAGNOSTIC_H) \
$(FLAGS_H) $(REAL_H) $(LANGHOOKS_DEF_H) $(CXX_PRETTY_PRINT_H) \
tree-diagnostic.h tree-pretty-print.h
-cp/repo.o: cp/repo.c $(CXX_TREE_H) $(TM_H) toplev.h $(DIAGNOSTIC_H) \
+cp/repo.o: cp/repo.c $(CXX_TREE_H) $(TM_H) toplev.h $(DIAGNOSTIC_CORE_H) \
gt-cp-repo.h
cp/semantics.o: cp/semantics.c $(CXX_TREE_H) $(TM_H) $(EXCEPT_H) toplev.h \
$(FLAGS_H) output.h $(RTL_H) $(TIMEVAR_H) \
@@ -309,17 +309,17 @@ cp/semantics.o: cp/semantics.c $(CXX_TREE_H) $(TM_H) $(EXCEPT_H) toplev.h \
cp/dump.o: cp/dump.c $(CXX_TREE_H) $(TM_H) $(TREE_DUMP_H)
cp/optimize.o: cp/optimize.c $(CXX_TREE_H) $(TM_H) \
input.h $(PARAMS_H) debug.h $(TREE_INLINE_H) $(GIMPLE_H) \
- $(TARGET_H) tree-iterator.h $(CGRAPH_H)
+ $(TARGET_H) tree-iterator.h $(CGRAPH_H) $(DIAGNOSTIC_CORE_H)
cp/mangle.o: cp/mangle.c $(CXX_TREE_H) $(TM_H) toplev.h $(REAL_H) \
gt-cp-mangle.h $(TARGET_H) $(TM_P_H) $(CGRAPH_H)
-cp/parser.o: cp/parser.c $(CXX_TREE_H) $(TM_H) $(DIAGNOSTIC_H) gt-cp-parser.h \
- output.h $(TARGET_H) $(PLUGIN_H) intl.h
+cp/parser.o: cp/parser.c $(CXX_TREE_H) $(TM_H) $(DIAGNOSTIC_CORE_H) \
+ gt-cp-parser.h output.h $(TARGET_H) $(PLUGIN_H) intl.h
cp/cp-gimplify.o: cp/cp-gimplify.c $(CXX_TREE_H) toplev.h $(C_COMMON_H) \
$(TM_H) coretypes.h pointer-set.h tree-iterator.h
cp/name-lookup.o: cp/name-lookup.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
$(TM_H) $(CXX_TREE_H) $(TIMEVAR_H) gt-cp-name-lookup.h toplev.h \
- $(DIAGNOSTIC_H) $(FLAGS_H) debug.h
+ $(DIAGNOSTIC_CORE_H) $(FLAGS_H) debug.h
cp/cxx-pretty-print.o: cp/cxx-pretty-print.c $(CXX_PRETTY_PRINT_H) \
$(CONFIG_H) $(SYSTEM_H) $(TM_H) coretypes.h $(CXX_TREE_H) tree-pretty-print.h
diff --git a/gcc/cp/call.c b/gcc/cp/call.c
index 76fec59..64e2e50 100644
--- a/gcc/cp/call.c
+++ b/gcc/cp/call.c
@@ -1,6 +1,6 @@
/* Functions related to invoking methods and overloaded functions.
Copyright (C) 1987, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
- 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
+ 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
Free Software Foundation, Inc.
Contributed by Michael Tiemann (tiemann@cygnus.com) and
modified by Brendan Kehoe (brendan@cygnus.com).
@@ -33,7 +33,7 @@ along with GCC; see the file COPYING3. If not see
#include "output.h"
#include "flags.h"
#include "toplev.h"
-#include "diagnostic.h"
+#include "diagnostic-core.h"
#include "intl.h"
#include "target.h"
#include "convert.h"
diff --git a/gcc/cp/cp-lang.c b/gcc/cp/cp-lang.c
index d19e20f..a08f0dd 100644
--- a/gcc/cp/cp-lang.c
+++ b/gcc/cp/cp-lang.c
@@ -1,5 +1,6 @@
/* Language-dependent hooks for C++.
- Copyright 2001, 2002, 2004, 2007, 2008, 2009 Free Software Foundation, Inc.
+ Copyright 2001, 2002, 2004, 2007, 2008, 2009, 2010
+ Free Software Foundation, Inc.
Contributed by Alexandre Oliva <aoliva@redhat.com>
This file is part of GCC.
@@ -28,7 +29,6 @@ along with GCC; see the file COPYING3. If not see
#include "toplev.h"
#include "langhooks.h"
#include "langhooks-def.h"
-#include "diagnostic.h"
#include "debug.h"
#include "cp-objcp-common.h"
#include "hashtab.h"
diff --git a/gcc/cp/name-lookup.c b/gcc/cp/name-lookup.c
index 405bf16..051d3c5 100644
--- a/gcc/cp/name-lookup.c
+++ b/gcc/cp/name-lookup.c
@@ -29,7 +29,7 @@ along with GCC; see the file COPYING3. If not see
#include "name-lookup.h"
#include "timevar.h"
#include "toplev.h"
-#include "diagnostic.h"
+#include "diagnostic-core.h"
#include "debug.h"
#include "c-pragma.h"
@@ -5505,7 +5505,7 @@ void
cp_emit_debug_info_for_using (tree t, tree context)
{
/* Don't try to emit any debug information if we have errors. */
- if (sorrycount || errorcount)
+ if (seen_error ())
return;
/* Ignore this FUNCTION_DECL if it refers to a builtin declaration
diff --git a/gcc/cp/optimize.c b/gcc/cp/optimize.c
index f512570..0196eae 100644
--- a/gcc/cp/optimize.c
+++ b/gcc/cp/optimize.c
@@ -1,6 +1,6 @@
/* Perform optimizations on tree structure.
- Copyright (C) 1998, 1999, 2000, 2001, 2002, 2004, 2005, 2007, 2008, 2009
- Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2000, 2001, 2002, 2004, 2005, 2007, 2008, 2009,
+ 2010 Free Software Foundation, Inc.
Written by Mark Michell (mark@codesourcery.com).
This file is part of GCC.
@@ -34,7 +34,7 @@ along with GCC; see the file COPYING3. If not see
#include "tree-inline.h"
#include "flags.h"
#include "langhooks.h"
-#include "diagnostic.h"
+#include "diagnostic-core.h"
#include "tree-dump.h"
#include "gimple.h"
#include "tree-iterator.h"
diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c
index 36d7eae..4a50b55 100644
--- a/gcc/cp/parser.c
+++ b/gcc/cp/parser.c
@@ -30,7 +30,7 @@ along with GCC; see the file COPYING3. If not see
#include "c-pragma.h"
#include "decl.h"
#include "flags.h"
-#include "diagnostic.h"
+#include "diagnostic-core.h"
#include "toplev.h"
#include "output.h"
#include "target.h"
diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c
index fd34d9f..9eeba8a 100644
--- a/gcc/cp/pt.c
+++ b/gcc/cp/pt.c
@@ -1564,7 +1564,7 @@ iterative_hash_template_arg (tree arg, hashval_t val)
case LAMBDA_EXPR:
/* A lambda can't appear in a template arg, but don't crash on
erroneous input. */
- gcc_assert (errorcount > 0);
+ gcc_assert (seen_error ());
return val;
default:
diff --git a/gcc/cp/repo.c b/gcc/cp/repo.c
index aa97078..08a4d62 100644
--- a/gcc/cp/repo.c
+++ b/gcc/cp/repo.c
@@ -1,6 +1,6 @@
/* Code to maintain a C++ template repository.
Copyright (C) 1995, 1996, 1997, 1998, 2000, 2001, 2002, 2003, 2004, 2005,
- 2006, 2007, 2008 Free Software Foundation, Inc.
+ 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
Contributed by Jason Merrill (jason@cygnus.com)
This file is part of GCC.
@@ -34,7 +34,7 @@ along with GCC; see the file COPYING3. If not see
#include "input.h"
#include "obstack.h"
#include "toplev.h"
-#include "diagnostic.h"
+#include "diagnostic-core.h"
#include "flags.h"
static const char *extract_string (const char **);
@@ -243,7 +243,7 @@ finish_repo (void)
if (!flag_use_repository || flag_compare_debug)
return;
- if (errorcount || sorrycount)
+ if (seen_error ())
return;
repo_file = reopen_repo_file_for_write ();
diff --git a/gcc/cp/typeck2.c b/gcc/cp/typeck2.c
index b1336bf..e512272 100644
--- a/gcc/cp/typeck2.c
+++ b/gcc/cp/typeck2.c
@@ -1,7 +1,7 @@
/* Report error messages, build initializers, and perform
some front-end optimizations for C++ compiler.
Copyright (C) 1987, 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
- 1999, 2000, 2001, 2002, 2004, 2005, 2006, 2007, 2008, 2009
+ 1999, 2000, 2001, 2002, 2004, 2005, 2006, 2007, 2008, 2009, 2010
Free Software Foundation, Inc.
Hacked by Michael Tiemann (tiemann@cygnus.com)
@@ -37,7 +37,7 @@ along with GCC; see the file COPYING3. If not see
#include "flags.h"
#include "toplev.h"
#include "output.h"
-#include "diagnostic.h"
+#include "diagnostic-core.h"
static tree
process_init_constructor (tree type, tree init);