hc
2023-12-08 01573e231f18eb2d99162747186f59511f56b64d
kernel/scripts/dtc/srcpos.h
....@@ -1,20 +1,6 @@
1
+/* SPDX-License-Identifier: GPL-2.0-or-later */
12 /*
23 * 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
184 */
195
206 #ifndef SRCPOS_H
....@@ -74,6 +60,7 @@
7460 int last_line;
7561 int last_column;
7662 struct srcfile_state *file;
63
+ struct srcpos *next;
7764 };
7865
7966 #define YYLTYPE struct srcpos
....@@ -93,19 +80,18 @@
9380 YYRHSLOC(Rhs, 0).last_column; \
9481 (Current).file = YYRHSLOC (Rhs, 0).file; \
9582 } \
83
+ (Current).next = NULL; \
9684 } while (0)
9785
9886
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
-
10687 extern void srcpos_update(struct srcpos *pos, const char *text, int len);
10788 extern struct srcpos *srcpos_copy(struct srcpos *pos);
89
+extern struct srcpos *srcpos_extend(struct srcpos *new_srcpos,
90
+ struct srcpos *old_srcpos);
10891 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
+
10995
11096 extern void PRINTF(3, 0) srcpos_verror(struct srcpos *pos, const char *prefix,
11197 const char *fmt, va_list va);