aboutsummaryrefslogtreecommitdiff
path: root/libcpp/lex.c
diff options
context:
space:
mode:
authorNathan Sidwell <nathan@acm.org>2018-10-31 15:26:28 +0000
committerNathan Sidwell <nathan@gcc.gnu.org>2018-10-31 15:26:28 +0000
commitf3f6029db2e5f960c10062d8c8c74d766fcad6d2 (patch)
tree65fe76f5ca430fb5055b03a24045e1d61e3668be /libcpp/lex.c
parent82a14443dbad05cdf1bd09c7ebc98c406c81e384 (diff)
downloadgcc-f3f6029db2e5f960c10062d8c8c74d766fcad6d2.zip
gcc-f3f6029db2e5f960c10062d8c8c74d766fcad6d2.tar.gz
gcc-f3f6029db2e5f960c10062d8c8c74d766fcad6d2.tar.bz2
[6/6] Preprocessor forced macro location
https://gcc.gnu.org/ml/gcc-patches/2018-10/msg02044.html libcpp/ * internal.h (struct cpp_reader): Rename forced_token_location_p to forced_token_location and drop its pointerness. * include/cpplib.h (cpp_force_token_locations): Take location, not pointer to one. * init.c (cpp_create_reader): Adjust. * lex.c (cpp_read_main_file): gcc/c-family/ * c-opts.c (c_finish_options): Adjust cpp_force_token_locations call. gcc/fortran/ * cpp.c (gfc_cpp_init): Adjust cpp_force_token_locations call. From-SVN: r265692
Diffstat (limited to 'libcpp/lex.c')
-rw-r--r--libcpp/lex.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/libcpp/lex.c b/libcpp/lex.c
index 892cfc4..c6e34b3 100644
--- a/libcpp/lex.c
+++ b/libcpp/lex.c
@@ -2757,8 +2757,8 @@ _cpp_lex_direct (cpp_reader *pfile)
}
c = *buffer->cur++;
- if (pfile->forced_token_location_p)
- result->src_loc = *pfile->forced_token_location_p;
+ if (pfile->forced_token_location)
+ result->src_loc = pfile->forced_token_location;
else
result->src_loc = linemap_position_for_column (pfile->line_table,
CPP_BUF_COLUMN (buffer, buffer->cur));
@@ -3773,14 +3773,14 @@ cpp_token_val_index (const cpp_token *tok)
}
}
-/* All tokens lexed in R after calling this function will be forced to have
- their source_location the same as the location referenced by P, until
+/* All tokens lexed in R after calling this function will be forced to
+ have their source_location to be P, until
cpp_stop_forcing_token_locations is called for R. */
void
-cpp_force_token_locations (cpp_reader *r, source_location *p)
+cpp_force_token_locations (cpp_reader *r, source_location loc)
{
- r->forced_token_location_p = p;
+ r->forced_token_location = loc;
}
/* Go back to assigning locations naturally for lexed tokens. */
@@ -3788,5 +3788,5 @@ cpp_force_token_locations (cpp_reader *r, source_location *p)
void
cpp_stop_forcing_token_locations (cpp_reader *r)
{
- r->forced_token_location_p = NULL;
+ r->forced_token_location = 0;
}