+2010-05-27 Joseph Myers <joseph@codesourcery.com>
+
+ * input.c: New file.
+ * input.h (main_input_filename): Move declaration to toplev.h.
+ * toplev.c (input_location, line_table): Move to input.c
+ * toplev.h (main_input_filename): Move declaration from input.h.
+ * tree.c (expand_location): Move to input.c.
+ * Makefile.in (OBJS-common): Add input.o.
+ (input.o): Add dependencies.
+
2010-05-27 Richard Guenther <rguenther@suse.de>
* lto-wrapper.c (maybe_unlink_file): Ignore unlink failure
ifcvt.o \
implicit-zee.o \
init-regs.o \
+ input.o \
integrate.o \
intl.o \
ira.o \
echo "#define BUILDING_GCC_VERSION (BUILDING_GCC_MAJOR * 1000 + BUILDING_GCC_MINOR)" >> bversion.h
$(STAMP) s-bversion
+input.o : input.c $(CONFIG_H) $(SYSTEM_H) coretypes.h intl.h $(INPUT_H)
+
toplev.o : toplev.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \
version.h $(RTL_H) $(FUNCTION_H) $(FLAGS_H) xcoffout.h $(INPUT_H) \
$(INSN_ATTR_H) output.h $(DIAGNOSTIC_H) debug.h insn-config.h intl.h \
--- /dev/null
+/* Data and functions related to line maps and input files.
+ Copyright (C) 2004, 2007, 2008, 2009, 2010
+ Free Software Foundation, Inc.
+
+This file is part of GCC.
+
+GCC 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 3, or (at your option) any later
+version.
+
+GCC 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 GCC; see the file COPYING3. If not see
+<http://www.gnu.org/licenses/>. */
+
+#include "config.h"
+#include "system.h"
+#include "coretypes.h"
+#include "intl.h"
+#include "input.h"
+
+/* Current position in real source file. */
+
+location_t input_location;
+
+struct line_maps *line_table;
+
+expanded_location
+expand_location (source_location loc)
+{
+ expanded_location xloc;
+ if (loc <= BUILTINS_LOCATION)
+ {
+ xloc.file = loc == UNKNOWN_LOCATION ? NULL : _("<built-in>");
+ xloc.line = 0;
+ xloc.column = 0;
+ xloc.sysp = 0;
+ }
+ else
+ {
+ const struct line_map *map = linemap_lookup (line_table, loc);
+ xloc.file = map->to_file;
+ xloc.line = SOURCE_LINE (map, loc);
+ xloc.column = SOURCE_COLUMN (map, loc);
+ xloc.sysp = map->sysp != 0;
+ };
+ return xloc;
+}
/* Declarations for variables relating to reading the source file.
Used by parsers, lexical analyzers, and error message routines.
- Copyright (C) 1993, 1997, 1998, 2000, 2003, 2004, 2007, 2008, 2009
+ Copyright (C) 1993, 1997, 1998, 2000, 2003, 2004, 2007, 2008, 2009, 2010
Free Software Foundation, Inc.
This file is part of GCC.
This could be removed but it hardly seems worth the effort. */
typedef source_location location_t;
-/* Top-level source file. */
-extern const char *main_input_filename;
-
extern location_t input_location;
#define LOCATION_FILE(LOC) ((expand_location (LOC)).file)
to optimize in process_options (). */
#define AUTODETECT_VALUE 2
-/* Current position in real source file. */
-
-location_t input_location;
-
-struct line_maps *line_table;
-
/* Name to use as base of names for dump output files. */
const char *dump_base_name;
/* A unique local time stamp, might be zero if none is available. */
extern unsigned local_tick;
+/* Top-level source file. */
+extern const char *main_input_filename;
+
extern const char *progname;
extern const char *dump_base_name;
extern const char *dump_dir_name;
return block;
}
-expanded_location
-expand_location (source_location loc)
-{
- expanded_location xloc;
- if (loc <= BUILTINS_LOCATION)
- {
- xloc.file = loc == UNKNOWN_LOCATION ? NULL : _("<built-in>");
- xloc.line = 0;
- xloc.column = 0;
- xloc.sysp = 0;
- }
- else
- {
- const struct line_map *map = linemap_lookup (line_table, loc);
- xloc.file = map->to_file;
- xloc.line = SOURCE_LINE (map, loc);
- xloc.column = SOURCE_COLUMN (map, loc);
- xloc.sysp = map->sysp != 0;
- };
- return xloc;
-}
-
\f
/* Like SET_EXPR_LOCATION, but make sure the tree can have a location.