| .. | .. |
|---|
| 1 | +/* SPDX-License-Identifier: GPL-2.0-or-later */ |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * Copyright 2007 Jon Loeliger, Freescale Semiconductor, Inc. |
|---|
| 3 | | - * |
|---|
| 4 | | - * This program is free software; you can redistribute it and/or |
|---|
| 5 | | - * modify it under the terms of the GNU General Public License as |
|---|
| 6 | | - * published by the Free Software Foundation; either version 2 of the |
|---|
| 7 | | - * License, or (at your option) any later version. |
|---|
| 8 | | - * |
|---|
| 9 | | - * This program is distributed in the hope that it will be useful, |
|---|
| 10 | | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|---|
| 11 | | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
|---|
| 12 | | - * General Public License for more details. |
|---|
| 13 | | - * |
|---|
| 14 | | - * You should have received a copy of the GNU General Public License |
|---|
| 15 | | - * along with this program; if not, write to the Free Software |
|---|
| 16 | | - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 |
|---|
| 17 | | - * USA |
|---|
| 18 | 4 | */ |
|---|
| 19 | 5 | |
|---|
| 20 | 6 | #ifndef SRCPOS_H |
|---|
| .. | .. |
|---|
| 74 | 60 | int last_line; |
|---|
| 75 | 61 | int last_column; |
|---|
| 76 | 62 | struct srcfile_state *file; |
|---|
| 63 | + struct srcpos *next; |
|---|
| 77 | 64 | }; |
|---|
| 78 | 65 | |
|---|
| 79 | 66 | #define YYLTYPE struct srcpos |
|---|
| .. | .. |
|---|
| 93 | 80 | YYRHSLOC(Rhs, 0).last_column; \ |
|---|
| 94 | 81 | (Current).file = YYRHSLOC (Rhs, 0).file; \ |
|---|
| 95 | 82 | } \ |
|---|
| 83 | + (Current).next = NULL; \ |
|---|
| 96 | 84 | } while (0) |
|---|
| 97 | 85 | |
|---|
| 98 | 86 | |
|---|
| 99 | | -/* |
|---|
| 100 | | - * Fictional source position used for IR nodes that are |
|---|
| 101 | | - * created without otherwise knowing a true source position. |
|---|
| 102 | | - * For example,constant definitions from the command line. |
|---|
| 103 | | - */ |
|---|
| 104 | | -extern struct srcpos srcpos_empty; |
|---|
| 105 | | - |
|---|
| 106 | 87 | extern void srcpos_update(struct srcpos *pos, const char *text, int len); |
|---|
| 107 | 88 | extern struct srcpos *srcpos_copy(struct srcpos *pos); |
|---|
| 89 | +extern struct srcpos *srcpos_extend(struct srcpos *new_srcpos, |
|---|
| 90 | + struct srcpos *old_srcpos); |
|---|
| 108 | 91 | extern char *srcpos_string(struct srcpos *pos); |
|---|
| 92 | +extern char *srcpos_string_first(struct srcpos *pos, int level); |
|---|
| 93 | +extern char *srcpos_string_last(struct srcpos *pos, int level); |
|---|
| 94 | + |
|---|
| 109 | 95 | |
|---|
| 110 | 96 | extern void PRINTF(3, 0) srcpos_verror(struct srcpos *pos, const char *prefix, |
|---|
| 111 | 97 | const char *fmt, va_list va); |
|---|