(location_t): Move definition to..
* location.h: ... here. New file.
* tree.h: #include location.h
(DECL_SOURCE_LOCATION): New macro.
(DECL_SOURCE_FILE): Use.
(DECL_SOURCE_LINE): Likewise.
(struct tree_decl): REplace filename and linenum with locus.
* Makefile.in (TREE_H): add location.h
(diagnostic.o): Depends on gt-location.h
(gt-location.h): Depends on s-gtype
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@55364
138bc75d-0d04-0410-961f-
82ee72b054a4
+2002-07-09 Gabriel Dos Reis <gdr@codesourcery.com>
+
+ * diagnostic.h: #include location.h
+ (location_t): Move definition to..
+ * location.h: ... here. New file.
+ * tree.h: #include location.h
+ (DECL_SOURCE_LOCATION): New macro.
+ (DECL_SOURCE_FILE): Use.
+ (DECL_SOURCE_LINE): Likewise.
+ (struct tree_decl): REplace filename and linenum with locus.
+ * Makefile.in (TREE_H): add location.h
+ (diagnostic.o): Depends on gt-location.h
+ (gt-location.h): Depends on s-gtype
+
2002-07-09 Matt Kraai <kraai@alumni.cmu.edu>
* config/rs6000/aix.h: Convert CPP_PREDEFINES to
RTL_BASE_H = rtl.h rtl.def $(MACHMODE_H)
RTL_H = $(RTL_BASE_H) genrtl.h
PARAMS_H = params.h params.def
-TREE_H = tree.h tree.def $(MACHMODE_H) tree-check.h version.h builtins.def
+TREE_H = tree.h tree.def $(MACHMODE_H) tree-check.h version.h builtins.def \
+ location.h
BASIC_BLOCK_H = basic-block.h bitmap.h sbitmap.h varray.h
DEMANGLE_H = $(srcdir)/../include/demangle.h
RECOG_H = recog.h
$(SHELL) $(srcdir)/move-if-change tmp-preds.h tm-preds.h
$(STAMP) s-preds
-GTFILES = $(GCONFIG_H) \
+GTFILES = $(GCONFIG_H) $(srcdir)/location.h \
$(HASHTAB_H) \
$(srcdir)/bitmap.h $(srcdir)/function.h $(srcdir)/rtl.h $(srcdir)/optabs.h \
$(srcdir)/tree.h $(srcdir)/libfuncs.h $(srcdir)/hashtable.h $(srcdir)/real.h \
gt-expr.h gt-sdbout.h gt-optabs.h gt-bitmap.h gt-dwarf2out.h : s-gtype ; @true
gt-reg-stack.h gt-dependence.h : s-gtype ; @true
gt-c-common.h gt-c-decl.h gt-c-parse.h gt-c-pragma.h : s-gtype; @true
-gt-c-objc-common.h gtype-c.h : s-gtype ; @true
+gt-c-objc-common.h gtype-c.h gt-location.h : s-gtype ; @true
s-gtype: gengtype$(build_exeext) $(GTFILES)
./gengtype $(GTFILES)
#define GCC_DIAGNOSTIC_H
#include "obstack.h"
+#include "location.h"
/* The type of a text to be formatted according a format specification
along with a list of things. */
DK_LAST_DIAGNOSTIC_KIND
} diagnostic_t;
-/* The data structure used to record the location of a diagnostic. */
-typedef struct
-{
- /* The name of the source file involved in the diagnostic. */
- const char *file;
-
- /* The line-location in the source file. */
- int line;
-} location_t;
-
/* A diagnostic is described by the MESSAGE to send, the FILE and LINE of
its context and its KIND (ice, error, warning, note, ...) See complete
list in diagnostic.def. */
--- /dev/null
+/* Definition of location data type used in various part of GCC
+ Copyright (C) 2002 Free Software Foundation, Inc.
+ Contributed by Gabriel Dos Reis <gdr@codesourcery.com>
+
+This program is free software; you can redistribute it and/or modify it
+under the terms of the GNU General Public License as published by the
+Free Software Foundation; either version 2, or (at your option) any
+later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+ In other words, you are welcome to use, share and improve this program.
+ You are forbidden to forbid anyone else to use, share and improve
+ what you give them. Help stamp out software-hoarding! */
+
+#ifndef GCC_LOCATION_H
+#define GCC_LOCATION_H
+
+/* The data structure used to record a location in a translation unit. */
+struct location_s GTY (())
+{
+ /* The name of the source file involved. */
+ const char *file;
+
+ /* The line-location in the source file. */
+ int line;
+};
+typedef struct location_s location_t;
+
+#endif
+
#include "machmode.h"
#include "version.h"
+#include "location.h"
/* Codes of tree nodes */
was. If the declaration appears in several places (as for a C
function that is declared first and then defined later), this
information should refer to the definition. */
-#define DECL_SOURCE_FILE(NODE) (DECL_CHECK (NODE)->decl.filename)
-#define DECL_SOURCE_LINE(NODE) (DECL_CHECK (NODE)->decl.linenum)
+#define DECL_SOURCE_LOCATION(NODE) (DECL_CHECK (NODE)->decl.locus)
+#define DECL_SOURCE_FILE(NODE) (DECL_SOURCE_LOCATION (NODE).file)
+#define DECL_SOURCE_LINE(NODE) (DECL_SOURCE_LOCATION (NODE).line)
/* Holds the size of the datum, in bits, as a tree expression.
Need not be constant. */
#define DECL_SIZE(NODE) (DECL_CHECK (NODE)->decl.size)
struct tree_decl GTY(())
{
struct tree_common common;
- const char *filename;
- int linenum;
+ location_t locus;
unsigned int uid;
tree size;
ENUM_BITFIELD(machine_mode) mode : 8;