aboutsummaryrefslogtreecommitdiff
path: root/libcpp/internal.h
diff options
context:
space:
mode:
authorDavid Malcolm <dmalcolm@redhat.com>2018-11-13 20:05:03 +0000
committerDavid Malcolm <dmalcolm@gcc.gnu.org>2018-11-13 20:05:03 +0000
commit620e594be58d2f933902a6619fd20aa618070b4b (patch)
tree18b833ac960291d05524d5994ae4292048632226 /libcpp/internal.h
parentf9731de3db4c59ff0a241ce2c3d6f80aca5b5c28 (diff)
downloadgcc-620e594be58d2f933902a6619fd20aa618070b4b.zip
gcc-620e594be58d2f933902a6619fd20aa618070b4b.tar.gz
gcc-620e594be58d2f933902a6619fd20aa618070b4b.tar.bz2
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
Diffstat (limited to 'libcpp/internal.h')
-rw-r--r--libcpp/internal.h40
1 files changed, 20 insertions, 20 deletions
diff --git a/libcpp/internal.h b/libcpp/internal.h
index 98fefeb..59e18ec 100644
--- a/libcpp/internal.h
+++ b/libcpp/internal.h
@@ -150,11 +150,11 @@ typedef struct
location at index 0 is the virtual location of the token at index
0 in the current instance of cpp_context; similarly for all the
other virtual locations. */
- source_location *virt_locs;
+ location_t *virt_locs;
/* This is a pointer to the current virtual location. This is used
to iterate over the virtual locations while we iterate over the
tokens they belong to. */
- source_location *cur_virt_loc;
+ location_t *cur_virt_loc;
} macro_context;
/* The kind of tokens carried by a cpp_context. */
@@ -372,7 +372,7 @@ struct def_pragma_macro {
unsigned char *definition;
/* Definition line number. */
- source_location line;
+ location_t line;
/* If macro defined in system header. */
unsigned int syshdr : 1;
/* Nonzero if it has been expanded or had its existence tested. */
@@ -400,7 +400,7 @@ struct cpp_reader
struct line_maps *line_table;
/* The line of the '#' of the current directive. */
- source_location directive_line;
+ location_t directive_line;
/* Memory buffers. */
_cpp_buff *a_buff; /* Aligned permanent storage. */
@@ -419,7 +419,7 @@ struct cpp_reader
/* When expanding a macro at top-level, this is the location of the
macro invocation. */
- source_location invocation_location;
+ location_t invocation_location;
/* This is the node representing the macro being expanded at
top-level. The value of this data member is valid iff
@@ -551,7 +551,7 @@ struct cpp_reader
unsigned char *base;
unsigned char *limit;
unsigned char *cur;
- source_location first_line;
+ location_t first_line;
} out;
/* Used for buffer overlays by traditional.c. */
@@ -572,7 +572,7 @@ struct cpp_reader
/* If non-zero, the lexer will use this location for the next token
instead of getting a location from the linemap. */
- source_location forced_token_location;
+ location_t forced_token_location;
};
/* Character classes. Based on the more primitive macros in safe-ctype.h.
@@ -646,7 +646,7 @@ extern bool _cpp_arguments_ok (cpp_reader *, cpp_macro *, const cpp_hashnode *,
unsigned int);
extern const unsigned char *_cpp_builtin_macro_text (cpp_reader *,
cpp_hashnode *,
- source_location = 0);
+ location_t = 0);
extern int _cpp_warn_if_unused_macro (cpp_reader *, cpp_hashnode *, void *);
extern void _cpp_push_token_context (cpp_reader *, cpp_hashnode *,
const cpp_token *, unsigned int);
@@ -659,14 +659,14 @@ extern void _cpp_destroy_hashtable (cpp_reader *);
/* In files.c */
typedef struct _cpp_file _cpp_file;
extern _cpp_file *_cpp_find_file (cpp_reader *, const char *, cpp_dir *,
- bool, int, bool, source_location);
+ bool, int, bool, location_t);
extern bool _cpp_find_failed (_cpp_file *);
extern void _cpp_mark_file_once_only (cpp_reader *, struct _cpp_file *);
extern void _cpp_fake_include (cpp_reader *, const char *);
extern bool _cpp_stack_file (cpp_reader *, _cpp_file*, bool,
- source_location);
+ location_t);
extern bool _cpp_stack_include (cpp_reader *, const char *, int,
- enum include_type, source_location);
+ enum include_type, location_t);
extern int _cpp_compare_file_date (cpp_reader *, const char *, int);
extern void _cpp_report_missing_guards (cpp_reader *);
extern void _cpp_init_files (cpp_reader *);
@@ -717,7 +717,7 @@ extern int _cpp_handle_directive (cpp_reader *, int);
extern void _cpp_define_builtin (cpp_reader *, const char *);
extern char ** _cpp_save_pragma_names (cpp_reader *);
extern void _cpp_restore_pragma_names (cpp_reader *, char **);
-extern int _cpp_do__Pragma (cpp_reader *, source_location);
+extern int _cpp_do__Pragma (cpp_reader *, location_t);
extern void _cpp_init_directives (cpp_reader *);
extern void _cpp_init_internal_pragmas (cpp_reader *);
extern void _cpp_do_file_change (cpp_reader *, enum lc_reason, const char *,
@@ -730,7 +730,7 @@ struct _cpp_dir_only_callbacks
{
/* Called to print a block of lines. */
void (*print_lines) (int, const void *, size_t);
- bool (*maybe_print_line) (source_location);
+ bool (*maybe_print_line) (location_t);
};
extern void _cpp_preprocess_dir_only (cpp_reader *,
@@ -867,7 +867,7 @@ ufputs (const unsigned char *s, FILE *f)
the replacement-list of MACRO. */
const line_map_macro *linemap_enter_macro (struct line_maps *,
struct cpp_hashnode*,
- source_location,
+ location_t,
unsigned int);
/* Create and return a virtual location for a token that is part of a
@@ -892,10 +892,10 @@ const line_map_macro *linemap_enter_macro (struct line_maps *,
MACRO_DEFINITION_LOC is the location in the macro definition,
either of the token itself or of a macro parameter that it
replaces. */
-source_location linemap_add_macro_token (const line_map_macro *,
- unsigned int,
- source_location,
- source_location);
+location_t linemap_add_macro_token (const line_map_macro *,
+ unsigned int,
+ location_t,
+ location_t);
/* Return the source line number corresponding to source location
LOCATION. SET is the line map set LOCATION comes from. If
@@ -903,7 +903,7 @@ source_location linemap_add_macro_token (const line_map_macro *,
expansion-list of a macro expansion return the line number of the
macro expansion point. */
int linemap_get_expansion_line (struct line_maps *,
- source_location);
+ location_t);
/* Return the path of the file corresponding to source code location
LOCATION.
@@ -914,7 +914,7 @@ int linemap_get_expansion_line (struct line_maps *,
SET is the line map set LOCATION comes from. */
const char* linemap_get_expansion_filename (struct line_maps *,
- source_location);
+ location_t);
#ifdef __cplusplus
}