summaryrefslogtreecommitdiff
path: root/gcc/varasm.c
diff options
context:
space:
mode:
authorgdr <gdr@138bc75d-0d04-0410-961f-82ee72b054a4>2003-07-25 09:52:32 +0000
committergdr <gdr@138bc75d-0d04-0410-961f-82ee72b054a4>2003-07-25 09:52:32 +0000
commitaa6db498f761e819dc21a433168a0cb9646a369e (patch)
tree0cd9e2817d3c1f65316bb57b92b7f8d6cd0f1864 /gcc/varasm.c
parent4b7f0943a248a88ce11c339ac4eefcab186dfe5b (diff)
downloadgcc-aa6db498f761e819dc21a433168a0cb9646a369e.tar.gz
Remove pedwarn_with_decl, warning_with_decl and error_with_decl
from GCC. * calls.c (try_to_integrate): Don't use xxx_with_decl. (expand_call): Likewise. * dwarfout.c (output_reg_number): Likewise. * expr.c (expand_expr): Likewise. * function.c (assign_temp): Likewise. (uninitialized_vars_warning): Likewise. (setjmp_args_warning): Likewise. (expand_function_end): Likewise. * stmt.c (fixup_gotos): Likewise. (warn_about_unused_variables): Likewise. (expand_end_bindings): Likewise. * stor-layout.c (layout_decl): Likewise. (place_field): Likewise. * toplev.c (check_global_declarations): Likewise. (rest_of_handle_inlining): Likewise. (default_tree_printer): New function. (general_init): Initialize diagnostic machinery before routing signals to the ICE machinery. Set default tree printer. * toplev.h (pedwarn_with_decl): Remove declaration. (warning_with_decl): Likewise. (error_with_decl): Likewise. (pedwarn): Remove attribute for the time being. * tree-inline.c (expand_call_inline): Don't use xxx_with_decl. * varasm.c (named_section): Likewise. (make_decl_rtl): Likewise. (assemble_variable): Likewise. (merge_weak): Likewise. (declare_weak): Likewise. * diagnostic.h: Move non-diagnostic stuff into pretty-print.h. * diagnostic.c: Move non-diagnostic stuff into pretty-print.c. (format_with_decl): Remove. (diagnostic_for_decl): Likewise. (pedwarn_with_decl): Likewise. (warning_with_decl): Likewise. (error_with_decl): Likewise. (diagnostic_initialize): Adjust. (diagnostic_count_diagnostic): Likewise. (announce_function): Likewise. (lhd_print_error_function): Likewise. (diagnostic_report_current_module): Likewise. (default_diagnostic_starter): Likewise. (diagnostic_report_diagnostic): Likewise. (default_diagnostic_finalizer): Likewise. (verbatim): Likewise. (error): Likewise. (warning): Likewise. * opts.c (common_handle_option): Likewise. * pretty-print.c: New file. * c-pretty-print.h (pp_base): Override. * c-pretty-print.c: Adjust use of macros throughout. (pp_buffer): New macro. (pp_newline): Likewise. * c-objc-common.c (c_tree_printer): Adjust prototype. Tidy. * Makefile.in (DIAGNOSTIC_H): New variable. (c-errors.o): Use it. (c-objc-common.o): Likewise. (c-common.o): Likewise. (c-opts.o): Likewise. (c-format.o): Likewise. (diagnostic.o): Likewise. (opts.o): Likewise. (toplev.o): Likewise. (rtl-error.o): Likewise. (dwarf2out.o): Likewise. (jump.o): Likewise. (pretty-print.o): New rule. cp/ * Make-lang.in (cp/error.o): Depend on DIAGNOSTIC_H. * error.c: Use the new pretty-printer fraamework. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@69773 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/varasm.c')
-rw-r--r--gcc/varasm.c52
1 files changed, 31 insertions, 21 deletions
diff --git a/gcc/varasm.c b/gcc/varasm.c
index 847cf7719f9..a8ff36fb0dc 100644
--- a/gcc/varasm.c
+++ b/gcc/varasm.c
@@ -432,7 +432,8 @@ named_section (tree decl, const char *name, int reloc)
{
flags = get_named_section_flags (name);
if ((flags & SECTION_OVERRIDE) == 0)
- error_with_decl (decl, "%s causes a section type conflict");
+ error ("%H%D causes a section type conflict",
+ &DECL_SOURCE_LOCATION (decl), decl);
}
named_section_flags (name, flags);
@@ -802,15 +803,17 @@ make_decl_rtl (tree decl, const char *asmspec)
{
/* First detect errors in declaring global registers. */
if (reg_number == -1)
- error_with_decl (decl, "register name not specified for `%s'");
+ error ("%Hregister name not specified for '%D'",
+ &DECL_SOURCE_LOCATION (decl), decl);
else if (reg_number < 0)
- error_with_decl (decl, "invalid register name for `%s'");
+ error ("%Hinvalid register name for '%D'",
+ &DECL_SOURCE_LOCATION (decl), decl);
else if (TYPE_MODE (TREE_TYPE (decl)) == BLKmode)
- error_with_decl (decl,
- "data type of `%s' isn't suitable for a register");
+ error ("%Hdata type of '%D' isn't suitable for a register",
+ &DECL_SOURCE_LOCATION (decl), decl);
else if (! HARD_REGNO_MODE_OK (reg_number, TYPE_MODE (TREE_TYPE (decl))))
- error_with_decl (decl,
- "register specified for `%s' isn't suitable for data type");
+ error ("%Hregister specified for '%D' isn't suitable for data type",
+ &DECL_SOURCE_LOCATION (decl), decl);
/* Now handle properly declared static register variables. */
else
{
@@ -854,8 +857,8 @@ make_decl_rtl (tree decl, const char *asmspec)
Also handle vars declared register invalidly. */
if (reg_number >= 0 || reg_number == -3)
- error_with_decl (decl,
- "register name given for non-register variable `%s'");
+ error ("%Hregister name given for non-register variable '%D'",
+ &DECL_SOURCE_LOCATION (decl), decl);
/* Specifying a section attribute on a variable forces it into a
non-.bss section, and thus it cannot be common. */
@@ -1391,7 +1394,8 @@ assemble_variable (tree decl, int top_level ATTRIBUTE_UNUSED,
if (! dont_output_data
&& ! host_integerp (DECL_SIZE_UNIT (decl), 1))
{
- error_with_decl (decl, "size of variable `%s' is too large");
+ error ("%Hsize of variable '%D' is too large",
+ &DECL_SOURCE_LOCATION (decl), decl);
return;
}
@@ -1429,9 +1433,9 @@ assemble_variable (tree decl, int top_level ATTRIBUTE_UNUSED,
#endif
if (align > MAX_OFILE_ALIGNMENT)
{
- warning_with_decl (decl,
- "alignment of `%s' is greater than maximum object file alignment. Using %d",
- MAX_OFILE_ALIGNMENT/BITS_PER_UNIT);
+ warning ("%Halignment of '%D' is greater than maximum object "
+ "file alignment. Using %d", &DECL_SOURCE_LOCATION (decl),
+ decl, MAX_OFILE_ALIGNMENT/BITS_PER_UNIT);
align = MAX_OFILE_ALIGNMENT;
}
@@ -1497,8 +1501,9 @@ assemble_variable (tree decl, int top_level ATTRIBUTE_UNUSED,
#if !defined(ASM_OUTPUT_ALIGNED_COMMON) && !defined(ASM_OUTPUT_ALIGNED_DECL_COMMON) && !defined(ASM_OUTPUT_ALIGNED_BSS)
if ((unsigned HOST_WIDE_INT) DECL_ALIGN (decl) / BITS_PER_UNIT > rounded)
- warning_with_decl
- (decl, "requested alignment for %s is greater than implemented alignment of %d",rounded);
+ warning ("%Hrequested alignment for '%D' is greater than "
+ "implemented alignment of %d", &DECL_SOURCE_LOCATION (decl),
+ decl, rounded);
#endif
/* If the target cannot output uninitialized but not common global data
@@ -4169,15 +4174,17 @@ merge_weak (tree newdecl, tree olddecl)
declare_weak because the NEWDECL and OLDDECL was not yet
been merged; therefore, TREE_ASM_WRITTEN was not set. */
if (TREE_ASM_WRITTEN (olddecl))
- error_with_decl (newdecl,
- "weak declaration of `%s' must precede definition");
+ error ("%Hweak declaration of '%D' must precede definition",
+ &DECL_SOURCE_LOCATION (newdecl), newdecl);
/* If we've already generated rtl referencing OLDDECL, we may
have done so in a way that will not function properly with
a weak symbol. */
else if (TREE_USED (olddecl)
&& TREE_SYMBOL_REFERENCED (DECL_ASSEMBLER_NAME (olddecl)))
- warning_with_decl (newdecl, "weak declaration of `%s' after first use results in unspecified behavior");
+ warning ("%Hweak declaration of '%D' after first use results "
+ "in unspecified behavior",
+ &DECL_SOURCE_LOCATION (newdecl), newdecl);
if (SUPPORTS_WEAK)
{
@@ -4210,16 +4217,19 @@ void
declare_weak (tree decl)
{
if (! TREE_PUBLIC (decl))
- error_with_decl (decl, "weak declaration of `%s' must be public");
+ error ("%Hweak declaration of '%D' must be public",
+ &DECL_SOURCE_LOCATION (decl), decl);
else if (TREE_CODE (decl) == FUNCTION_DECL && TREE_ASM_WRITTEN (decl))
- error_with_decl (decl, "weak declaration of `%s' must precede definition");
+ error ("%Hweak declaration of '%D' must precede definition",
+ &DECL_SOURCE_LOCATION (decl), decl);
else if (SUPPORTS_WEAK)
{
if (! DECL_WEAK (decl))
weak_decls = tree_cons (NULL, decl, weak_decls);
}
else
- warning_with_decl (decl, "weak declaration of `%s' not supported");
+ warning ("%Hweak declaration of '%D' not supported",
+ &DECL_SOURCE_LOCATION (decl), decl);
mark_weak (decl);
}