aboutsummaryrefslogtreecommitdiff
path: root/gcc/toplev.c
diff options
context:
space:
mode:
authorDodji Seketeli <dodji@redhat.com>2014-07-16 10:33:27 +0000
committerDodji Seketeli <dodji@gcc.gnu.org>2014-07-16 12:33:27 +0200
commitc468587ac23c889abfa67ce8979e8baedcb349e9 (patch)
tree2b9dadc35640ecec96428e5e73e233c98df2477d /gcc/toplev.c
parent185b22783adf5355e8ba4701a1c090b27a17e313 (diff)
downloadgcc-c468587ac23c889abfa67ce8979e8baedcb349e9.zip
gcc-c468587ac23c889abfa67ce8979e8baedcb349e9.tar.gz
gcc-c468587ac23c889abfa67ce8979e8baedcb349e9.tar.bz2
Support location tracking for built-in macro tokens
When a built-in macro is expanded, the location of the token in the epansion list is the location of the expansion point of the built-in macro. This patch creates a virtual location for that token instead, effectively tracking locations of tokens resulting from built-in macro tokens. libcpp/ * include/line-map.h (line_maps::builtin_location): New data member. (line_map_init): Add a new parameter to initialize the new line_maps::builtin_location data member. * line-map.c (linemap_init): Initialize the line_maps::builtin_location data member. * macro.c (builtin_macro): Create a macro map and track the token resulting from the expansion of a built-in macro. gcc/ * input.h (is_location_from_builtin_token): New function declaration. * input.c (is_location_from_builtin_token): New function definition. * toplev.c (general_init): Tell libcpp what the pre-defined spelling location for built-in tokens is. Signed-off-by: Dodji Seketeli <dodji@redhat.com> From-SVN: r212637
Diffstat (limited to 'gcc/toplev.c')
-rw-r--r--gcc/toplev.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/toplev.c b/gcc/toplev.c
index e35b826..9e747e5 100644
--- a/gcc/toplev.c
+++ b/gcc/toplev.c
@@ -1157,7 +1157,7 @@ general_init (const char *argv0)
init_ggc ();
init_stringpool ();
line_table = ggc_alloc<line_maps> ();
- linemap_init (line_table);
+ linemap_init (line_table, BUILTINS_LOCATION);
line_table->reallocator = realloc_for_line_map;
line_table->round_alloc_size = ggc_round_alloc_size;
init_ttree ();