diff options
author | jsm28 <jsm28@138bc75d-0d04-0410-961f-82ee72b054a4> | 2015-01-30 16:15:00 +0000 |
---|---|---|
committer | jsm28 <jsm28@138bc75d-0d04-0410-961f-82ee72b054a4> | 2015-01-30 16:15:00 +0000 |
commit | c05be8671d0c5eeffdd417faad91583e791083d7 (patch) | |
tree | 205b68f7ca81a40e0ec33999911c7cd124be49b1 /libcc1 | |
parent | 29f68d21d683541a286f85185c7e6a9a0cb21e3d (diff) | |
download | gcc-c05be8671d0c5eeffdd417faad91583e791083d7.tar.gz |
Always pass explicit location to fatal_error.
The patch <https://gcc.gnu.org/ml/gcc-patches/2014-11/msg00698.html>
adding an overload for fatal_error that passes an explicit location
broke gcc.pot regeneration because xgettext cannot handle function
overloads with the diagnostic string argument in different positions.
As the desired direction is for all diagnostics to have explicit
locations, this patch addresses the regression by removing the version
of fatal_error that does not pass a location, passing explicit
input_location everywhere (in the hope that those will incrementally
be changed to other locations, much as with the addition of a location
argument to pedwarn some time ago - a lot of cases aren't meaningfully
associated with a source file so UNKNOWN_LOCATION may be better).
Note that this patch does not attempt to fix any existing issues with
these diagnostics (such as wrongly starting with capital letters or
ending with '.' or '\n'); it just adds the input_location argument.
Bootstrapped with no regressions for x86_64-unknown-linux-gnu (Go
excluded).
gcc:
* diagnostic.c (fatal_error (const char *, ...)): Remove function.
* diagnostic-core.h (fatal_error (const char *, ...)): Remove
prototype.
* toplev.h (init_asm_output): Update comment on use of
UNKNOWN_LOCATION with fatal_error.
* cgraph.c, collect-utils.c, collect2.c, config/arc/arc.c,
config/arc/arc.md, config/avr/avr.c, config/c6x/c6x.h,
config/darwin.c, config/host-darwin.c, config/i386/host-cygwin.c,
config/i386/intelmic-mkoffload.c, config/nios2/nios2.c,
config/nvptx/mkoffload.c, config/nvptx/nvptx.h,
config/rs6000/host-darwin.c, config/rs6000/rs6000.c,
config/s390/s390.c, gcc.c, gcov-io.h, gcov-tool.c, ggc-common.c,
ggc-page.c, graph.c, ipa-inline-analysis.c, ipa-reference.c,
lto-cgraph.c, lto-section-in.c, lto-streamer-in.c, lto-streamer.c,
lto-wrapper.c, objc/objc-act.c, opts.c, passes.c, plugin.c,
tlink.c, toplev.c, tree-streamer-in.c, varpool.c: All callers of
fatal_error changed to pass input_location as first argument.
gcc/c-family:
* c-opts.c, c-pch.c, cppspec.c: All callers of fatal_error changed
to pass input_location as first argument.
gcc/cp:
* class.c, except.c, parser.c, pt.c: All callers of fatal_error
changed to pass input_location as first argument.
gcc/fortran:
* f95-lang.c, gfortranspec.c, trans-const.c, trans-expr.c: All
callers of fatal_error changed to pass input_location as first
argument.
gcc/java:
* class.c, expr.c, jcf-parse.c, jvspec.c: All callers of
fatal_error changed to pass input_location as first argument.
gcc/lto:
* lto-object.c, lto-symtab.c, lto.c: All callers of fatal_error
changed to pass input_location as first argument.
libcc1:
* plugin.cc: All callers of fatal_error changed to pass
input_location as first argument.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@220293 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libcc1')
-rw-r--r-- | libcc1/ChangeLog | 5 | ||||
-rw-r--r-- | libcc1/plugin.cc | 12 |
2 files changed, 13 insertions, 4 deletions
diff --git a/libcc1/ChangeLog b/libcc1/ChangeLog index b0507eb2a9b..09e75a71380 100644 --- a/libcc1/ChangeLog +++ b/libcc1/ChangeLog @@ -1,3 +1,8 @@ +2015-01-30 Joseph Myers <joseph@codesourcery.com> + + * plugin.cc: All callers of fatal_error changed to pass + input_location as first argument. + 2015-01-09 Michael Collison <michael.collison@linaro.org> * plugin.cc: Include hash-set.h, machmode.h, vec.h, double-int.h, diff --git a/libcc1/plugin.cc b/libcc1/plugin.cc index 7e011999aa5..c4caf05907b 100644 --- a/libcc1/plugin.cc +++ b/libcc1/plugin.cc @@ -836,13 +836,15 @@ plugin_init (struct plugin_name_args *plugin_info, errno = 0; fd = strtol (plugin_info->argv[i].value, &tail, 0); if (*tail != '\0' || errno != 0) - fatal_error ("%s: invalid file descriptor argument to plugin", + fatal_error (input_location, + "%s: invalid file descriptor argument to plugin", plugin_info->base_name); break; } } if (fd == -1) - fatal_error ("%s: required plugin argument %<fd%> is missing", + fatal_error (input_location, + "%s: required plugin argument %<fd%> is missing", plugin_info->base_name); current_context = new plugin_context (fd); @@ -851,9 +853,11 @@ plugin_init (struct plugin_name_args *plugin_info, cc1_plugin::protocol_int version; if (!current_context->require ('H') || ! ::cc1_plugin::unmarshall (current_context, &version)) - fatal_error ("%s: handshake failed", plugin_info->base_name); + fatal_error (input_location, + "%s: handshake failed", plugin_info->base_name); if (version != GCC_C_FE_VERSION_0) - fatal_error ("%s: unknown version in handshake", plugin_info->base_name); + fatal_error (input_location, + "%s: unknown version in handshake", plugin_info->base_name); register_callback (plugin_info->base_name, PLUGIN_PRAGMAS, plugin_init_extra_pragmas, NULL); |