aboutsummaryrefslogtreecommitdiff
path: root/libcpp/line-map.c
diff options
context:
space:
mode:
authorJoseph Myers <joseph@codesourcery.com>2009-04-18 17:36:28 +0000
committerJoseph Myers <joseph@codesourcery.com>2009-04-18 17:36:28 +0000
commit5758dceec7445879ec6e5dcccef581eab7299ec7 (patch)
tree59684b555702b1b2456e3b64f86fd190e1b48332 /libcpp/line-map.c
parentcbdac2fe8f2cd3c5e9af0a23a9da178db9056422 (diff)
libcpp:
PR preprocessor/39646 * include/line-map.h (enum lc_reason): Add LC_RENAME_VERBATIM. * line-map.c (linemap_add): Handle LC_RENAME_VERBATIM. * directives.c (do_line, do_linemarker): Use LC_RENAME_VERBATIM in place of LC_RENAME. gcc/testsuite: * gcc.dg/cpp/line8.c: New test. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@146319 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libcpp/line-map.c')
-rw-r--r--libcpp/line-map.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/libcpp/line-map.c b/libcpp/line-map.c
index cce699f3cfe..553cc2ab605 100644
--- a/libcpp/line-map.c
+++ b/libcpp/line-map.c
@@ -109,9 +109,12 @@ linemap_add (struct line_maps *set, enum lc_reason reason,
map = &set->maps[set->used];
- if (to_file && *to_file == '\0')
+ if (to_file && *to_file == '\0' && reason != LC_RENAME_VERBATIM)
to_file = "<stdin>";
+ if (reason == LC_RENAME_VERBATIM)
+ reason = LC_RENAME;
+
/* If we don't keep our line maps consistent, we can easily
segfault. Don't rely on the client to do it for us. */
if (set->depth == 0)