OSDN Git Service

* rtl.h (struct rtx_def): Remove the integrated flag.
[pf3gnuchains/gcc-fork.git] / gcc / input.h
1 /* Declarations for variables relating to reading the source file.
2    Used by parsers, lexical analyzers, and error message routines.
3    Copyright (C) 1993, 1997, 1998, 2000, 2003, 2004 Free Software Foundation, Inc.
4
5 This file is part of GCC.
6
7 GCC is free software; you can redistribute it and/or modify it under
8 the terms of the GNU General Public License as published by the Free
9 Software Foundation; either version 2, or (at your option) any later
10 version.
11
12 GCC is distributed in the hope that it will be useful, but WITHOUT ANY
13 WARRANTY; without even the implied warranty of MERCHANTABILITY or
14 FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
15 for more details.
16
17 You should have received a copy of the GNU General Public License
18 along with GCC; see the file COPYING.  If not, write to the Free
19 Software Foundation, 59 Temple Place - Suite 330, Boston, MA
20 02111-1307, USA.  */
21
22 #ifndef GCC_INPUT_H
23 #define GCC_INPUT_H
24
25 #include "line-map.h"
26 extern struct line_maps line_table;
27
28 /* The location for declarations in "<built-in>" */
29 #define BUILTINS_LOCATION ((source_location) 2)
30
31 typedef struct location_s GTY(())
32 {
33   /* The name of the source file involved.  */
34   const char *file;
35
36   /* The line-location in the source file.  */
37   int line;
38
39   /* FUTURE (but confuses gentype): int column. */
40 } expanded_location;
41
42 #ifdef USE_MAPPED_LOCATION
43
44 extern expanded_location expand_location (source_location);
45
46 #define UNKNOWN_LOCATION ((source_location) 0)
47 typedef source_location location_t; /* deprecated typedef */
48 typedef source_location source_locus; /* to be removed */
49
50 #else /* ! USE_MAPPED_LOCATION */
51
52 typedef struct location_s location_t;
53 typedef location_t *source_locus;
54
55 #define expand_location(FILELINE) (FILELINE)
56 extern location_t unknown_location;
57 #define UNKNOWN_LOCATION unknown_location
58
59 #endif /* ! USE_MAPPED_LOCATION */
60
61 struct file_stack
62 {
63   struct file_stack *next;
64   location_t location;
65 };
66
67 /* Top-level source file.  */
68 extern const char *main_input_filename;
69
70 extern location_t input_location;
71 #ifdef USE_MAPPED_LOCATION
72 extern void push_srcloc (location_t);
73 #else /* ! USE_MAPPED_LOCATION */
74 extern void push_srcloc (const char *name, int line);
75 #endif /* ! USE_MAPPED_LOCATION */
76 extern void pop_srcloc (void);
77
78 #define LOCATION_FILE(LOC) ((expand_location (LOC)).file)
79 #define LOCATION_LINE(LOC) ((expand_location (LOC)).line)
80
81 #define input_line LOCATION_LINE(input_location)
82 #define input_filename LOCATION_FILE(input_location)
83
84 /* Stack of currently pending input files.
85    The line member is not accurate for the innermost file on the stack.  */
86 extern struct file_stack *input_file_stack;
87
88 /* Incremented on each change to input_file_stack.  */
89 extern int input_file_stack_tick;
90
91 #endif