Eliminate source_location in favor of location_t
authorDavid Malcolm <dmalcolm@redhat.com>
Tue, 13 Nov 2018 20:05:03 +0000 (20:05 +0000)
committerDavid Malcolm <dmalcolm@gcc.gnu.org>
Tue, 13 Nov 2018 20:05:03 +0000 (20:05 +0000)
commit620e594be58d2f933902a6619fd20aa618070b4b
tree18b833ac960291d05524d5994ae4292048632226
parentf9731de3db4c59ff0a241ce2c3d6f80aca5b5c28
Eliminate source_location in favor of location_t

Historically GCC used location_t, while libcpp used source_location.

This inconsistency has been annoying me for a while, so this patch
removes source_location in favor of location_t throughout
(as the latter is shorter).

gcc/ChangeLog:
* builtins.c: Replace "source_location" with "location_t".
* diagnostic-show-locus.c: Likewise.
* diagnostic.c: Likewise.
* dumpfile.c: Likewise.
* gcc-rich-location.h: Likewise.
* genmatch.c: Likewise.
* gimple.h: Likewise.
* gimplify.c: Likewise.
* input.c: Likewise.
* input.h: Likewise.  Eliminate the typedef.
* omp-expand.c: Likewise.
* selftest.h: Likewise.
* substring-locations.h (get_source_location_for_substring):
Rename to..
(get_location_within_string): ...this.
* tree-cfg.c: Replace "source_location" with "location_t".
* tree-cfgcleanup.c: Likewise.
* tree-diagnostic.c: Likewise.
* tree-into-ssa.c: Likewise.
* tree-outof-ssa.c: Likewise.
* tree-parloops.c: Likewise.
* tree-phinodes.c: Likewise.
* tree-phinodes.h: Likewise.
* tree-ssa-loop-ivopts.c: Likewise.
* tree-ssa-loop-manip.c: Likewise.
* tree-ssa-phiopt.c: Likewise.
* tree-ssa-phiprop.c: Likewise.
* tree-ssa-threadupdate.c: Likewise.
* tree-ssa.c: Likewise.
* tree-ssa.h: Likewise.
* tree-vect-loop-manip.c: Likewise.

gcc/c-family/ChangeLog:
* c-common.c (c_get_substring_location): Update for renaming of
get_source_location_for_substring to get_location_within_string.
* c-lex.c: Replace "source_location" with "location_t".
* c-opts.c: Likewise.
* c-ppoutput.c: Likewise.

gcc/c/ChangeLog:
* c-decl.c: Replace "source_location" with "location_t".
* c-tree.h: Likewise.
* c-typeck.c: Likewise.
* gimple-parser.c: Likewise.

gcc/cp/ChangeLog:
* call.c: Replace "source_location" with "location_t".
* cp-tree.h: Likewise.
* cvt.c: Likewise.
* name-lookup.c: Likewise.
* parser.c: Likewise.
* typeck.c: Likewise.

gcc/fortran/ChangeLog:
* cpp.c: Replace "source_location" with "location_t".
* gfortran.h: Likewise.

gcc/go/ChangeLog:
* go-gcc-diagnostics.cc: Replace "source_location" with "location_t".
* go-gcc.cc: Likewise.
* go-linemap.cc: Likewise.
* go-location.h: Likewise.
* gofrontend/README: Likewise.

gcc/jit/ChangeLog:
* jit-playback.c: Replace "source_location" with "location_t".

gcc/testsuite/ChangeLog:
* g++.dg/plugin/comment_plugin.c: Replace "source_location" with
"location_t".
* gcc.dg/plugin/diagnostic_plugin_test_show_locus.c: Likewise.

libcc1/ChangeLog:
* libcc1plugin.cc: Replace "source_location" with "location_t".
(plugin_context::get_source_location): Rename to...
(plugin_context::get_location_t): ...this.
* libcp1plugin.cc: Likewise.

libcpp/ChangeLog:
* charset.c: Replace "source_location" with "location_t".
* directives-only.c: Likewise.
* directives.c: Likewise.
* errors.c: Likewise.
* expr.c: Likewise.
* files.c: Likewise.
* include/cpplib.h: Likewise.  Rename MAX_SOURCE_LOCATION to
MAX_LOCATION_T.
* include/line-map.h: Likewise.
* init.c: Likewise.
* internal.h: Likewise.
* lex.c: Likewise.
* line-map.c: Likewise.
* location-example.txt: Likewise.
* macro.c: Likewise.
* pch.c: Likewise.
* traditional.c: Likewise.

From-SVN: r266085
83 files changed:
gcc/ChangeLog
gcc/builtins.c
gcc/c-family/ChangeLog
gcc/c-family/c-common.c
gcc/c-family/c-lex.c
gcc/c-family/c-opts.c
gcc/c-family/c-ppoutput.c
gcc/c/ChangeLog
gcc/c/c-decl.c
gcc/c/c-tree.h
gcc/c/c-typeck.c
gcc/c/gimple-parser.c
gcc/cp/ChangeLog
gcc/cp/call.c
gcc/cp/cp-tree.h
gcc/cp/cvt.c
gcc/cp/decl.c
gcc/cp/name-lookup.c
gcc/cp/parser.c
gcc/cp/typeck.c
gcc/diagnostic-show-locus.c
gcc/diagnostic.c
gcc/dumpfile.c
gcc/fortran/ChangeLog
gcc/fortran/cpp.c
gcc/fortran/gfortran.h
gcc/gcc-rich-location.h
gcc/genmatch.c
gcc/gimple.h
gcc/gimplify.c
gcc/go/ChangeLog
gcc/go/go-gcc-diagnostics.cc
gcc/go/go-gcc.cc
gcc/go/go-linemap.cc
gcc/go/go-location.h
gcc/go/gofrontend/README
gcc/input.c
gcc/input.h
gcc/jit/ChangeLog
gcc/jit/jit-playback.c
gcc/jit/jit-playback.h
gcc/omp-expand.c
gcc/selftest.h
gcc/substring-locations.h
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/plugin/comment_plugin.c
gcc/testsuite/gcc.dg/plugin/diagnostic_plugin_test_show_locus.c
gcc/tree-cfg.c
gcc/tree-cfgcleanup.c
gcc/tree-diagnostic.c
gcc/tree-into-ssa.c
gcc/tree-outof-ssa.c
gcc/tree-parloops.c
gcc/tree-phinodes.c
gcc/tree-phinodes.h
gcc/tree-ssa-loop-ivopts.c
gcc/tree-ssa-loop-manip.c
gcc/tree-ssa-phiopt.c
gcc/tree-ssa-phiprop.c
gcc/tree-ssa-threadupdate.c
gcc/tree-ssa.c
gcc/tree-ssa.h
gcc/tree-vect-loop-manip.c
libcc1/ChangeLog
libcc1/libcc1plugin.cc
libcc1/libcp1plugin.cc
libcpp/ChangeLog
libcpp/charset.c
libcpp/directives-only.c
libcpp/directives.c
libcpp/errors.c
libcpp/expr.c
libcpp/files.c
libcpp/include/cpplib.h
libcpp/include/line-map.h
libcpp/init.c
libcpp/internal.h
libcpp/lex.c
libcpp/line-map.c
libcpp/location-example.txt
libcpp/macro.c
libcpp/pch.c
libcpp/traditional.c